changeset 11501:458a4b3f2c24

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
author van
date Fri, 25 Mar 2016 10:40:29 -0700
parents 20f2ccffa30f
children 4c0392b7d637
files src/windows/classes/com/sun/java/accessibility/AccessBridge.java
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/classes/com/sun/java/accessibility/AccessBridge.java	Thu Mar 24 15:59:10 2016 +0000
+++ b/src/windows/classes/com/sun/java/accessibility/AccessBridge.java	Fri Mar 25 10:40:29 2016 -0700
@@ -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
@@ -1501,7 +1501,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) {
@@ -1759,7 +1761,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;