RFR: 8323965: modify fix for 8317771 to remove reflection instantiation of the inner class

Chen Liang liach at openjdk.org
Fri Apr 19 20:27:29 UTC 2024


On Fri, 19 Apr 2024 15:16:41 GMT, Artem Semenov <asemenov at openjdk.org> wrote:

> I replaced reflection with using an accessor
> @azuev-java please review

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.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18867#discussion_r1572913874


More information about the client-libs-dev mailing list