RFR: JDK-8304959: Public API in javafx.css.Match should not return private API class PseudoClassState [v7]
John Hendrikx
jhendrikx at openjdk.org
Wed May 17 22:23:03 UTC 2023
On Wed, 17 May 2023 21:39:10 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> John Hendrikx has updated the pull request incrementally with three additional commits since the last revision:
>>
>> - Override hashCode with a comment explaining why
>> - Fix style issues
>> - Restore removed public method
>
> modules/javafx.graphics/src/main/java/javafx/scene/CssStyleHelper.java line 135:
>
>> 133: node.styleHelper.cacheContainer.forceSlowpath = true;
>> 134:
>> 135: if (triggerStates[0] != null) {
>
> I see that a null check was added.
> Are we sure we added it to *every* possible place?
>
> (it's not trivial to verify that with Eclipse without massive changes)
The underlying collection `BitSet` is only used by classes dealing with styles and pseudo class states. I checked the classes involved, and only this one needed changing. The check was added because `BitSet` erroneously allowed adding `null` before (which resulted in no change), but that breaks the `Set` contract.
In any case, adding a `null` collection is an error, we should never be lenient when it comes to `null`s.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1070#discussion_r1197109602
More information about the openjfx-dev
mailing list