-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Conversation
👋 Welcome back cushon! A progress list of the required criteria for merging this PR into |
Webrevs
|
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
test/langtools/tools/javac/annotations/NoTargetOnTypeParameterDeclaration.java
Outdated
Show resolved
Hide resolved
@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:
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 ➡️ To integrate this PR with the above commit message to the |
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.
thanks!
/csr needed |
Please file a CSR to review the change in behavior of javac to conform with the spec. |
@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. |
based on discussion in CSR.
I updated the patch so the change only applies for |
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 good, added a minor suggestion
test/langtools/tools/javac/annotations/typeAnnotations/NoTargetOnTypeParameterDeclaration.java
Show resolved
Hide resolved
@@ -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) : |
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.
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.
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.
right I agree we should add a new member to the Feature enum
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.
Will do, do you have an preferences for the name of the new constant? Maybe NO_TARGET_ANNOTATIONS_ARE_APPLICABLE_TO_TYPE_PARAMETER_DECLARATIONS
?
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.
not really but that one seems too long tbh
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.
I went with NO_TARGET_ANNOTATION_APPLICABILITY
, I'm happy to rename it
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 good
@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! |
/integrate |
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
Issues
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