RFR: 8320796: CssMetaData.combine() [v5]
Michael Strauß
mstrauss at openjdk.org
Tue Nov 28 22:55:19 UTC 2023
On Tue, 28 Nov 2023 20:34:31 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> Provides a public utility method for use by the skins (core and custom) to simplify initialization of styleable properties.
>>
>>
>> + /**
>> + * Utility method which combines CssMetaData items in one unmodifiable list with the size equal to the number
>> + * of items it holds (i.e. with no unnecessary overhead).
>> + *
>> + * @param list the css metadata items, usually from the parent, not nullable
>> + * @param items the additional items
>> + * @return the unmodifiable list containing all of the items
>> + *
>> + * @since 22
>> + */
>> + public static List<CssMetaData<? extends Styleable, ?>> combine(
>> + List<CssMetaData<? extends Styleable, ?>> list,
>> + CssMetaData<? extends Styleable, ?>... items)
>
> Andy Goryachev has updated the pull request incrementally with one additional commit since the last revision:
>
> javadoc
modules/javafx.graphics/src/main/java/javafx/css/CssMetaData.java line 334:
> 332: * Utility method which combines {@code CssMetaData} items in one immutable list.
> 333: * <p>
> 334: * The intended usage is to combine the parent and the child CSS meta data for
Very minor: I think `metadata` should be a single word.
modules/javafx.graphics/src/main/java/javafx/css/CssMetaData.java line 347:
> 345: * This method returns an instance of {@link java.util.RandomAccess} interface.
> 346: *
> 347: * @param list the css metadata items, usually from the parent, must not be null
Two minor things:
1. I think you should either spell out the actual class name `CssMetaData`, or capitalize the `CSS`.
2. Maybe change the parameter name to `inherited`, `inheritedMetaData`, or something like this. I'd also remove the `usually from the parent` part, as this leaves the option that it might come from somewhere else (which isn't intended).
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1296#discussion_r1408512590
PR Review Comment: https://git.openjdk.org/jfx/pull/1296#discussion_r1408512309
More information about the openjfx-dev
mailing list