RFR: 8323965: modify fix for 8317771 to remove reflection instantiation of the inner class
Chen Liang
liach at openjdk.org
Mon Apr 22 11:52:28 UTC 2024
On Mon, 22 Apr 2024 09:57:28 GMT, Artem Semenov <asemenov at openjdk.org> wrote:
>> src/java.desktop/share/classes/sun/swing/SwingAccessor.java line 331:
>>
>>> 329: var access = accessibleJTreeNodeCreateAccessor;
>>> 330: if (access == null) {
>>> 331: ensureClassInitialized(JTree.class);
>>
>> This probably doesn't work as JTree class initialization does not seem to trigger AccessibleJTree class initialization. The other one for AccessibleJTreeNode is dubious too, maybe it just happens that all accesses are correctly made only after the related classes are initialized.
>
> This line calls the ```ensureClassInitialized()``` method, which performs a full initialization of the class... It calls: ```MethodHandles.lookup().ensureInitialized()```, which, as stated in the documentation , performs a full initialization.
I know, but initializing a class does not necessarily initialize its nested/inner classes
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18867#discussion_r1574623725
More information about the client-libs-dev
mailing list