8285021: Improve CORBA communication

Co-authored-by: Joshua Cao <joshcao@amazon.com>
Reviewed-by: mbalao, bae, andrew
This commit is contained in:
Paul Hohensee 2023-01-13 03:18:49 +00:00 committed by Andrew John Hughes
parent ebc5e190ac
commit 259a33e4e1
2 changed files with 7 additions and 0 deletions

View File

@ -317,6 +317,8 @@ public class ORBConstants {
public static final String DYNAMIC_STUB_FACTORY_FACTORY_CLASS =
SUN_PREFIX + "ORBDynamicStubFactoryFactoryClass" ;
public static final String ALLOW_DESERIALIZE_OBJECT = SUN_PREFIX + "ORBAllowDeserializeObject" ;
// Constants for NameService properties ************************************
public static final int DEFAULT_INITIAL_PORT = 900;

View File

@ -342,6 +342,11 @@ public class Stub implements AuxGen
stream.println (" private void readObject (java.io.ObjectInputStream s) throws java.io.IOException");
stream.println (" {");
stream.println (" String str = s.readUTF ();");
if ("DynAnyFactory".equals (i.name ())) {
stream.println (" if (!str.startsWith(com.sun.corba.se.impl.orbutil.ORBConstants.STRINGIFY_PREFIX) &&");
stream.println (" !Boolean.getBoolean(com.sun.corba.se.impl.orbutil.ORBConstants.ALLOW_DESERIALIZE_OBJECT))");
stream.println (" throw new java.io.InvalidObjectException(\"IOR: expected\");");
}
stream.println (" String[] args = null;");
stream.println (" java.util.Properties props = null;");
stream.println (" org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);");