In a unit test, I could successfully parse your file.
Could you double check please, whether you have really executed the new PMD version?
Maybe the default language selection doesn't work as expected, could you try to select java8 explicitly and see what happens?
Found the problem: if you run PMD with the -D flag ("debug"), you'll see the exception:
java.lang.NullPointerException
at net.sourceforge.pmd.lang.java.symboltable.JavaNameOccurrence.isThisOrSuper(JavaNameOccurrence.java:189)
at net.sourceforge.pmd.lang.java.symboltable.ClassScope.findVariableHere(ClassScope.java:105)
at net.sourceforge.pmd.lang.java.symboltable.AbstractJavaScope.contains(AbstractJavaScope.java:33)
at net.sourceforge.pmd.lang.java.symboltable.Search.searchUpward(Search.java:45)
at net.sourceforge.pmd.lang.java.symboltable.Search.execute(Search.java:31)
at net.sourceforge.pmd.lang.java.symboltable.OccurrenceFinder.visit(OccurrenceFinder.java:36)
at net.sourceforge.pmd.lang.java.ast.ASTPrimaryExpression.jjtAccept(ASTPrimaryExpression.java:22)
at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:228)
at net.sourceforge.pmd.lang.java.ast.ASTExpression.jjtAccept(ASTExpression.java:22)
at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:372)
at net.sourceforge.pmd.lang.java.ast.ASTStatementExpression.jjtAccept(ASTStatementExpression.java:22)
...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In a unit test, I could successfully parse your file.
Could you double check please, whether you have really executed the new PMD version?
Maybe the default language selection doesn't work as expected, could you try to select java8 explicitly and see what happens?
Thanks.
Found the problem: if you run PMD with the
-D
flag ("debug"), you'll see the exception:This will be fixed with the next release.