8145228: Java Access Bridge, getAccessibleStatesStringFromContext doesn't wrap the call to getAccessibleRole
authorptbrunet
Thu, 17 Mar 2016 21:58:19 -0500
changeset 36892 b41d7ffdbb10
parent 36891 028eb2172cfc
child 36893 f6edb8a375ec
8145228: Java Access Bridge, getAccessibleStatesStringFromContext doesn't wrap the call to getAccessibleRole Summary: use invokeAndWait in two places that were missing that Reviewed-by: alexsch, prr Contributed-by: peter.brunet@oracle.com
jdk/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java
--- a/jdk/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java	Thu Mar 17 13:17:39 2016 +0300
+++ b/jdk/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java	Thu Mar 17 21:58:19 2016 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1408,7 +1408,9 @@
                     s.indexOf(AccessibleState.MANAGES_DESCENDANTS.toDisplayString(Locale.US)) == -1) {
                     // Indicate whether this component manages its own
                     // children
-                    AccessibleRole role = ac.getAccessibleRole();
+                    AccessibleRole role = InvocationUtils.invokeAndWait(() -> {
+                            return ac.getAccessibleRole();
+                        }, ac);
                     if (role == AccessibleRole.LIST ||
                         role == AccessibleRole.TABLE ||
                         role == AccessibleRole.TREE) {
@@ -1666,7 +1668,9 @@
      */
     private AccessibleComponent getAccessibleComponentFromContext(AccessibleContext ac) {
         if (ac != null) {
-            AccessibleComponent acmp = ac.getAccessibleComponent();
+            AccessibleComponent acmp = InvocationUtils.invokeAndWait(() -> {
+                    return ac.getAccessibleComponent();
+                }, ac);
             if (acmp != null) {
                 debugString("Returning AccessibleComponent Context");
                 return acmp;