The following code will give a false positive for S2589.
public void MyTestMethod(int[] args)
{
object x = null;
object y = null;
foreach (int arg in args)
{
if (arg == 1)
x = new object();
else if (arg == 2)
y = new object();
}
if (x == null || y == null)
{
}
}