RFR: 8364146: JList getScrollableUnitIncrement return 0 [v5]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Thu Oct 23 02:09:04 UTC 2025
On Wed, 22 Oct 2025 06:06:55 GMT, Tejesh R <tr at openjdk.org> wrote:
>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Add test
>
> src/java.desktop/share/classes/javax/swing/JList.java line 2534:
>
>> 2532: Rectangle r = getCellBounds(row, row);
>> 2533: return (r == null) ? 0 :
>> 2534: (r.height - (visibleRect.y - r.y) < 0) ? 0 : r.height - (visibleRect.y - r.y);
>
> Suggestion:
>
> ((r.height - (visibleRect.y - r.y)) < 0) ? 0 : r.height - (visibleRect.y - r.y);
>
> For better readability.
ok
> test/jdk/javax/swing/JList/JListTest.java line 47:
>
>> 45: SwingUtilities.invokeAndWait(() -> {
>> 46: try {
>> 47: f = new JFrame();
>
> Can this test be made headless ?
No, it seems it doesn't fail without the fix if it is headless, probably because the scrollable viewport will not be same if its not visible
> test/jdk/javax/swing/JList/JListTest.java line 80:
>
>> 78: }
>> 79: } finally {
>> 80: f.dispose();
>
> Null check and EDT is missing for dispose.
its already in EDT but null check added even though it probably will not be null as it is in the block
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26500#discussion_r2453737001
PR Review Comment: https://git.openjdk.org/jdk/pull/26500#discussion_r2453738662
PR Review Comment: https://git.openjdk.org/jdk/pull/26500#discussion_r2453739627
More information about the client-libs-dev
mailing list