On Wed, 25 Mar 2026 16:47:36 GMT, Marius Hanl <[email protected]> wrote:
>> Christopher Schnick has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> Remove unnecessary null checks
>
> modules/javafx.controls/src/main/java/javafx/scene/control/HeavyweightDialog.java
> line 55:
>
>> 53: @Override public void centerOnScreen() {
>> 54: Window owner = HeavyweightDialog.this.getOwner();
>> 55: if (owner != null && owner.getScene() != null &&
>> owner.isShowing() && (!(owner instanceof Stage ownerStage) ||
>> !ownerStage.isIconified())) {
>
> A test for the new condition: `owner.isShowing() && (!(owner instanceof Stage
> ownerStage) || !ownerStage.isIconified())` would also be a good idea
This would have to be manually tested to verify that the window is properly
centered. I think automating that is quite hard
> modules/javafx.controls/src/main/java/javafx/scene/control/HeavyweightDialog.java
> line 318:
>
>> 316:
>> 317: Scene oldScene = oldStage.getScene();
>> 318: if (oldScene != null && scene != null && dialogScene !=
>> null) {
>
> A bit confused by the code. So, do we need to check `scene != null` here?
I removed the check, the older parts of the code often don't make a lot of sense
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2127#discussion_r2989680292
PR Review Comment: https://git.openjdk.org/jfx/pull/2127#discussion_r2989676584