When the CSS API was first published, the SimpleSelector and CompoundSelector classes were intended to be private implementation details that users could only access to through their common super type Selector.
They however have been made public in order for the CSS engine, which resides outside javafx.css package, to access their internals through public methods.
The SimpleSelector and CompoundSelector classes cannot be directly constructed by 3rd parties as they have a package private constructor, which reinforces that they were intended to be just an implementation detail.
A Google search shows no uses of these classes in public code bases, outside FX, and as these classes would only be reachable at all by casting a Selector, it is also highly unlikely anyone is or should be relying on these implementations.
A fairly non-intrusive solution is now available to be able to move these classes without having to introduce new public API that exposes further implementation details. This can be achieved by making Selector sealed. This is binary compatible because all sub types of Selector are part of the graphics module, and no sub types can be created by 3rd parties as Selector's constructor is package private.
Making these classes part of private API allows us to more easily evolve the CSS engine, including performance optimizations as part of https://bugs.openjdk.org/browse/JDK-8322964 , without having to carefully avoid introducing new API, deprecating existing API, or if new methods are unavoidable, documenting them as public API (even though we really don't want to).
They however have been made public in order for the CSS engine, which resides outside javafx.css package, to access their internals through public methods.
The SimpleSelector and CompoundSelector classes cannot be directly constructed by 3rd parties as they have a package private constructor, which reinforces that they were intended to be just an implementation detail.
A Google search shows no uses of these classes in public code bases, outside FX, and as these classes would only be reachable at all by casting a Selector, it is also highly unlikely anyone is or should be relying on these implementations.
A fairly non-intrusive solution is now available to be able to move these classes without having to introduce new public API that exposes further implementation details. This can be achieved by making Selector sealed. This is binary compatible because all sub types of Selector are part of the graphics module, and no sub types can be created by 3rd parties as Selector's constructor is package private.
Making these classes part of private API allows us to more easily evolve the CSS engine, including performance optimizations as part of https://bugs.openjdk.org/browse/JDK-8322964 , without having to carefully avoid introducing new API, deprecating existing API, or if new methods are unavoidable, documenting them as public API (even though we really don't want to).
- csr for
-
JDK-8339385 Remove SimpleSelector and CompoundSelector classes
- Closed
- is blocked by
-
JDK-8324182 Deprecate for removal SimpleSelector and CompoundSelector classes
- Resolved
- links to
-
Commit(master) openjdk/jfx/dad80e92
-
Review(master) openjdk/jfx/1333