RFR: 8298644 JNI call of getCurrentComponent on a wrong thread [v2]

Artem Semenov asemenov at openjdk.org
Fri Dec 23 09:18:50 UTC 2022


On Thu, 22 Dec 2022 22:01:39 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Artem Semenov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Please split the long lines to have 80 chars per line.
>
> src/java.desktop/share/classes/javax/swing/JList.java line 3234:
> 
>> 3232:               static {
>> 3233:                   AccessibleComponentAccessor.addAccessor(c ->
>> 3234:                           c instanceof JList.AccessibleJList.AccessibleJListChild ? ((JList.AccessibleJList.AccessibleJListChild) c).getCurrentComponent() : null);
> 
> Please split the long lines to have 80 chars per line.

Donw

> src/java.desktop/share/classes/sun/swing/AccessibleComponentAccessor.java line 42:
> 
>> 40:     }
>> 41: 
>> 42:     public static Accessible getAccessible(AccessibleContext context) {
> 
> Will the fix have more code if it will be implemented via SwingAccessor just to access that "private" method?

Thank you.
I removed adding accesses for TableCell and ListChildren. If that's what you meant.
I would like to keep the implementation of the Accesser itself, if possible. Because in the future it may come in handy in this form, if in the future you still need to add access to the currentComponent for ListChildren and TableCell.
this approach allows us to make the implementation more generic, in case the potential tree is not inherited from Jtree. It also avoids reflection.

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

PR: https://git.openjdk.org/jdk/pull/11670



More information about the client-libs-dev mailing list