Merge
authorduke
Wed, 05 Jul 2017 22:13:08 +0200
changeset 40934 136eabdfaf3a
parent 40933 94d6d0f4ced0 (current diff)
parent 40852 2526d9083e41 (diff)
child 41015 5bc42d9f8141
Merge
--- a/.hgtags-top-repo	Thu Sep 15 21:09:16 2016 +0000
+++ b/.hgtags-top-repo	Wed Jul 05 22:13:08 2017 +0200
@@ -378,3 +378,4 @@
 be1218f792a450dfb5d4b1f82616b9d95a6a732e jdk-9+133
 065724348690eda41fc69112278d8da6dcde548c jdk-9+134
 82b94cb5f342319d2cda77f9fa59703ad7fde576 jdk-9+135
+3ec350f5f32af249b59620d7e37b54bdcd77b233 jdk-9+136
--- a/make/Images.gmk	Thu Sep 15 21:09:16 2016 +0000
+++ b/make/Images.gmk	Wed Jul 05 22:13:08 2017 +0200
@@ -75,11 +75,6 @@
 
 # Param 1 - The file containing the MODULES list
 define create-info-file
-  $(call info-file-item, "JAVA_VERSION", "$(VERSION_NUMBER)")
-  $(call info-file-item, "JAVA_FULL_VERSION", "$(VERSION_STRING)")
-  $(call info-file-item, "OS_NAME", "$(REQUIRED_OS_NAME)")
-  $(call info-file-item, "OS_VERSION", "$(REQUIRED_OS_VERSION)")
-  $(call info-file-item, "OS_ARCH", "$(OPENJDK_TARGET_CPU_LEGACY)")
   $(if $(JDK_ARCH_ABI_PROP_NAME), \
     $(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"))
   $(call info-file-item, "SOURCE", "$(strip $(ALL_SOURCE_TIPS))")
--- a/test/lib/jdk/test/lib/Utils.java	Thu Sep 15 21:09:16 2016 +0000
+++ b/test/lib/jdk/test/lib/Utils.java	Wed Jul 05 22:13:08 2017 +0200
@@ -25,7 +25,6 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.lang.reflect.Field;
 import java.net.InetAddress;
 import java.net.MalformedURLException;
 import java.net.ServerSocket;
@@ -51,7 +50,6 @@
 import java.util.function.Function;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
-import jdk.internal.misc.Unsafe;
 
 import static jdk.test.lib.Asserts.assertTrue;
 import jdk.test.lib.process.ProcessTools;
@@ -87,9 +85,16 @@
      */
     public static final String TEST_SRC = System.getProperty("test.src", "").trim();
 
-    private static Unsafe unsafe = null;
+    /*
+     * Returns the value of 'test.jdk' system property
+     */
+    public static final String TEST_JDK = System.getProperty("test.jdk");
 
     /**
+     * Returns the value of 'test.classes' system property
+     */
+    public static final String TEST_CLASSES = System.getProperty("test.classes", ".");
+    /**
      * Defines property name for seed value.
      */
     public static final String SEED_PROPERTY_NAME = "jdk.test.lib.random.seed";
@@ -373,21 +378,6 @@
         return new String(Files.readAllBytes(filePath));
     }
 
-    /**
-     * @return Unsafe instance.
-     */
-    public static synchronized Unsafe getUnsafe() {
-        if (unsafe == null) {
-            try {
-                Field f = Unsafe.class.getDeclaredField("theUnsafe");
-                f.setAccessible(true);
-                unsafe = (Unsafe) f.get(null);
-            } catch (NoSuchFieldException | IllegalAccessException e) {
-                throw new RuntimeException("Unable to get Unsafe instance.", e);
-            }
-        }
-        return unsafe;
-    }
     private static final char[] hexArray = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/unsafe/UnsafeHelper.java	Wed Jul 05 22:13:08 2017 +0200
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test.lib.unsafe;
+
+import jdk.internal.misc.Unsafe;
+import java.lang.reflect.Field;
+
+
+/**
+ * Helper class for accessing the jdk.internal.misc.Unsafe functionality
+ */
+public final class UnsafeHelper {
+    private static Unsafe unsafe = null;
+
+    /**
+     * @return Unsafe instance.
+     */
+    public static synchronized Unsafe getUnsafe() {
+        if (unsafe == null) {
+            try {
+                Field f = Unsafe.class.getDeclaredField("theUnsafe");
+                f.setAccessible(true);
+                unsafe = (Unsafe) f.get(null);
+            } catch (NoSuchFieldException | IllegalAccessException e) {
+                throw new RuntimeException("Unable to get Unsafe instance.", e);
+            }
+        }
+        return unsafe;
+    }
+}
+