Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
/ jdk20 Public archive

8297988: NPE in JavacTypes.getOverriddenMethods from doclint #2

Closed
wants to merge 1 commit into from

Conversation

lahodaj
Copy link
Contributor

@lahodaj lahodaj commented Dec 8, 2022

[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 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 TaskListeners, 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

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8297988: NPE in JavacTypes.getOverriddenMethods from doclint

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

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 8, 2022

👋 Welcome back jlahoda! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 8, 2022
@openjdk
Copy link

openjdk bot commented Dec 8, 2022

@lahodaj The following label will be automatically applied to this pull request:

  • compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the compiler compiler-dev@openjdk.org label Dec 8, 2022
@mlbridge
Copy link

mlbridge bot commented Dec 8, 2022

Webrevs

Copy link

@vicente-romero-oracle vicente-romero-oracle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks sensible

@openjdk
Copy link

openjdk bot commented Dec 8, 2022

@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:

8297988: NPE in JavacTypes.getOverriddenMethods from doclint

Reviewed-by: vromero, jjg

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 master branch:

  • 553ba65: 8298402: ProblemList javax/swing/JFileChooser/4847375/bug4847375.java on windows-x64
  • d562d3f: 8297642: PhaseIdealLoop::only_has_infinite_loops must detect all loops that never lead to termination
  • fc52f21: 8298255: JFR provide information about dynamization of number of compiler threads
  • e555d54: 8298383: JFR: GenerateJfrFiles.java lacks copyright header
  • c084431: 8298379: JFR: Some UNTIMED events only sets endTime
  • ea108f5: 8298129: Let checkpoint event sizes grow beyond u4 limit
  • 165dcdd: 8297718: Make NMT free:ing protocol more granular
  • fbe7b00: 8298173: GarbageCollectionNotificationContentTest test failed: no decrease in Eden usage
  • d8ef60b: 8298272: Clean up ProblemList
  • 9353899: 8298175: JFR: Common timestamp for periodic events
  • ... and 61 more: https://git.openjdk.org/jdk20/compare/923c746650204e36053251c19cf91b7e41e938b0...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 8, 2022
@lahodaj
Copy link
Contributor Author

lahodaj commented Dec 9, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Dec 9, 2022

Going to push as commit 133ad8e.
Since your change was applied there have been 71 commits pushed to the master branch:

  • 553ba65: 8298402: ProblemList javax/swing/JFileChooser/4847375/bug4847375.java on windows-x64
  • d562d3f: 8297642: PhaseIdealLoop::only_has_infinite_loops must detect all loops that never lead to termination
  • fc52f21: 8298255: JFR provide information about dynamization of number of compiler threads
  • e555d54: 8298383: JFR: GenerateJfrFiles.java lacks copyright header
  • c084431: 8298379: JFR: Some UNTIMED events only sets endTime
  • ea108f5: 8298129: Let checkpoint event sizes grow beyond u4 limit
  • 165dcdd: 8297718: Make NMT free:ing protocol more granular
  • fbe7b00: 8298173: GarbageCollectionNotificationContentTest test failed: no decrease in Eden usage
  • d8ef60b: 8298272: Clean up ProblemList
  • 9353899: 8298175: JFR: Common timestamp for periodic events
  • ... and 61 more: https://git.openjdk.org/jdk20/compare/923c746650204e36053251c19cf91b7e41e938b0...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 9, 2022
@openjdk openjdk bot closed this Dec 9, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 9, 2022
@openjdk
Copy link

openjdk bot commented Dec 9, 2022

@lahodaj Pushed as commit 133ad8e.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler compiler-dev@openjdk.org integrated Pull request has been integrated
3 participants