別のツリーパススキャナーでメソッド本体にアクセスしようとしていますが、TreePath コンストラクターで常に NPE を取得するため、どのパラメーターを渡すかわかりません。
@Override
public Object visitMethod(MethodTree node, Trees p) {
...
node.getBody().accept(new MethodVisitor(m, repository), node.getBody());
...
}
public class MethodVisitor extends TreePathScanner<Object, BlockTree> {...}
例外:
An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.NullPointerException
at com.sun.source.util.TreePath.<init>(TreePath.java:94)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:65)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:90)
at com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:158)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:764)
at cz.cvut.kbss.odpa.parser.visitor.OdpaVisitor.visitMethod(OdpaVisitor.java:93)
at cz.cvut.kbss.odpa.parser.visitor.OdpaVisitor.visitMethod(OdpaVisitor.java:29)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:676)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
...
助けてくれてありがとう。