On Thu, 23 Jul 2026 10:12:06 GMT, Marius Hanl <[email protected]> wrote:

>> Michael Strauß has updated the pull request incrementally with two 
>> additional commits since the last revision:
>> 
>>  - revert
>>  - remove test
>
> modules/javafx.base/src/main/java/javafx/beans/property/ReadOnlyProperty.java 
> line 81:
> 
>> 79:      * @since 28
>> 80:      */
>> 81:     default Class<?> getDeclaringClass() {
> 
> I'm a little worried that this might accidentally reduce performance. 
> If developers don't know/forget to set the declaring class and rely on this 
> reflective fallback without knowing it.
> 
> But I don't have an idea to solve this right now. Just thinking out loud.

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.

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

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

Reply via email to