extract method: allow to extract @NotNull code with missed branches which would be replaced with 'return null' with check on call site (IDEA-120076)

This commit is contained in:
Anna Kozlova
2014-11-27 18:12:53 +01:00
parent 6ff126e422
commit 83d3df6a95
6 changed files with 112 additions and 41 deletions
@@ -0,0 +1,16 @@
class C {
public Object m() {
Object o = newMethod();
if (o != null) return o;
return null;
}
private Object newMethod() {
for (Object o : new ArrayList<Object>()) {
if (o != null) {
return o;
}
}
return null;
}
}