8378524: Compile-time constant generated through annotation processor is not usable in repeated annotation but fails compilation#30112
Conversation
… is not usable in repeated annotation but fails compilation
|
Hi @dbalek, welcome to this OpenJDK project and thanks for contributing! We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user dbalek" as summary for the issue. If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing |
|
@dbalek 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 130 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@lahodaj, @vicente-romero-oracle) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
/covered |
|
Thank you! Please allow for a few business days to verify that your employer has signed the OCA. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated! |
|
/reviewers 2 reviewer |
lahodaj
left a comment
There was a problem hiding this comment.
Looks good to me, but I think another (javac) Reviewer should look at this as well. Thanks!
|
/integrate |
|
/sponsor |
|
Going to push as commit c04fe76.
Your commit was automatically rebased without conflicts. |
Consider snippet like:
and the class
Constantsbeing generated by an annotation processor on the source compilation.Currently, while processing repeated annotations on class
Test,javacfirst creates a synthesizedAttribute.Compoundfor container annotationReps. Then, it creates a newJCAnnotationtree from this attribute and runs various validity checks upon this tree. Finally, it tries to attribute generated container annotation tree only to get (in ideal case) the sameAttribute.Compoundfrom which theJCAnnotationtree was generated.Moreover, since the values used in annotations
@Repare generated by an annotation processor in a later compilation phase, createdJCAnnotationtree containsJCErroneoustrees for unresolvedConstants.Cvalues. Running attribution on such tree produces the false errors mentioned in the bug report:expression not allowed as annotation value.The proposal here is:
Remove unnecessary attribution of the generated container annotation producing false errors. This change makes the resulting code to be similar to what is already done in the case of type annotations.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30112/head:pull/30112$ git checkout pull/30112Update a local copy of the PR:
$ git checkout pull/30112$ git pull https://git.openjdk.org/jdk.git pull/30112/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 30112View PR using the GUI difftool:
$ git pr show -t 30112Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30112.diff
Using Webrev
Link to Webrev Comment