--- old/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/UnsafeAccess.java 2016-09-14 00:31:14.000000000 +0200 +++ new/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/UnsafeAccess.java 2016-09-14 00:31:14.000000000 +0200 @@ -22,8 +22,6 @@ */ package jdk.vm.ci.hotspot; -import java.lang.reflect.Field; - import jdk.internal.misc.Unsafe; /** @@ -31,21 +29,5 @@ */ class UnsafeAccess { - static final Unsafe UNSAFE = initUnsafe(); - - private static Unsafe initUnsafe() { - try { - // Fast path when we are trusted. - return Unsafe.getUnsafe(); - } catch (SecurityException se) { - // Slow path when we are not trusted. - try { - Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe"); - theUnsafe.setAccessible(true); - return (Unsafe) theUnsafe.get(Unsafe.class); - } catch (Exception e) { - throw new RuntimeException("exception while trying to get Unsafe", e); - } - } - } + static final Unsafe UNSAFE = Unsafe.getUnsafe(); }