hotspot/test/compiler/c2/Test6968348.java
changeset 41092 c388d897472d
parent 40059 c2304140ed64
child 41705 332239c052cc
--- a/hotspot/test/compiler/c2/Test6968348.java	Tue Sep 13 21:29:30 2016 +0000
+++ b/hotspot/test/compiler/c2/Test6968348.java	Wed Sep 14 08:17:50 2016 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -38,15 +38,11 @@
 import java.lang.reflect.Field;
 
 public class Test6968348 {
-    static Unsafe unsafe;
+    static Unsafe unsafe = Unsafe.getUnsafe();
     static final long[] buffer = new long[4096];
     static int array_long_base_offset;
 
     public static void main(String[] args) throws Exception {
-        Class c = Test6968348.class.getClassLoader().loadClass("jdk.internal.misc.Unsafe");
-        Field f = c.getDeclaredField("theUnsafe");
-        f.setAccessible(true);
-        unsafe = (Unsafe)f.get(c);
         array_long_base_offset = unsafe.arrayBaseOffset(long[].class);
 
         for (int n = 0; n < 100000; n++) {