hotspot/test/compiler/c2/cr8004867/TestIntUnsafeCAS.java
changeset 41092 c388d897472d
parent 40059 c2304140ed64
child 41705 332239c052cc
--- a/hotspot/test/compiler/c2/cr8004867/TestIntUnsafeCAS.java	Tue Sep 13 21:29:30 2016 +0000
+++ b/hotspot/test/compiler/c2/cr8004867/TestIntUnsafeCAS.java	Wed Sep 14 08:17:50 2016 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,14 +50,10 @@
   private static final int ALIGN_OFF = 8;
   private static final int UNALIGN_OFF = 5;
 
-  private static final Unsafe unsafe;
+  private static final Unsafe unsafe = Unsafe.getUnsafe();
   private static final int BASE;
   static {
     try {
-      Class c = TestIntUnsafeCAS.class.getClassLoader().loadClass("jdk.internal.misc.Unsafe");
-      Field f = c.getDeclaredField("theUnsafe");
-      f.setAccessible(true);
-      unsafe = (Unsafe)f.get(c);
       BASE = unsafe.arrayBaseOffset(int[].class);
     } catch (Exception e) {
       InternalError err = new InternalError();