RFR: 8328011: Convert java/awt/Frame/GetBoundsResizeTest/GetBoundsResizeTest.java applet test to main [v2]

Alexey Ivanov aivanov at openjdk.org
Wed Mar 13 18:30:16 UTC 2024


On Wed, 13 Mar 2024 00:53:36 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:

>> The test is converted to main.
>> Tested on Linux, Macos and Windows.
>
> Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   minor formatting

test/jdk/java/awt/Frame/GetBoundsResizeTest.java line 29:

> 27: import java.awt.Frame;
> 28: import java.awt.EventQueue;
> 29: import java.awt.Robot;

We haven't agreed on the order of imports, yet in most cases `javax.*` packages follow `java.*` packages.

test/jdk/java/awt/Frame/GetBoundsResizeTest.java line 47:

> 45:             2. Press the button to print the result of getBounds() to the terminal.
> 46:             3. If getBounds() prints the correct values for the window, click Pass,
> 47:              otherwise click Fail.

How do I determine whether the newly printed values are correct?

test/jdk/java/awt/Frame/GetBoundsResizeTest.java line 75:

> 73:         EventQueue.invokeAndWait(() ->
> 74:                 textArea.append("Original Frame.getBounds() = %s\n"
> 75:                         .formatted(frame.getBounds())));

Suggestion:

                textArea.append("Original Frame.getBounds() = %s\n"
                                .formatted(frame.getBounds())));

I believe @honkar-jdk made you update formatting… whereas the previous version looked right. Since `.formatted` is called on the string literal, it should be aligned to the start of the literal, to the opening quote. With such formatting, it could be misinterpreted to be called on the result of `textArea.append` which doesn't return anything.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18250#discussion_r1523648136
PR Review Comment: https://git.openjdk.org/jdk/pull/18250#discussion_r1523665403
PR Review Comment: https://git.openjdk.org/jdk/pull/18250#discussion_r1523662651


More information about the client-libs-dev mailing list