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
8266027: The diamond finder does not find diamond candidates in field initializers #3713
Conversation
|
@lahodaj This change now passes all automated pre-integration checks. 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 43 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.
|
//became local variable. If it has some modifiers (except for final), an error | ||
//would be reported, causing the whole rewrite to fail. Removing the non-final | ||
//modifiers from the variable here: | ||
((JCVariableDecl) result).mods.flags &= Flags.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.
just curious: why preserving the FINAL flag anyway?
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.
No particular strong reason, just keeping what we can keep. We can clear the flags to 0
, if you prefer. I don't think that should cause issues (with the current set of Analyzers).
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'm fine with either approach was just curious, do as you consider best
/integrate |
@lahodaj Since your change was applied there have been 106 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit f0f6b0d. |
Consider code like:
Running with javac with
-XDfind=diamond
will not produce any warning about a possible diamond use. The reason is that the field:will get wrapped by a block, and attributed as a block, but since it has the
private
modifier, an error will be produced, and the transformation will be deemed impossible.The proposed solution is to clear the modifiers when/if wrapping fields with blocks.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3713/head:pull/3713
$ git checkout pull/3713
Update a local copy of the PR:
$ git checkout pull/3713
$ git pull https://git.openjdk.java.net/jdk pull/3713/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3713
View PR using the GUI difftool:
$ git pr show -t 3713
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3713.diff