RFR: 8185886: Improve scrolling performance of TableView and TreeTableView

Jeanette Winzenburg fastegal at openjdk.java.net
Tue Feb 18 09:06:33 UTC 2020


On Wed, 12 Feb 2020 12:01:03 GMT, dannygonzalez <github.com+6702882+dannygonzalez at openjdk.org> wrote:

>> hmm ... wouldn't the change violate spec of adding listeners:
>> 
>>> If the same listener is added more than once, then it will be notified more than once.
> 
>> hmm ... wouldn't the change violate spec of adding listeners:
>> 
>> > If the same listener is added more than once, then it will be notified more than once.
> 
> True, I hadn't read that spec in ObservableValueBase. 
> Although that does seem odd behaviour to me. Obviously as the original implementation was using an array I can see how the implementation drove that specification.
> 
> Non of the JavaFx unit tests test for that specific case as the unit tests all passed. It would be nice if there was a specific test case for this behaviour.
> 
> I would need to store a registration count for each listener to satisfy this requirement.

> 
> Although that does seem odd behaviour to me. Obviously as the original implementation was using an array I can see how the implementation drove that specification.
> 

whatever drove it (had been so since the beginning ot java desktop, at least since the days of swing), there is no way to change it, is it?

> Non of the JavaFx unit tests test for that specific case as the unit tests all passed. It would be nice if there was a specific test case for this behaviour.
> 

yeah, the test coverage is ... not optimal :)

> I would need to store a registration count for each listener to satisfy this requirement.

a count plus some marker as to where it was added: 

   addListener(firstL)
   addListener(secondL)
   addListener(firstL)

must result in firstL.invalidated, seconL.invalidated, firstL.invalidated .. which brings us back to .. an array?

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

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


More information about the openjfx-dev mailing list