RFR: 8320796: CssMetaData.combine() [v4]

Andy Goryachev angorya at openjdk.org
Tue Nov 28 15:52:09 UTC 2023


On Tue, 28 Nov 2023 06:37:45 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

>> Andy Goryachev has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   combine
>
> modules/javafx.graphics/src/main/java/javafx/css/CssMetaData.java line 332:
> 
>> 330: 
>> 331:     /**
>> 332:      * Utility method which combines {@code CssMetaData} items in one unmodifiable list with size equal
> 
> Did you mean `immutable`?  As far as I know, the meaning of `unmodifiable` (in the Java world) means that the caller can't modify it, but the  provider still can.  For example:
> 
>       List<String> list = new ArrayList<>();
>       List<String> unmodifiableList = Collections.unmodifiableList(list);
>       list.add("A");  // both lists changed
> 
> Quote from collections docs:
> 
>> Note that changes to the backing collection might still be possible, and if they occur, they are visible through the unmodifiable view. Thus, an unmodifiable view collection is not necessarily immutable. However, if the backing collection of an unmodifiable view is effectively immutable, or if the only reference to the backing collection is through an unmodifiable view, the view can be considered effectively immutable.

Since this is not an observable list, the two are semantically equivalent, in my opinion.

@kevinrushforth should we say "immutable" here?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1296#discussion_r1407992280


More information about the openjfx-dev mailing list