Consider the code
if(x == null || x.size() == 0) {
doSomething();
continue;
}
System.out.println(x.size());
Let us extract the variable x.size().
I get:
int size = x.size();
if(x == null || size == 0) {...
This obviously has different semantics when x is null.
I don't see a semantics-preserving variant that would not cause code duplication of the 'then' clause, so I suggest to give out a warning dialog in such cases, or possibly to refuse doing such a dangerous 'refactoring' at all.