RFR: JDK-8181854: NullPointerException in com.sun.tools.javac.api.JavacTrees.getElement

Jan Lahoda jan.lahoda at oracle.com
Fri Aug 17 13:25:20 UTC 2018


Hi,

The problem described in this bug is that when the source code contains 
javadoc reference like:
{@link List<E> ...}
(which is not valid), calling DocTrees.getElement(DocTreePath) for the 
reference leads to a NPE. The reason is that internally, the method will 
call Attr.attribIdent for an AST that corresponds to "List<E>", but 
attribIdent can only handle identifiers and member selects. The proposed 
solution is to avoid calling attribIdent if the AST node is not an 
identifier or member select.

Webrev: http://cr.openjdk.java.net/~jlahoda/8181854/webrev.00/
JBS: https://bugs.openjdk.java.net/browse/JDK-8181854

Any feedback is welcome.

Thanks,
    Jan


More information about the compiler-dev mailing list