Community
Participate
Working Groups
From Ed Merks: > In ObservableList, this doesn't seem quite right because it provides > direct access to the underlying wrapped list. > > public List subList(int fromIndex, int toIndex) { > getterCalled(); > return wrappedList.subList(fromIndex, toIndex); > }
Fixed in HEAD > 20080203. (I chose the simplest possible fix that makes the sublist unmodifiable. Code contributions for a better implementation are welcome!)
Verified the simple fix by code inspection on Windows XP using I20080205-0010. However, I am going to reopen this bug because subList returns an observable list, but does not fire change events as the underlying list is modified. To get this right would require real work, for which I don't have enough time right now.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
This bug is still valid. A possible easy fix is to change ObservableList.subList to return a non-observable, unmodifiable list view. This however breaks backwards (undocumented) behavioural compatibility. To me that seems warranted in this case.