On Mon, 27 Jul 2026 21:31:10 GMT, Marius Hanl <[email protected]> wrote:

>> All properties in JavaFX will override this method and directly return their 
>> declaring class. So this will only impact third-party properties for which 
>> 1) the declaring class is queried, and 2) the `getDeclaringClass()` method 
>> is not overridden, and the declaring class is not specified in the property 
>> constructor.
>> 
>> Also, keep in mind that the declaring class is only resolved once, and then 
>> cached for repeated queries. I can't imagine that this will be a performance 
>> problem.
>
> But only for the `SimpleXXXProperty` classes right now. Not cached for other 
> classes like e.g. `StyleableBooleanProperty`.
> 
> Am I understanding you right that another PR will override this method in 
> JavaFX nodes?

Yes, a separate PR will override `getDeclaringClass()` for every property 
implementation in JavaFX.

Aside from that, we might want to add a constructor overload that accepts the 
declaring class to the SimpleStyleable* property classes as well.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2015#discussion_r3669352299

Reply via email to