RFR: JDK-8311983: ListView sometimes throws an IndexOutOfBoundsException [v2]

Marius Hanl mhanl at openjdk.org
Tue Aug 15 18:01:16 UTC 2023


On Tue, 15 Aug 2023 16:56:54 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Marius Hanl has updated the pull request incrementally with three additional commits since the last revision:
>> 
>>  - JDK-8311983: remove JUnit5 import
>>  - JDK-8311983: improve exception handling
>>  - JDK-8311983: More tests
>
> modules/javafx.controls/src/test/java/test/javafx/scene/control/skin/VirtualFlowTest.java line 1790:
> 
>> 1788:         // Scroll down.
>> 1789:         flow.shim_getVbar().adjustValue(0.9605263157894737);
>> 1790:         // Scroll up.
> 
> FYI: adding `pulse()` here prevents the exception.
> 
> We seem to have a similar situation on line 739 (this particular test is ignored, but there quite a few `pulse()`s scattered in the test code:
> 
>         // NOTE Run this test without the pulse and it fails!
>         pulse();
> 
> I wonder if there is something in the virtual flow that can detect when `flow.layout()` is needed and do it automatically.

Not sure, but it is fishy that it is called twice sometimes. So it is worth checking out if this can be optimized.

> modules/javafx.controls/src/test/java/test/javafx/scene/control/skin/VirtualFlowTest.java line 1799:
> 
>> 1797:     @Test
>> 1798:     public void testScrollBarValueAdjustmentShouldScrollOneDown() {
>> 1799:         flow = new VirtualFlowShim<>();
> 
> FYI: this test does not fail without the fix.  should it?

No.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1194#discussion_r1294936678
PR Review Comment: https://git.openjdk.org/jfx/pull/1194#discussion_r1294934567


More information about the openjfx-dev mailing list