-
Bug
-
Resolution: Fixed
-
P3
-
jfx20, 9
-
b20
The class Match is public and is part of javafx.css, and exposes a method `getPseudoClasses`. This returns `PseudoClassState`, which is IMHO incorrect as this is not public API.
Instead, it should do what all other methods part of the public API do when returning the `PseudoClass`-es and return `Set<PseudoClass>`:
For example, SimpleSelector has the same method, but returns `Set<PseudoClass>`, and `Styleable` returns `ObservableSet<PsuedoClass>`.
Matches can't be constructed directly, but are returned from Selectors.
Motivation to fix this:
I've been looking into memory consumption of JavaFX, and PseudoClassState tops RectBounds by a factor of 2 in my heavily styled application. Most of these are not ever modified as they're part of stylesheets, and most of these are duplicates. There were 27000 instances vs 1200 Nodes.
I think these can be made immutable and reused when used as part of a stylesheet, but the above problem is blocking this as it exposes `PseudoClassState` directly, which is mutable.
Instead, it should do what all other methods part of the public API do when returning the `PseudoClass`-es and return `Set<PseudoClass>`:
For example, SimpleSelector has the same method, but returns `Set<PseudoClass>`, and `Styleable` returns `ObservableSet<PsuedoClass>`.
Matches can't be constructed directly, but are returned from Selectors.
Motivation to fix this:
I've been looking into memory consumption of JavaFX, and PseudoClassState tops RectBounds by a factor of 2 in my heavily styled application. Most of these are not ever modified as they're part of stylesheets, and most of these are duplicates. There were 27000 instances vs 1200 Nodes.
I think these can be made immutable and reused when used as part of a stylesheet, but the above problem is blocking this as it exposes `PseudoClassState` directly, which is mutable.
- csr for
-
JDK-8304994 Public API in javafx.css.Match should not return private API class PseudoClassState
- Closed
There are no Sub-Tasks for this issue.