Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For Android compatibility, make Statics.releaseFence() also catch NoSuchMethodException for java.lang.invoke.VarHandle.releaseFence() call #9739

Merged
merged 1 commit into from Sep 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/library/scala/runtime/Statics.java
Expand Up @@ -159,7 +159,7 @@ private static MethodHandle mkHandle() {
MethodHandles.Lookup lookup = MethodHandles.lookup();
try {
return lookup.findStatic(Class.forName("java.lang.invoke.VarHandle"), "releaseFence", MethodType.methodType(Void.TYPE));
} catch (ClassNotFoundException e) {
} catch (NoSuchMethodException | ClassNotFoundException e) {
try {
Class<?> unsafeClass = Class.forName("sun.misc.Unsafe");
return lookup.findVirtual(unsafeClass, "storeFence", MethodType.methodType(void.class)).bindTo(findUnsafe(unsafeClass));
Expand All @@ -168,7 +168,7 @@ private static MethodHandle mkHandle() {
error.addSuppressed(e);
throw error;
}
} catch (NoSuchMethodException | IllegalAccessException e) {
} catch (IllegalAccessException e) {
throw new ExceptionInInitializerError(e);
}
}
Expand Down