-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
8253385: annotation processors remove varargs information from record components #709
8253385: annotation processors remove varargs information from record components #709
Conversation
👋 Welcome back vromero! A progress list of the required criteria for merging this PR into |
@vicente-romero-oracle The following label will be automatically applied to this pull request:
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. |
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.
minor suggestions in comments
@@ -1785,19 +1785,27 @@ public void setData(Object data) { | |||
*/ | |||
private final int pos; | |||
|
|||
private boolean isVarargs; |
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.
field can be final?
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.
sure will do
@Target({ElementType.TYPE_USE}) | ||
@interface Simple {} | ||
|
||
record R(@Simple int ...val) { |
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.
(minor) unusual typography for "int ...val". Suggest "int... val"
@Target({ElementType.TYPE_USE}) | ||
@interface Simple {} | ||
|
||
record R(@Simple int ...val) { |
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.
(minor) unusual typography for "int ...val". Suggest "int... val"
@vicente-romero-oracle 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 3 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
/integrate |
@vicente-romero-oracle Since your change was applied there have been 6 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 97a81ce. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
thanks for the review |
Please review this fix for a corner case bug. Essentially for code like:
assuming that there is an AP present, after the first annotation processing round, the record component's symbol is set to
null
and thus the flags info is lost. So once the symbols and their types are determined again after every annotation processing round, there is no recollection that the record component was a varargs. Remember that the AST for the record component declaration is not kept but it is used to extract information from it and to derive compiler generated code like fields, canonical constructor, etc. The proposed solution is to keep the information about the vararg-ness of the record component in a dedicated field in the record component so that this information can be recovered later on as needed.TIA,
Vicente
Progress
Testing
Failed test tasks
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/709/head:pull/709
$ git checkout pull/709