FilteredList/SortedList

Richard Bair richard.bair at oracle.com
Wed Jan 9 09:56:30 PST 2013


>>> TransformationList is not modifiable. We had a big discussion about this (together with Micheal Heinrichs) about 2 years ago a decided we have to make all TransformationList subclasses unmodifiable as otherwise it would break the List contract. We'd have to have special implementation of sort for the WrappedList.
>> Several collections in the JDK explicitly state they violate the contract of List / Map / Set in some way or other. I wonder if it would be better to do so here?
> Please, do we really have to start this discussion again? :-)
> 
> The problem is that the violation would be massive, only some things would work according to the contract, some only under specific conditions and it would also vary between filtered() and sorted(). If you consider getViewList() as a certain source of future bugs, it's nothing comparing to this. It would really require deep understanding of how these lists work and careful consideration of every step. Working with such API would be like walking in a minefield.
> 
> Last time it was Brian Goetz ho persuaded you, I'm sure I have the mail conversation somewhere…

Yesterday I had two specific cases where I had been persuaded against my better judgement on some API that is now biting us hard :-). I'm having a hard time thinking it is a good idea to do it again :-)

Richard


More information about the openjfx-dev mailing list