-
Notifications
You must be signed in to change notification settings - Fork 492
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
8345261: Refactor the Dimension2D classes #1653
base: master
Are you sure you want to change the base?
8345261: Refactor the Dimension2D classes #1653
Conversation
👋 Welcome back nlisker! A progress list of the required criteria for merging this PR into |
@nlisker This change is no longer ready for integration - check the PR body for details. |
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.
Looks good
Thanks John. Because it's the weekend I'll wait until Monday evening with this. |
@azvegint Can you take a quick look at this since you added the Dimension class as part of your initial Wayland Robot fix? |
These 3 classes are all different from each other. They use different types of variables to store data ( We have Switching from So I would prefer to keep the |
Thanks @azvegint. If the |
I also looked at the uses of |
Not sure if it helps, but when working on #1462, I also found that inconsistencies. I'm not sure why this happens, but maybe worth to take a deeper look. |
I am fine with it. |
/reviewers 2 |
@kevinrushforth |
modules/javafx.graphics/src/main/java/com/sun/javafx/geom/Dimension2D.java
Outdated
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/glass/ui/gtk/screencast/TokenStorage.java
Outdated
Show resolved
Hide resolved
modules/javafx.graphics/src/main/java/com/sun/javafx/geom/Dimension2D.java
Outdated
Show resolved
Hide resolved
You reviewed the PR before the requested changes were made :) |
@nlisker 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! |
@azvegint Please confirm that the change is acceptable. |
height = h; | ||
} | ||
} | ||
public record Dimension2Df(float width, float height) {} |
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.
is this class really needed?
Looks like it's only referenced from Arc2D::setArc()
and RectanglularShape::setFrame()
, as far as I can tell these two methods are never called.
Should all three be removed?
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 not familiar with these methods, but I did wonder why we need extra implementations in the initial comment.
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 like dead code left over from the original implementation.
I removed the class along with the two methods and jfx builds (you need to merge the latest master though) and runs (i.e. shows arcs and rectangles) just fine. Eclipse IDE also has no issues. I think we can remove these.
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 don't mind removing them in this PR if others agree.
In my opinion, inner classes are justified when the implementations are coupled, or when one thing only makes sense in the context of another thing. That doesn't seem to be the case here: What this suggests to me is that either |
A small refactoring of the Dimension classes.
com.sun.javafx.geom.Dimension
was removed and its uses were replaced bycom.sun.javafx.geom.Dimension2D
.com.sun.javafx.geom.Dimension2D
became a record.javafx.geometry.Dimension2D
: fields becamefinal
.I'm not sure we need the implementation class at all considering we are free to use the public one.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1653/head:pull/1653
$ git checkout pull/1653
Update a local copy of the PR:
$ git checkout pull/1653
$ git pull https://git.openjdk.org/jfx.git pull/1653/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1653
View PR using the GUI difftool:
$ git pr show -t 1653
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1653.diff
Using Webrev
Link to Webrev Comment