Skip to content
Permalink
Browse files
8257584: [macos] NullPointerException originating from LWCToolkit.java
Reviewed-by: serb
  • Loading branch information
Alexander Zuev committed Dec 19, 2020
1 parent c7c53d0 commit dc7f01f4481357abd818ed1708e94773b4ca1f4a
Showing with 15 additions and 9 deletions.
  1. +15 −9 src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java
@@ -115,25 +115,31 @@ public void propertyChange(final PropertyChangeEvent evt) {
private native void focusChanged();

static <T> T invokeAndWait(final Callable<T> callable, final Component c) {
try {
return LWCToolkit.invokeAndWait(callable, c);
} catch (final Exception e) { e.printStackTrace(); }
if (c != null) {
try {
return LWCToolkit.invokeAndWait(callable, c);
} catch (final Exception e) { e.printStackTrace(); }
}
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(); }
if (c != 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);
} catch (InvocationTargetException e) { e.printStackTrace(); }
if (c != null) {
try {
LWCToolkit.invokeLater(runnable, c);
} catch (InvocationTargetException e) { e.printStackTrace(); }
}
}

public static String getAccessibleActionDescription(final AccessibleAction aa, final int index, final Component c) {

1 comment on commit dc7f01f

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on dc7f01f Dec 19, 2020

Please sign in to comment.