forked from phoedos/pmd
pmd: fix NPE in ConstructorCallsOverridableMethodRule
This commit is contained in:
@ -941,6 +941,7 @@ public final class ConstructorCallsOverridableMethodRule extends AbstractJavaRul
|
||||
Node expression = argumentList.jjtGetChild(a);
|
||||
ASTPrimaryPrefix arg = expression.getFirstDescendantOfType(ASTPrimaryPrefix.class);
|
||||
String type = "<unknown>";
|
||||
if (arg != null && arg.jjtGetNumChildren() > 0) {
|
||||
if (arg.jjtGetChild(0) instanceof ASTLiteral) {
|
||||
ASTLiteral lit = (ASTLiteral) arg.jjtGetChild(0);
|
||||
if (lit.isCharLiteral()) {
|
||||
@ -958,6 +959,7 @@ public final class ConstructorCallsOverridableMethodRule extends AbstractJavaRul
|
||||
// ASTName n = (ASTName)arg.jjtGetChild(0);
|
||||
type = "ref";
|
||||
}
|
||||
}
|
||||
argumentTypes.add(type);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user