On Tue, 28 Jun 2022 16:56:27 GMT, Marius Hanl <mh...@openjdk.org> wrote:

>> modules/javafx.base/src/main/java/javafx/collections/FXCollections.java line 
>> 351:
>> 
>>> 349:     public static <E> ObservableList<E> observableArrayList(E... 
>>> items) {
>>> 350:         ArrayList<E> backingList = new ArrayList<>(items.length);
>>> 351:         backingList.addAll(Arrays.asList(items));
>> 
>> Did you try using `List.of` instead?
>> 
>> var backingList = new ArrayList<>(List.of(items));
>
> No, but `List.of` does not allow `null` values, therefore this would change 
> the existing behaviour as `null` is allowed in an observable arraylist.

That's a good point.

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

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

Reply via email to