Tue, 27 Feb 2018 19:59:46 -0800
8198494: 8u171 and 8u172 - Build failure on non-SE Linux Platforms
Reviewed-by: dfuchs, rriggs, coffeys, aefimov
1.1 --- a/src/share/classes/com/sun/corba/se/impl/ior/StubIORImpl.java Thu Feb 08 19:32:06 2018 +0000 1.2 +++ b/src/share/classes/com/sun/corba/se/impl/ior/StubIORImpl.java Tue Feb 27 19:59:46 2018 -0800 1.3 @@ -31,9 +31,9 @@ 1.4 1.5 package com.sun.corba.se.impl.ior; 1.6 1.7 -import java.io.ObjectInputStream ; 1.8 -import java.io.ObjectOutputStream ; 1.9 -import java.io.IOException ; 1.10 +import java.io.IOException; 1.11 +import java.io.ObjectOutputStream; 1.12 +import sun.corba.SharedSecrets; 1.13 1.14 import org.omg.CORBA.ORB ; 1.15 1.16 @@ -46,7 +46,6 @@ 1.17 // other vendor's ORBs. 1.18 import com.sun.corba.se.spi.presentation.rmi.StubAdapter ; 1.19 import com.sun.corba.se.impl.orbutil.HexOutputStream ; 1.20 -import sun.corba.SharedSecrets; 1.21 1.22 /** 1.23 * This class implements a very simply IOR representation
2.1 --- a/src/share/classes/sun/corba/SharedSecrets.java Thu Feb 08 19:32:06 2018 +0000 2.2 +++ b/src/share/classes/sun/corba/SharedSecrets.java Tue Feb 27 19:59:46 2018 -0800 2.3 @@ -29,8 +29,7 @@ 2.4 import sun.misc.JavaOISAccess; 2.5 import sun.misc.Unsafe; 2.6 2.7 -import java.io.ObjectInputStream; 2.8 -import java.security.AccessController; 2.9 +import java.lang.reflect.Method; 2.10 2.11 /** A repository of "shared secrets", which are a mechanism for 2.12 calling implementation-private methods in another package without 2.13 @@ -45,8 +44,32 @@ 2.14 public class SharedSecrets { 2.15 private static final Unsafe unsafe = Unsafe.getUnsafe(); 2.16 private static JavaCorbaAccess javaCorbaAccess; 2.17 + private static final Method getJavaOISAccessMethod; 2.18 private static JavaOISAccess javaOISAccess; 2.19 2.20 + // Initialize getJavaOISAccessMethod using reflection. 2.21 + static { 2.22 + try { 2.23 + Class sharedSecret = Class.forName("sun.misc.SharedSecrets"); 2.24 + getJavaOISAccessMethod = 2.25 + sharedSecret.getMethod("getJavaOISAccess"); 2.26 + } catch (Exception e) { 2.27 + throw new ExceptionInInitializerError(e); 2.28 + } 2.29 + } 2.30 + 2.31 + public static JavaOISAccess getJavaOISAccess() { 2.32 + if (javaOISAccess == null) { 2.33 + try { 2.34 + javaOISAccess = 2.35 + (JavaOISAccess) getJavaOISAccessMethod.invoke(null); 2.36 + } catch (Exception e) { 2.37 + throw new ExceptionInInitializerError(e); 2.38 + } 2.39 + } 2.40 + return javaOISAccess; 2.41 + } 2.42 + 2.43 public static JavaCorbaAccess getJavaCorbaAccess() { 2.44 if (javaCorbaAccess == null) { 2.45 // Ensure ValueUtility is initialized; we know that that class 2.46 @@ -59,16 +82,4 @@ 2.47 public static void setJavaCorbaAccess(JavaCorbaAccess access) { 2.48 javaCorbaAccess = access; 2.49 } 2.50 - 2.51 - public static void setJavaOISAccess(JavaOISAccess access) { 2.52 - javaOISAccess = access; 2.53 - } 2.54 - 2.55 - public static JavaOISAccess getJavaOISAccess() { 2.56 - if (javaOISAccess == null) 2.57 - unsafe.ensureClassInitialized(ObjectInputStream.class); 2.58 - 2.59 - return javaOISAccess; 2.60 - } 2.61 - 2.62 }