Skip to content

Commit 875854b

Browse files
committed
Improve Azul Zing support, OpenHFT/OpenHFT#47
1 parent f3a06d4 commit 875854b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/java/net/openhft/compiler/CompilerUtils.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@ public enum CompilerUtils {
5757
theUnsafe.setAccessible(true);
5858
Unsafe u = (Unsafe) theUnsafe.get(null);
5959
DEFINE_CLASS_METHOD = ClassLoader.class.getDeclaredMethod("defineClass", String.class, byte[].class, int.class, int.class);
60-
Field f = AccessibleObject.class.getDeclaredField("override");
61-
long offset = u.objectFieldOffset(f);
62-
u.putBoolean(DEFINE_CLASS_METHOD, offset, true);
60+
try {
61+
Field f = AccessibleObject.class.getDeclaredField("override");
62+
long offset = u.objectFieldOffset(f);
63+
u.putBoolean(DEFINE_CLASS_METHOD, offset, true);
64+
} catch (NoSuchFieldException e) {
65+
DEFINE_CLASS_METHOD.setAccessible(true);
66+
}
6367
} catch (NoSuchMethodException | IllegalAccessException | NoSuchFieldException e) {
6468
throw new AssertionError(e);
6569
}

0 commit comments

Comments
 (0)