Permalink
Browse files

IDEA-148854: AppCode crashes randomly every 15 mins or so

--HG--
branch : 8u40-verified-fixes
  • Loading branch information...
forantar committed Jan 21, 2016
1 parent deb7383 commit 02f9a5fbb4924ff67c8a04c15e490acfcc750003
@@ -82,6 +82,15 @@ public void propertyChange(final PropertyChangeEvent evt) {
return null;
}
static <T> T invokeAndWait(final Callable<T> callable, final Component c, final T defValue) {
T value = null;
try {
value = LWCToolkit.invokeAndWait(callable, c);
} catch (final Exception e) { e.printStackTrace(); }
return value != null ? value : defValue;
}
static void invokeLater(final Runnable runnable, final Component c) {
try {
LWCToolkit.invokeLater(runnable, c);
@@ -177,7 +186,7 @@ public Boolean call() throws Exception {
return new Boolean(as.isAccessibleChildSelected(index));
}
}, c);
}, c, false);
}
public static AccessibleStateSet getAccessibleStateSet(final AccessibleContext ac, final Component c) {
@@ -199,7 +208,7 @@ public Boolean call() throws Exception {
if (ass == null) return null;
return ass.contains(as);
}
}, c);
}, c, false);
}
static Field getAccessibleBundleKeyFieldWithReflection() {
@@ -265,7 +274,7 @@ public static int getCharCount(final AccessibleText at, final Component c) {
public Integer call() throws Exception {
return at.getCharCount();
}
}, c);
}, c, 0);
}
// Accessibility Threadsafety for JavaComponentAccessibility.m
@@ -290,7 +299,7 @@ public Integer call() throws Exception {
if (ac == null) return null;
return ac.getAccessibleIndexInParent();
}
}, c);
}, c, -1);
}
public static AccessibleComponent getAccessibleComponent(final Accessible a, final Component c) {
@@ -386,7 +395,7 @@ public Boolean call() throws Exception {
return aComp.isFocusTraversable();
}
}, c);
}, c, false);
}
public static Accessible accessibilityHitTest(final Container parent, final float hitPointX, final float hitPointY) {
@@ -443,7 +452,7 @@ public Boolean call() throws Exception {
return aComp.isEnabled();
}
}, c);
}, c, false);
}
// KCH - can we make this a postEvent instead?
@@ -96,7 +96,7 @@ protected synchronized void dispose() {
@Override
public AccessibleContext getAccessibleContext() {
return accessible.getAccessibleContext();
return accessible != null ? accessible.getAccessibleContext() : null;
}
// currently only supports text components
@@ -323,8 +323,9 @@ + (JavaComponentAccessibility *)createWithAccessible:(jobject)jaccessible withEn
{
jobject jcomponent = [(AWTView *)view awtComponent:env];
jint index = JNFCallStaticIntMethod(env, sjm_getAccessibleIndexInParent, jaccessible, jcomponent);
NSString *javaRole = getJavaRole(env, jaccessible, jcomponent);
if (index < 0) return nil;
NSString *javaRole = getJavaRole(env, jaccessible, jcomponent);
return [self createWithAccessible:jaccessible role:javaRole index:index withEnv:env withView:view];
}
@@ -663,8 +664,8 @@ - (NSUInteger)accessibilityIndexOfChild:(id)child
if (![[self accessibilityRoleAttribute] isEqualToString:NSAccessibilityListRole]) {
return [super accessibilityIndexOfChild:child];
}
return JNFCallStaticIntMethod([ThreadUtilities getJNIEnv], sjm_getAccessibleIndexInParent, ((JavaComponentAccessibility *)child)->fAccessible, ((JavaComponentAccessibility *)child)->fComponent);
jint index = JNFCallStaticIntMethod([ThreadUtilities getJNIEnv], sjm_getAccessibleIndexInParent, ((JavaComponentAccessibility *)child)->fAccessible, ((JavaComponentAccessibility *)child)->fComponent);
return index >= 0 ? index : 0;
}
// Without this optimization accessibilityChildrenAttribute is called in order to get the entire array of children.

0 comments on commit 02f9a5f

Please sign in to comment.