Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8145228

Java Access Bridge, getAccessibleStatesStringFromContext doesn't wrap the call to getAccessibleRole

    Details

      Backports

        Description

        This is from Renaud Paquay <rpaquay@google.com> of the Google Andriod Studio team:

        If I may, I also ran into a Windows specific issue that is quite difficult for me to work around: As you may know, the JavaAccessBride thread wraps all requests to AccessibleContext so that they are dispatched to the AWT/Swing thread. I found one case, however, where a call is not wrapped, with the consequence that Swing components are sometimes called directly from the JavaAccessBridge thread, which is problematic in many cases for IntelliJ/Android Studio as they don't expect that.

        One particular example I found is this callstack:

        (...)at javax.swing.JList$AccessibleJList$AccessibleJListChild.getComponentAtIndex(JList.java:3229)
        at javax.swing.JList$AccessibleJList$AccessibleJListChild.getCurrentAccessibleContext(JList.java:3210)
        at javax.swing.JList$AccessibleJList$AccessibleJListChild.getAccessibleRole(JList.java:3289)
        at com.sun.java.accessibility.AccessBridge.getAccessibleStatesStringFromContext(AccessBridge.java:1492)
        at com.sun.java.accessibility.AccessBridge.runDLL(Native Method)
        at com.sun.java.accessibility.AccessBridge.access$300(AccessBridge.java:36)
        at com.sun.java.accessibility.AccessBridge$dllRunner.run(AccessBridge.java:120)
        at java.lang.Thread.run(Thread.java:745)

        I think the getAccessibleStatesStringFromContext should wrap the call to getAccessibleRole. I think this should be a (somewhat) trivial fix, as, afaik, almost all the calls from java.accessibility.AccessBridge to AccessibleContext are currently already wrapped.

        The reason this is difficult for me to workaround is that I would have to find a way to override all the concrete implementations of AccessibleContext.getAccessibleRole and customize them to perform the dispatch manually, which would essentially mean adding a level of hierarchy below all Swing classes and update all consumers to use these new classes.

          Activity

          Hide
          ptbrunet Pete Brunet (Inactive) added a comment -
          Reporter requests backport to 8u.
          Show
          ptbrunet Pete Brunet (Inactive) added a comment - Reporter requests backport to 8u.
          Show
          ptbrunet Pete Brunet (Inactive) added a comment - Review: http://cr.openjdk.java.net/~ptbrunet/JDK-8145228
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/296dc933c637
          User: ptbrunet
          Date: 2016-03-18 02:59:00 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/296dc933c637 User: ptbrunet Date: 2016-03-18 02:59:00 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/296dc933c637
          User: lana
          Date: 2016-04-13 17:56:05 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/296dc933c637 User: lana Date: 2016-04-13 17:56:05 +0000

            People

            • Assignee:
              ptbrunet Pete Brunet (Inactive)
              Reporter:
              ptbrunet Pete Brunet (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: