Skip to content

Commit

Permalink
VM.RELEASE_FENCE catches NoSuchMethodException for java.lang.invoke.V…
Browse files Browse the repository at this point in the history
…arHandle.releaseFence invocation
  • Loading branch information
nwk37011 committed Aug 27, 2021
1 parent 072e68e commit b044a18
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit b044a18

Please sign in to comment.