On Sat, 11 Jul 2026 15:53:35 GMT, Petr Štechmüller <[email protected]> wrote:

>> ProxyBuilder is used by the FXML loader to instantiate classes whose 
>> constructors are annotated with `@NamedArg`. When such a class also exposes 
>> a read-only `Map` property (e.g. getProperties() — the same pattern used by 
>> `javafx.scene.Node`), setting child elements under that property in FXML 
>> caused incorrect behaviour or a runtime error.
>> 
>> **Root cause:** _getReadOnlyProperty()_ always returned an 
>> `ArrayListWrapper` regardless of the actual **getter** return type. When the 
>> getter returns a `Map`, an `ArrayListWrapper` is the wrong container and the 
>> entries are never transferred to the real map on the object.
>> 
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Petr Štechmüller has updated the pull request incrementally with two 
> additional commits since the last revision:
> 
>  - Remove commented out code from tests
>  - Remove ArrayListWrapper + suggested code changes

modules/javafx.fxml/src/test/java/test/com/sun/javafx/fxml/builder/ClassWithPlainCollectionAndScalarArg.java
 line 34:

> 32: 
> 33: /**
> 34:  * Fixture class for testing the {@code ArrayListWrapper} unwrapping path 
> in

One more thing: We should remove the reference of `ArrayListWrapper` in the 
javadoc here and the other test classes, since we removed it

modules/javafx.fxml/src/test/java/test/com/sun/javafx/fxml/builder/ProxyBuilderTest.java
 line 340:


I think I confused you here - sorry. This was fine, you can keep it if you 
like. What I meant with my comment is that I think we can remove 
`@SuppressWarnings("unchecked")` below because it does not really help

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2167#discussion_r3564554838
PR Review Comment: https://git.openjdk.org/jfx/pull/2167#discussion_r3564558232

Reply via email to