RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu [v2]

Abhishek Kumar abhiscxk at openjdk.org
Thu May 29 07:03:59 UTC 2025


On Thu, 29 May 2025 06:33:37 GMT, Abhishek Kumar <abhiscxk at openjdk.org> wrote:

>> src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java line 877:
>> 
>>> 875:         if (ac != null) {
>>> 876:             Accessible aComp = null;
>>> 877:             for (int i = 0; i < ac.getAccessibleChildrenCount(); i++) {
>> 
>> I suggest replacing for with while. If the desired submenu is at the beginning of the list, there’s no need to traverse it further.
>
> I think even though the submenu is at the beginning but if it is not visible then we need to traverse further to check for other submenu if present.

Optimized the code to not traverse further if the desired submenu is fetched. Verified the recent change with the test code.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25470#discussion_r2113344471


More information about the client-libs-dev mailing list