Files
openide/java/java-tests/testData/refactoring/extractMethod/NullableCheck1_after.java
Tagir Valeev 43b86a988e CodeEditUtil#removeChildren: fixed nextLeaf determination
Before when removing more than one element, nextLeaf was invalid as well. The invalidation check below did not work as parent might still exist (element might be relinked to dummy file)

Fixes IDEA-187531 "Add on demand static import" with intervening comment and an empty line breaks code
2018-03-03 15:47:21 +07:00

25 lines
517 B
Java

import org.jetbrains.annotations.Nullable;
class Test {
String foo(int i, boolean flag) {
String xxx = newMethod(i, flag);
if (xxx == null) return null;
System.out.println(xxx);
return null;
}
@Nullable
private String newMethod(int i, boolean flag) {
String xxx = "";
if (flag) {
for (int j = 0; j < 100; j++) {
if (i == j) {
return null;
}
}
}
return xxx;
}
}