IDEA-118082 "Constant conditions & exceptions" warning expected inside local class

This commit is contained in:
peter
2013-12-12 22:43:10 +01:00
parent 9729ea9b92
commit 3880c45980
2 changed files with 7 additions and 6 deletions
@@ -232,12 +232,8 @@ public class DataFlowRunner {
}
else if (instruction instanceof EmptyInstruction) {
PsiElement anchor = ((EmptyInstruction)instruction).getAnchor();
if (anchor instanceof PsiDeclarationStatement) {
for (PsiElement element : ((PsiDeclarationStatement)anchor).getDeclaredElements()) {
if (element instanceof PsiClass) {
registerNestedClosures(instructionState, (PsiClass)element);
}
}
if (anchor instanceof PsiClass) {
registerNestedClosures(instructionState, (PsiClass)anchor);
}
}
@@ -13,5 +13,10 @@ class Test {
}
}
}
class Local {
void s(@Nullable String s) {
final int i = <warning descr="Method invocation 's.hashCode()' may produce 'java.lang.NullPointerException'">s.hashCode()</warning>;
}
}
}
}