JFXTras to JavaFX 8 migration
martin.sladecek at oracle.com
Mon Apr 8 00:42:20 PDT 2013
if your ListSpinnerIntegerList doesn't implement RandomAccess interface,
you are not getting ObservableListWrapper, but
ObservableSequentialListWrapper instead. There's no reason not to
delegate this calls in ObservableSequentialListWrapper, esp. when it
will save us one extra class (iterator wrapper), so I will fix this.
On 04/06/2013 10:34 PM, Tom Eugelink wrote:
> I'm in the process of migrating my controls in JFXtras to JFX8. One of
> the issues I run in to is that my ListSpinner control gets stuck in a
> very long loop when it is used to spin over the years, where it does
> not on JFX2.2. The reason seems to be that the ObservableListWrapper,
> used to turn a regular List into a observable one (which is returned
> by FXCollections.observableList) is somehow by-passing the optimized
> indexOf that is implemented in my ListSpinnerIntegerList.
> ListSpinnerIntegerList extends AbstractList and overrides get() and
> size() to get an unmodifiable list as per JavaDoc.
> ListSpinnerIntegerList also overrides indexOf, because it has a very
> large range and instead of iterating, the index can easily be
> calculated from the value.
> In JFX 2.2 this works correctly, in JFX 8.0 the optimized indexOf is
> 'never' reached, but the JavaFX thread is busy in the iteration based
> implementation of indexOf in AbstractList.
> However, I cannot explain how it gets there and not in my optimized
> indexOf. The implementation of indexOf in ObservableListWrapper seems
> to forward it to the backing list.
> So I'm expecting
> call list.index() -> ObservableListWrapper.indexOf() ->
> backingList.indexOf() which is ListSpinnerIntegerList.indexOf()
> But that does not happen. The current workaround basically by
> overriding indexOf re-enforces the behavior of calling the backing list.
> See line 118 in
> I'm suspecting I'm not seeing the correct implementation of indexOf in
> How is indexOf implemented in ObservableListWrapper in 8.0?
More information about the openjfx-dev