Issue #1257: Fixed NPE in FinalLocalVariableCheck

This commit is contained in:
rnveach 2015-09-24 19:41:51 -04:00 committed by Roman Ivanov
parent ad7c6fbf2f
commit fbd04a537a
2 changed files with 9 additions and 0 deletions

View File

@ -282,6 +282,7 @@ public class FinalLocalVariableCheck extends Check {
DetailAST astTraverse = ast;
while (!(astTraverse.getType() == TokenTypes.METHOD_DEF
|| astTraverse.getType() == TokenTypes.CLASS_DEF
|| astTraverse.getType() == TokenTypes.ENUM_DEF
|| astTraverse.getType() == TokenTypes.CTOR_DEF)) {
astTraverse = astTraverse.getParent();
}

View File

@ -171,3 +171,11 @@ class A {
}
}
enum Enum1 {
;
{
int var = 0;
var = 1;
}
}