RFR: JDK-8304959: Public API in javafx.css.Match should not return private API class PseudoClassState [v7]

Andy Goryachev angorya at openjdk.org
Wed May 17 23:19:59 UTC 2023


On Wed, 17 May 2023 22:37:27 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

>> Since it's an internal class, and both PseudoClassState and StyleClassSet are final, checking for class == class is probably sufficient.
>> Do you think we should add a warning to BitSet, it is not a problem since no-one will ever extend it?
>
> This is also solved in #1076:
> 
>      if (obj instanceof BitSet<?> bitSet && getElementType().equals(bitSet.getElementType()))
> 
> But since that requires pulling in even more changes (`getElementType`) I've left it there.
> 
> Relying on subclasses being final though seems like a bad idea for an abstract class, unless we seal it and use permits (or, just remove `BitSet` completely... it's purpose will be minimal if #1076 is accepted).

that's my point.  I suppose we could use sealed class here, since javafx requires minimum java17?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1070#discussion_r1197153628


More information about the openjfx-dev mailing list