RFR: 8305915: java/awt/Frame/FrameLocation/FrameLocation.java fails with "The frame location is wrong!"

Alexey Ivanov aivanov at openjdk.org
Thu Sep 18 18:49:44 UTC 2025


On Thu, 18 Sep 2025 14:51:46 GMT, Tejesh R <tr at openjdk.org> wrote:

> The test passed on CI machines with multiple test runs. Few stabilization fix has been made to make the test more robust.

What was the reason why the test failed?

`Frame` is supposed to work correctly even when used from the main thread (or another thread). If the test failed only because the frame object was accessed on the main thread, it could be a product bug.

What are the frame coordinates when the test fails? Do these coordinates correspond to those on a screenshot if you add taking one?

test/jdk/java/awt/Frame/FrameLocation/FrameLocation.java line 54:

> 52:                 Thread.sleep(2000);
> 53:             } catch (InterruptedException _) {
> 54:             }

What's the point of this change? To make backporting the changeset more complicated?

test/jdk/java/awt/Frame/FrameLocation/FrameLocation.java line 54:

> 52:                 Thread.sleep(2000);
> 53:             } catch (InterruptedException _) {
> 54:             }

`Robot.waitForIdle()` and `Robot.delay(1000)` are commonly used to add delays.

test/jdk/java/awt/Frame/FrameLocation/FrameLocation.java line 78:

> 76:                 f.dispose();
> 77:             }
> 78:         });

To ensure the frame is disposed of correctly when the test fails, this code should be in a `finally` block.

-------------

PR Review: https://git.openjdk.org/jdk/pull/27366#pullrequestreview-3241422973
PR Review Comment: https://git.openjdk.org/jdk/pull/27366#discussion_r2360653532
PR Review Comment: https://git.openjdk.org/jdk/pull/27366#discussion_r2360658982
PR Review Comment: https://git.openjdk.org/jdk/pull/27366#discussion_r2360670255


More information about the client-libs-dev mailing list