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:17 UTC 2024
On Wed, 13 Mar 2024 18:26:28 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> 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.
>
> The same applies to the following event handler.
What can help to reduce the indentation is introducing a helper method. If it's still too long, store the result of formatting into a local variable and then append it to `textArea`. This can be done even in lambdas.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18250#discussion_r1523730416
More information about the client-libs-dev
mailing list