RFR: 8320796: CssMetaData.combine() [v4]
Michael Strauß
mstrauss at openjdk.org
Tue Nov 28 19:23:23 UTC 2023
On Tue, 28 Nov 2023 19:14:51 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> modules/javafx.graphics/src/main/java/javafx/css/CssMetaData.java line 342:
>>
>>> 340: */
>>> 341: public static List<CssMetaData<? extends Styleable, ?>> combine(
>>> 342: List<CssMetaData<? extends Styleable, ?>> list,
>>
>> Any reason this is specifically a `List`? Can it not be a `Collection`?
>
> It should have been a Set maybe, or indeed a Collection.
>
> But it is too late: Node codifies the List return values:
>
>
> public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData();
>
> public List<CssMetaData<? extends Styleable, ?>> getCssMetaData();
Nir was probably referring to the type of the `list` parameter.
As for the return value, not only must this be a `List`, it should also be mandated to be `RandomAccess`. Any implementation that doesn't support random access may cause severe performance degradation.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1296#discussion_r1408278402
More information about the openjfx-dev
mailing list