Withdrawn: 8297988: NPE in JavacTypes.getOverriddenMethods from doclint
Jan Lahoda
jlahoda at openjdk.org
Thu Dec 8 18:16:05 UTC 2022
On Tue, 6 Dec 2022 12:18:54 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
> There are a few cases where `javac` parses Java source code, reads some name from the AST, and throws it away. This is used e.g. when validating `exports` directive in the `module-info`, if there are no classfiles and no source files used in the current compilation from the given package, `javac` will peek into the sources in the package, looking at their package clause[1]. The ASTs produced by such parses are thrown away/not part of the upcoming compilation.
>
> But, even parses like this are reported to the `TaskListener`s, and some of the listeners may expect that the AST is eventually attributed - but it is not, as it was used only to read some name from the source code. Specifically, for DocLint, this may lead to an NPE, but it may cause other issues as well.
>
> The proposal here is to simply avoid sending the "parse" event for parses that are not part of the actual compilation.
>
> [1] https://github.com/openjdk/jdk/blob/84b927a05bcb7bf32a12829070ffd3a5670066d2/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java#L1040
This pull request has been closed without being integrated.
-------------
PR: https://git.openjdk.org/jdk/pull/11535
More information about the compiler-dev
mailing list