RFR: JDK-8199216: Quadratic layout time with nested nodes and pseudo-class in style sheet [v8]

John Hendrikx jhendrikx at openjdk.org
Wed Jul 5 22:22:07 UTC 2023


On Wed, 5 Jul 2023 20:47:20 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> John Hendrikx has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 16 commits:
>> 
>>  - Merge branch 'master' of https://git.openjdk.org/jfx into
>>    feature/immutable-pseudoclassstate
>>  - Merge remote-tracking branch 'upstream/master' into feature/immutable-pseudoclassstate
>>  - Avoid using Lambda in ImmutablePseudoClassSetsCache.of()
>>  - Merge branch 'master' of https://git.openjdk.org/jfx into
>>    feature/immutable-pseudoclassstate
>>  - Fix another edge case in BitSet equals
>>    
>>    When arrays are not the same size, but there are no set bits in the ones
>>    the other set doesn't have, two bit sets can still be considered equal
>>  - Take element type into account for BitSet.equals()
>>  - Base BitSet on AbstractSet to inherit correct equals/hashCode/toArray
>>    
>>    - Removed faulty toArray implementations in PseudoClassState and
>>    StyleClassSet
>>    - Added test that verifies equals/hashCode for PseudoClassState respect
>>    Set contract now
>>    - Made getBits package private so it can't be inherited
>>  - Remove unused code
>>  - Ensure Match doesn't allow modification
>>  - Simplify ImmutablePseudoClassSetsCache and avoid an unnecessary copy
>>  - ... and 6 more: https://git.openjdk.org/jfx/compare/9ad0e908...7975ae99
>
> modules/javafx.graphics/src/main/java/com/sun/javafx/css/ImmutablePseudoClassSetsCache.java line 50:
> 
>> 48:      * @throws NullPointerException when {@code pseudoClasses} is {@code null} or contains {@code null}s
>> 49:      */
>> 50:     public static Set<PseudoClass> of(Set<PseudoClass> pseudoClasses) {
> 
> Usually, a static `of` method returns an instance of the declaring class. Maybe a name like `immutableSetOf` would be better.

Yeah, you have a point.  Or maybe just `get` or `lookup`.  With sets it always feels a bit weird as the key is also the value :)

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1076#discussion_r1253710540


More information about the openjfx-dev mailing list