Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8266082: AssertionError in Annotate.fromAnnotations with -Xdoclint #4483

Closed
wants to merge 4 commits into from

Conversation

@jbf
Copy link
Member

@jbf jbf commented Jun 14, 2021

Javac crashes in Annotate when a javadoc reference contains an annotated type, since attribType expects type annotations to have been attributed.

This proposed fix checks references at parse time to disallow annotated types instead of crashing later on.

Since the exact type of error is known I opted for a new error message to make it easier for the developer to see what is wrong.

Since this affects javac at least as far back as jdk 11 and we are past RDP1 I targeted this for 18.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8266082: AssertionError in Annotate.fromAnnotations with -Xdoclint

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4483/head:pull/4483
$ git checkout pull/4483

Update a local copy of the PR:
$ git checkout pull/4483
$ git pull https://git.openjdk.java.net/jdk pull/4483/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4483

View PR using the GUI difftool:
$ git pr show -t 4483

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4483.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jun 14, 2021

👋 Welcome back jfranck! 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.

Loading

@openjdk openjdk bot added the rfr label Jun 14, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jun 14, 2021

@jbf The following labels will be automatically applied to this pull request:

  • compiler
  • javadoc

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

Loading

@mlbridge
Copy link

@mlbridge mlbridge bot commented Jun 14, 2021

Loading

CrashInAnnotateTest.java:10:5: compiler.err.proc.messager: annotations not allowed
CrashInAnnotateTest.java:14:5: compiler.err.proc.messager: annotations not allowed
CrashInAnnotateTest.java:16:10: compiler.warn.proc.messager: no comment
CrashInAnnotateTest.java:19:5: compiler.err.proc.messager: syntax error in reference
Copy link
Contributor

@vicente-romero-oracle vicente-romero-oracle Jun 15, 2021

Choose a reason for hiding this comment

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

I think that these syntax errors are because the annotation is fully qualified, you should use @Deprecated instead of java.lang.@Deprecated

Loading

Copy link
Member Author

@jbf jbf Jun 16, 2021

Choose a reason for hiding this comment

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

Yes and no. The parts other than the arguments are parsed in a different way that doesn't allow a space, see DocCommentParser.java:417 . Since there can be no space it is impossible to insert a type annotation in a type. I have updated the test with a few more examples.

I'm not looking to unify parsing in this PR, IMO it is enough to 1) not crash and 2) provide a friendly message.

Loading

Copy link
Contributor

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

looks good, thanks

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Jun 16, 2021

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

8266082: AssertionError in Annotate.fromAnnotations with -Xdoclint

Reviewed-by: vromero

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 42 new commits pushed to the master branch:

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.

Loading

@openjdk openjdk bot added the ready label Jun 16, 2021
@jbf
Copy link
Member Author

@jbf jbf commented Jun 21, 2021

/integrate

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Jun 21, 2021

Going to push as commit 0b8a0e2.
Since your change was applied there have been 105 commits pushed to the master branch:

  • b7d78a5: Merge
  • b8f073b: 8268316: Typo in JFR jdk.Deserialization event
  • b9d7337: 8268638: semaphores of AsyncLogWriter may be broken when JVM is exiting.
  • 8caeca0: 8264775: ClhsdbFindPC still fails with java.lang.RuntimeException: 'In java stack' missing from stdout/stderr
  • 7e03cf2: 8265073: XML transformation and indentation when using xml:space
  • 60389ee: 8269025: jsig/Testjsig.java doesn't check exit code
  • dab00ee: 8266518: Refactor and expand scatter/gather tests
  • f9c8c1c: 8268903: JFR: RecordingStream::dump is missing @SInCE
  • d8a0582: 8265369: [macos-aarch64] java/net/MulticastSocket/Promiscuous.java failed with "SocketException: Cannot allocate memory"
  • 21abcc4: 8268564: mark hotspot serviceability/attach tests which ignore external VM flags
  • ... and 95 more: https://git.openjdk.java.net/jdk/compare/c4207355d3fc19687c72f47edf21611ffed7efaf...master

Your commit was automatically rebased without conflicts.

Loading

@openjdk openjdk bot closed this Jun 21, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Jun 21, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jun 21, 2021

@jbf Pushed as commit 0b8a0e2.

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

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants