-
Notifications
You must be signed in to change notification settings - Fork 461
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
JDK-8297413: Remove easy warnings in javafx.graphics #960
JDK-8297413: Remove easy warnings in javafx.graphics #960
Conversation
👋 Welcome back jhendrikx! 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.
I spot checked the changes. Someone else will need to review it thoroughly.
Overall, I see the following changes as non-controversial:
- removing unused imports
- adding missing
@Override
- removing redundant semicolons
- using the diamond operator
The following might need a little more discussion in some cases:
- removing "redundant" casts -- in addition to not always being 100% equivalent (the case where a value is cast to a subclass and later assigned to a superclass), I left a few comments on places where removing redundant floating point casts makes it harder to quickly reason about whether the code is correct.
- removing instanceof (which I didn't see here, but we had discussed in another PR)
As long as the ones in this second list are checked carefully enough, this should be fine, but it isn't as quick a review as it might otherwise be.
modules/javafx.graphics/src/main/java/com/sun/glass/ui/gtk/GtkMenuDelegate.java
Outdated
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/javafx/application/LauncherImpl.java
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/javafx/font/PrismFontFile.java
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/RotateGestureRecognizer.java
Outdated
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/UploadingPainter.java
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/prism/d3d/D3DTextureData.java
Outdated
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/prism/d3d/D3DVramPool.java
Outdated
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/prism/es2/ES2VramPool.java
Outdated
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/prism/impl/ps/PaintHelper.java
Show resolved
Hide resolved
Given the shear number of changes, a second reviewer is in order. /reviewers 2 |
@kevinrushforth |
It's clear that the unnecessary cast removal is causing many discussions, so I think its best to back out that change. The danger in many unnecessary casts is that they can become real casts after a seemingly innocuous change, so it is mostly a benefit to make refactors easier to reason about. Unnecessary casts turning into down casts are the ones that will cause trouble:
However, after a refactor:
The extra precision that one may have hoped to gain is still lost. Similarly:
Refactor:
The code may now raise a |
I don't see a problem with removal of the unnecessary casts for numbers.
In any case, unnecessary casts for non-numeric types should still be removed since the whole precision argument is irrelevant, so I don't think that the warning should be disabled. |
It makes no sense to enable the warning and not fix all the warnings in the code. I would like to see 0 warnings in the problem list. |
The warning is for all unnecessary casts, which removes a lot of clutter. If, in some special cases, the cast is deemed to be beneficial, then it can stay. The warning should not be disabled because it's irrelevant to <1% of the cases. We can maybe fix this with a suppress warning (if one is available). If you don't want to see the warning, turn it off, but it doesn't mean it shouldn't be addressed. |
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 overall. Approval pending decisions on the few outstanding comments.
...s/javafx.graphics/src/main/java/com/sun/glass/ui/monocle/LinuxAbsoluteInputCapabilities.java
Outdated
Show resolved
Hide resolved
...javafx.graphics/src/main/java/com/sun/glass/ui/monocle/LinuxStatefulMultiTouchProcessor.java
Outdated
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/glass/ui/win/WinHTMLCodec.java
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/prism/d3d/D3DTextureData.java
Outdated
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/prism/d3d/D3DVramPool.java
Outdated
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/prism/j2d/J2DPresentable.java
Outdated
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/prism/j2d/J2DPrismGraphics.java
Outdated
Show resolved
Hide resolved
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.
There is at least one place where you removed a cast in such a way that the modified code is not equivalent. That change must be reverted before this PR can be accepted. Additionally, I request a change to the time calculation in the gesture recognizer classes.
See inline comments for details.
modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/RotateGestureRecognizer.java
Outdated
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/RotateGestureRecognizer.java
Outdated
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java
Outdated
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/prism/es2/ES2VramPool.java
Outdated
Show resolved
Hide resolved
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.
Additional inline comments.
modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java
Outdated
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/UploadingPainter.java
Show resolved
Hide resolved
This is one giant pull request, somewhat difficult on the reviewers, especially since we have to go through it several times. It would be much easier for the reviewers to deal with one fix per PR, especially in the cases where more than 30 files are going to be touched. For example, changes involving diamond operator and missing @OVERRIDES could have been made into two separate PRs, making it a breeze to review and integrate, while also cutting down on the number of files which contained non-trivial changes. What do you think? |
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.
1 revert and a follow-up bug is requested.
modules/javafx.graphics/src/main/java/com/sun/javafx/application/LauncherImpl.java
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/javafx/css/PseudoClassState.java
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/javafx/font/PrismFontFile.java
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/javafx/font/PrismFontFile.java
Show resolved
Hide resolved
Agreed, they'll be smaller and more focused in the future. |
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.
explanations accepted.
@hjohn 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 19 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 (@kevinrushforth, @nlisker, @andy-goryachev-oracle) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
@hjohn Kevin has outstanding requests. Even though you can technically integrate, you should resolve these with him. |
Yes, I will wait until @kevinrushforth had time to take another look. |
/integrate |
/sponsor |
Going to push as commit f333662.
Your commit was automatically rebased without conflicts. |
good job @hjohn ! |
@Override
annotationsProgress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx pull/960/head:pull/960
$ git checkout pull/960
Update a local copy of the PR:
$ git checkout pull/960
$ git pull https://git.openjdk.org/jfx pull/960/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 960
View PR using the GUI difftool:
$ git pr show -t 960
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/960.diff