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

Andy Goryachev angorya at openjdk.org
Wed Nov 29 15:57:20 UTC 2023


On Wed, 29 Nov 2023 02:44:31 GMT, Nir Lisker <nlisker at openjdk.org> wrote:

> I'm unconvinced that this is the way to solve the issue it describes in its doc. The problem is that each control wants to add its own css metadata to that of its parent (recursively), and that the list is immutable (or unmodifiable).

This is not the problem.

> The solution offered is a helper method for the general problem of creating a new immutable list from an existing one plus other elements (I agree with John that it's another copy of this kind of method, which would probably mean it's a good candidate for the JDK).

I would not go that far as to call it a candidate for JDK, the scope of this change is limited to CssMetaData and is sufficiently different from a general purpose entity.


> What each class brings with itself is a list of its own metadata properties. That's all it should declare. This list should automatically be added to the one of its parent, recursively, forming the final list. This part shouldn't be done by users as it's just another place to make a mistake in.

True.  The only way to avoid mistake is to have this data generated by reflection or pre-processing.  Neither is a good alternative, so I am not solving this particular problem.  The problem I am trying to solve is to provide a slightly more efficient utility method to replace repeating the same code over and over.

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

PR Comment: https://git.openjdk.org/jfx/pull/1296#issuecomment-1832183789


More information about the openjfx-dev mailing list