RFR: 8365379: SU3.applyInsets may produce wrong results [v12]
Alexey Ivanov
aivanov at openjdk.org
Tue Sep 16 13:55:28 UTC 2025
On Tue, 16 Sep 2025 13:27:33 GMT, Renjith Kannath Pariyangad <rkannathpari at openjdk.org> wrote:
>> Hi Reviewers,
>>
>> I have updated the insets calculation, similar calculation observed in **SynthGraphicsUtils.java**. Reused the **SwingUtilities3.java** modified code
>>
>> Please review and let me know your suggestions if any.
>
> Renjith Kannath Pariyangad has updated the pull request incrementally with one additional commit since the last revision:
>
> Updated test and function call
Looks good to me except for additional pair of parentheses in `RuntimeException` constructor.
test/jdk/com/sun/java/swing/SwingUtilities3/ApplyInsetsTest.java line 48:
> 46: SwingUtilities3.applyInsets(rect, insets);
> 47: if (!rect.equals(expected)) {
> 48: throw new RuntimeException(("Test failed: expected " + expected + " but got " + rect));
Suggestion:
throw new RuntimeException("Test failed: expected " + expected + " but got " + rect);
No need for the additional parentheses.
test/jdk/com/sun/java/swing/SwingUtilities3/ApplyInsetsTest.java line 57:
> 55: if (!rect.equals(expected)) {
> 56: throw new RuntimeException(("Right to left test failed: expected " + expected +
> 57: " but got " + rect));
Suggestion:
throw new RuntimeException("Right to left test failed: expected " + expected +
" but got " + rect);
No need for the additional pair of parentheses.
-------------
Marked as reviewed by aivanov (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/27157#pullrequestreview-3230050117
PR Review Comment: https://git.openjdk.org/jdk/pull/27157#discussion_r2352546611
PR Review Comment: https://git.openjdk.org/jdk/pull/27157#discussion_r2352554519
More information about the client-libs-dev
mailing list