-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8244681: Add a warning for possibly lossy conversion in compound assignments #8599
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
Conversation
…gnments jdk.internal.le make patch to disable warnings
👋 Welcome back asotona! A progress list of the required criteria for merging this PR into |
@asotona The following labels 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 lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
/reviewers 2 reviewer |
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.
Build changes look good.
@erikj79 |
I see there is already a bug filed to address situations found by the new warning in the JDK's libraries (JDK-8286374). As a matter of policy, I recommend the (potential) warnings be addressed in at least the java.base and java.desktop modules before the new warning is enabled. In other words, a priority should be given to keeping java.base and java.desktop compiling successfully with all warnings enabled. |
I agree with the priority to keep java.base and java.desktop clean from possibly lossy conversions, so the related issues should probably raise from P4 priority level. However this lint warning as a part of the javac is critical to confirm that the situations have been correctly addressed.
From complexity and cost perspective I prefer the second scenario. |
…gnments recommended correction of the warning wording fixed typo in test method name
src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties
Outdated
Show resolved
Hide resolved
…gnments recommended correction of the warning description
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.
Check updates on JDK-8286374 subtasks.
Lossy conversion issues for jdk.jfr and jdk.management.jfr. have been fixed. |
Mailing list message from Patrick Chen on build-dev: I checked you pr look good to me @Roger Le mer. 11 mai 2022 ? 15:35, Roger Riggs <rriggs at openjdk.java.net> a ?crit : |
…gnments re-enabled warnings for java.base, java.rmi and java.smartcardio
…pto.ec and jdk.internal.le
@asotona 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! |
ping to keep the PR open |
@asotona 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! |
/issue add JDK-8293797 |
@asotona |
Please review also linked Release Note issue. Thanks, |
@asotona 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 9 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 |
Going to push as commit aff5ff1.
Your commit was automatically rebased without conflicts. |
/issue remove JDK-8293797 |
@asotona The command |
Please review this patch adding new lint option, lossy-conversions, to javac to warn about type casts in compound assignments with possible lossy conversions.
The new lint warning is shown if the type of the right-hand operand of a compound assignment is not assignment compatible with the type of the variable.
The implementation of the warning is based on similar check performed to emit "possible lossy conversion" compilation error for simple assignments.
Proposed patch also include complex matrix-style test with positive and negative test cases of lossy conversions in compound assignments.
Proposed patch also disables this new lint option in all affected JDK modules and libraries to allow smooth JDK build. Individual cases to address possibly lossy conversions warnings in JDK are already addressed in a separate umbrella issue and its sub-tasks.
Thanks for your review,
Adam
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/8599/head:pull/8599
$ git checkout pull/8599
Update a local copy of the PR:
$ git checkout pull/8599
$ git pull https://git.openjdk.org/jdk pull/8599/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 8599
View PR using the GUI difftool:
$ git pr show -t 8599
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/8599.diff