[REVIEW REQUEST] Improvements to TableView sorting

Jonathan Giles jonathan.giles at oracle.com
Tue Feb 19 14:41:09 PST 2013


My understanding is that, due to historical reasons, a list can be 
considered unmodifiable if, when a modification is attempted, you 
receive an exception of the following types:

UnsupportedOperationException - if the add operation is not supported by 
this list
ClassCastException - if the class of the specified element prevents it 
from being added to this list
NullPointerException - if the specified element is null and this list 
does not permit null elements
IllegalArgumentException - if some property of this element prevents it 
from being added to this list

Ideally there would be a nicer way, but we have to also play nice with 
what the Java collections API give us.

In other words, TableView will attempt to sort in all instances, and 
will react appropriately to what it finds when this is attempted.

-- Jonathan

On 20/02/2013 11:37 a.m., Knut Arne Vedaa wrote:
>> If the list is unmodifiable then it will not be sorted by TableView.
>> SortedList is not sorted by TableView because it is unmodifiable, not
>> because it is a SortedList.
>
> I'm confused. How does TableView know that the list is unmodifiable?
>
>
> Knut Arne



More information about the openjfx-dev mailing list