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

8303784: no-@Target annotations should be applicable to type parameter declarations #12914

Closed
wants to merge 6 commits into from

Conversation

cushon
Copy link
Contributor

@cushon cushon commented Mar 8, 2023

Please consider this fix for https://bugs.openjdk.org/browse/JDK-8303784, which make @Target-less annotations applicable to type parameter declarations.

@Target-less annotations are applicable to 'all declaration contexts', which includes type parameter declarations.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Change requires CSR request JDK-8304169 to be approved
  • Commit message must refer to an issue

Issues

  • JDK-8303784: no-@target annotations should be applicable to type parameter declarations
  • JDK-8304169: no-@target annotations should be applicable to type parameter declarations (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/12914/head:pull/12914
$ git checkout pull/12914

Update a local copy of the PR:
$ git checkout pull/12914
$ git pull https://git.openjdk.org/jdk.git pull/12914/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12914

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12914.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 8, 2023

👋 Welcome back cushon! 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 Mar 8, 2023
@openjdk
Copy link

openjdk bot commented Mar 8, 2023

@cushon 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 Mar 8, 2023
@mlbridge
Copy link

mlbridge bot commented Mar 8, 2023

Webrevs

Copy link
Contributor

@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 Mar 14, 2023

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

8303784: no-@Target annotations should be applicable to type parameter declarations

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 Mar 14, 2023
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks!

@jddarcy
Copy link
Member

jddarcy commented Mar 14, 2023

/csr needed

@jddarcy
Copy link
Member

jddarcy commented Mar 14, 2023

Please file a CSR to review the change in behavior of javac to conform with the spec.

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Mar 14, 2023
@openjdk
Copy link

openjdk bot commented Mar 14, 2023

@jddarcy has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@cushon please create a CSR request for issue JDK-8303784 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Mar 14, 2023
based on discussion in CSR.
@cushon
Copy link
Contributor Author

cushon commented Mar 21, 2023

I updated the patch so the change only applies for --release >= 14, based on feedback in the CSR

Copy link
Contributor

@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 good, added a minor suggestion

@@ -3512,7 +3512,7 @@ boolean isOverrider(Symbol s) {
protected boolean isTypeAnnotation(JCAnnotation a, boolean isTypeParameter) {
List<Attribute> targets = typeAnnotations.annotationTargets(a.annotationType.type.tsym);
return (targets == null) ?
false :
(source.compareTo(Source.JDK14) >= 0 && isTypeParameter) :
Copy link
Member

Choose a reason for hiding this comment

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

Usually this kind of test is done using a constant in the Feature enum; I'll let Vicente or other engineer who focuses on javac weigh in on whether or not the direct comparison is acceptable in this case.

Copy link
Contributor

Choose a reason for hiding this comment

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

right I agree we should add a new member to the Feature enum

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do, do you have an preferences for the name of the new constant? Maybe NO_TARGET_ANNOTATIONS_ARE_APPLICABLE_TO_TYPE_PARAMETER_DECLARATIONS?

Copy link
Contributor

Choose a reason for hiding this comment

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

not really but that one seems too long tbh

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went with NO_TARGET_ANNOTATION_APPLICABILITY, I'm happy to rename it

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels Mar 23, 2023
Copy link
Contributor

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

@bridgekeeper
Copy link

bridgekeeper bot commented May 1, 2023

@cushon This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@cushon
Copy link
Contributor Author

cushon commented May 2, 2023

/integrate

@openjdk
Copy link

openjdk bot commented May 2, 2023

Going to push as commit 8c106b0.
Since your change was applied there has been 1 commit pushed to the master branch:

  • b76f320: 8307123: Fix deprecation warnings in DPrinter

Your commit was automatically rebased without conflicts.

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

openjdk bot commented May 2, 2023

@cushon Pushed as commit 8c106b0.

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

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