Fix bug with empty statements in the body of a class

This commit is contained in:
oowekyala
2017-07-15 18:39:13 +02:00
parent e270ff13f6
commit 5e887b61d3

View File

@ -210,7 +210,7 @@ import net.sourceforge.pmd.lang.java.oom.signature.OperationSignature;
List<ASTMethodOrConstructorDeclaration> operations = new ArrayList<>();
for (ASTAnyTypeBodyDeclaration decl : node.getDeclarations()) {
if (decl.jjtGetChild(0) instanceof ASTMethodOrConstructorDeclaration) {
if (decl.jjtGetNumChildren() > 0 && decl.jjtGetChild(0) instanceof ASTMethodOrConstructorDeclaration) {
operations.add((ASTMethodOrConstructorDeclaration) decl.jjtGetChild(0));
}
}