On Sat, 10 Dec 2022 13:39:42 GMT, Nir Lisker <nlis...@openjdk.org> wrote:

> On another note, I'm looking at ListExpression's add and other modifying 
> methods. It's calling EMPTY_LIST.add(element) where ObservableList EMPTY_LIST 
> = FXCollections.emptyObservableList();. Wouldn't that throw an exception 
> since it's an empty unmodifiable observable list?

I saw that code and its intentional.  I think the java doc at the top gives the 
hint:

> If the wrapped list of a {@code ListExpression} is {@code null}, all methods 
> implementing the {@code List} interface will behave as if they were applied 
> to an immutable empty list.

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

PR: https://git.openjdk.org/jfx/pull/969

Reply via email to