8297988: NPE in JavacTypes.getOverriddenMethods from doclint #2
Conversation
👋 Welcome back jlahoda! A progress list of the required criteria for merging this PR into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks sensible
@lahodaj This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 71 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit 133ad8e.
Your commit was automatically rebased without conflicts. |
[This PR was originally submitted as https://github.com/openjdk/jdk/pull/11535 to the mainline JDK.]
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 validatingexports
directive in themodule-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
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk20 pull/2/head:pull/2
$ git checkout pull/2
Update a local copy of the PR:
$ git checkout pull/2
$ git pull https://git.openjdk.org/jdk20 pull/2/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 2
View PR using the GUI difftool:
$ git pr show -t 2
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk20/pull/2.diff