On Tue, 30 Nov 2021 11:02:41 GMT, Johan Vos <j...@openjdk.org> wrote:

>> After (re)setting the number of elements, make sure to do at least some 
>> estimation of the total size.
>> Added a testcase for this scenario.
>
> Johan Vos has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Move functionality in the setCellCount() to the invalidated block.
>   Some hard numbers used in tests (counters for evaluations) were changed 
> because of this.
>   Instead of relying on hard values, I modified the failing was into relative 
> ones.

modules/javafx.controls/src/main/java/javafx/scene/control/skin/VirtualFlow.java
 line 860:

> 858:             int cellCount = get();
> 859:             resetSizeEstimates();
> 860:             recalculateAndImproveEstimatedSize(2);

We can use recalculateEstimatedSize() instead of this method.
The effect is the same improvement with a size of 2.

modules/javafx.controls/src/test/java/test/javafx/scene/control/ListViewTest.java
 line 1124:

> 1122:                 Platform.runLater(() -> {
> 1123:                     Toolkit.getToolkit().firePulse();
> 1124:                     assertTrue(rt_35395_counter < 7);

I see that you have modified assertions to use "lesser than" some expected 
value. This may hide some incorrect test outcomes.
Along with "lesser than" assertion, do you think we should add a "greater than" 
assertion as well? This will have a range bounded expected value.
This is applicable for all assertion changes in this PR.

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

PR: https://git.openjdk.java.net/jfx/pull/683

Reply via email to