changeset 1685:e9aaa28b626d jdk8u172-b09

Merge
author asaha
date Tue, 06 Mar 2018 20:32:27 +0000
parents 6cbbef7afbc6 6a9efc037460
children 123129413d20
files .hgtags
diffstat 3 files changed, 29 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Mar 06 20:30:30 2018 +0000
+++ b/.hgtags	Tue Mar 06 20:32:27 2018 +0000
@@ -874,6 +874,7 @@
 3bca003f024c7bb6774499ff2ede57d300c18c79 jdk8u171-b06
 b90a8fc589afa4ac20a4d1e4f819058a5730af9f jdk8u171-b07
 f7f59d87e97dd1e3a7ff4ebc5ed843b2ed5f2361 jdk8u171-b08
+b3563151fe42c6b997279fc24f8329c4c03add96 jdk8u171-b09
 72dbc8d63308f5b04b9fd3e06d139d673f992212 jdk8u172-b00
 fbb7c1e76e59aabb85a70c81301f47b980f83225 jdk8u172-b01
 56874ff37e89559692d1314d48cbab574544b677 jdk8u172-b02
--- a/src/share/classes/com/sun/corba/se/impl/ior/StubIORImpl.java	Tue Mar 06 20:30:30 2018 +0000
+++ b/src/share/classes/com/sun/corba/se/impl/ior/StubIORImpl.java	Tue Mar 06 20:32:27 2018 +0000
@@ -31,9 +31,9 @@
 
 package com.sun.corba.se.impl.ior;
 
-import java.io.ObjectInputStream ;
-import java.io.ObjectOutputStream ;
-import java.io.IOException ;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import sun.corba.SharedSecrets;
 
 import org.omg.CORBA.ORB ;
 
@@ -46,7 +46,6 @@
 // other vendor's ORBs.
 import com.sun.corba.se.spi.presentation.rmi.StubAdapter ;
 import com.sun.corba.se.impl.orbutil.HexOutputStream ;
-import sun.corba.SharedSecrets;
 
 /**
  * This class implements a very simply IOR representation
--- a/src/share/classes/sun/corba/SharedSecrets.java	Tue Mar 06 20:30:30 2018 +0000
+++ b/src/share/classes/sun/corba/SharedSecrets.java	Tue Mar 06 20:32:27 2018 +0000
@@ -29,8 +29,7 @@
 import sun.misc.JavaOISAccess;
 import sun.misc.Unsafe;
 
-import java.io.ObjectInputStream;
-import java.security.AccessController;
+import java.lang.reflect.Method;
 
 /** A repository of "shared secrets", which are a mechanism for
     calling implementation-private methods in another package without
@@ -45,8 +44,32 @@
 public class SharedSecrets {
     private static final Unsafe unsafe = Unsafe.getUnsafe();
     private static JavaCorbaAccess javaCorbaAccess;
+    private static final Method getJavaOISAccessMethod;
     private static JavaOISAccess javaOISAccess;
 
+    // Initialize getJavaOISAccessMethod using reflection.
+    static {
+        try {
+            Class sharedSecret = Class.forName("sun.misc.SharedSecrets");
+            getJavaOISAccessMethod =
+                    sharedSecret.getMethod("getJavaOISAccess");
+        } catch (Exception e) {
+            throw new ExceptionInInitializerError(e);
+        }
+    }
+
+    public static JavaOISAccess getJavaOISAccess() {
+        if (javaOISAccess == null) {
+            try {
+                javaOISAccess =
+                        (JavaOISAccess) getJavaOISAccessMethod.invoke(null);
+            } catch (Exception e) {
+                throw new ExceptionInInitializerError(e);
+            }
+        }
+        return javaOISAccess;
+    }
+
     public static JavaCorbaAccess getJavaCorbaAccess() {
         if (javaCorbaAccess == null) {
             // Ensure ValueUtility is initialized; we know that that class
@@ -59,16 +82,4 @@
     public static void setJavaCorbaAccess(JavaCorbaAccess access) {
         javaCorbaAccess = access;
     }
-
-    public static void setJavaOISAccess(JavaOISAccess access) {
-        javaOISAccess = access;
-    }
-
-    public static JavaOISAccess getJavaOISAccess() {
-        if (javaOISAccess == null)
-            unsafe.ensureClassInitialized(ObjectInputStream.class);
-
-        return javaOISAccess;
-    }
-
 }