changeset 872:fa491237c578

merge
author goetz
date Thu, 23 Jan 2014 16:59:52 +0100
parents b5993c47e039 0ad990211737
children 47343904e95d
files .hgtags
diffstat 27 files changed, 384 insertions(+), 114 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Oct 25 11:51:01 2013 +0200
+++ b/.hgtags	Thu Jan 23 16:59:52 2014 +0100
@@ -386,3 +386,19 @@
 a15e4a54504471f1e34a494ed66235870722a0f5 jdk7u45-b30
 b7fb35bbe70d88eced3725b6e9070ad0b5b621ad jdk7u45-b31
 c5b5886004e6446b8b27ccdc1fd073354c1dc614 jdk7u60-b00
+d641ac83157ec86219519c0cbaf3122bdc997136 jdk7u45-b33
+aa24e046a2da95637257c9effeaabe254db0aa0b jdk7u45-b34
+b1f069eb48edfa6fb7428dc045a53e287215ef4a jdk7u51-b00
+8d884cf2e8cce92d532950de2c7283d9804f9e58 jdk7u51-b01
+327035fbb0433927c1b1af2bc0bcb84e7827f1b9 jdk7u51-b02
+3c186a6d2b86ec4c6cfb093969d5f4e4a6ef6a98 jdk7u51-b03
+6969598640b2a4731634669eb1402a6af5772b44 jdk7u51-b04
+b18c17608d944028724858e1f768fb0a59dc8220 jdk7u51-b05
+863d69d3dee00e7958ed1014e7600cc08f2655e7 jdk7u51-b06
+3f6dfcad33acb0251c60facb6b5e8dbff41a4114 jdk7u51-b07
+00c7d4007a2f22deb05753bbd2d36f0ce43ac786 jdk7u51-b08
+bb45667f58f57f96c00551db26ab281bd101e892 jdk7u51-b09
+eecfc296009b81934a329e7ce42a53484093f611 jdk7u51-b10
+a26d0e8ab1027e70ae1ded8ede0086a0a4a10256 jdk7u51-b11
+55a509ccc0e4ed49e311c7ecf2ed29a908bc1d6b jdk7u51-b12
+e2f0036f712aa636cfd55334ac21ea7ca2587a7b jdk7u51-b13
--- a/make/Makefile	Fri Oct 25 11:51:01 2013 +0200
+++ b/make/Makefile	Thu Jan 23 16:59:52 2014 +0100
@@ -160,7 +160,7 @@
 #
 # CORBA
 #
-SUBDIRS = tools javax org sun com
+SUBDIRS = tools sun/rmi javax org sun com
 
 build:
 	$(SUBDIRS-loop)
--- a/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java	Thu Jan 23 16:59:52 2014 +0100
@@ -82,11 +82,18 @@
             super((ORB)orb);
         }
 
-        public org.omg.CORBA.portable.InputStream create_input_stream()
-        {
-            return new AnyInputStream(
-                (com.sun.corba.se.impl.encoding.EncapsInputStream)
-                    super.create_input_stream());
+        public org.omg.CORBA.portable.InputStream create_input_stream() {
+            final org.omg.CORBA.portable.InputStream is = super
+                    .create_input_stream();
+            AnyInputStream aIS = AccessController
+                    .doPrivileged(new PrivilegedAction<AnyInputStream>() {
+                        @Override
+                        public AnyInputStream run() {
+                            return new AnyInputStream(
+                                    (com.sun.corba.se.impl.encoding.EncapsInputStream) is);
+                        }
+                    });
+            return aIS;
         }
     }
 
--- a/src/share/classes/com/sun/corba/se/impl/encoding/EncapsInputStream.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/encoding/EncapsInputStream.java	Thu Jan 23 16:59:52 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, 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
@@ -36,11 +36,10 @@
 import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
 
 import com.sun.corba.se.spi.orb.ORB;
-
 import com.sun.corba.se.spi.logging.CORBALogDomains;
-
 import com.sun.corba.se.impl.logging.ORBUtilSystemException;
 
+import sun.corba.EncapsInputStreamFactory;
 /**
  * Encapsulations are supposed to explicitly define their
  * code sets and GIOP version.  The original resolution to issue 2784
@@ -148,7 +147,7 @@
     }
 
     public CDRInputStream dup() {
-        return new EncapsInputStream(this);
+        return EncapsInputStreamFactory.newEncapsInputStream(this);
     }
 
     protected CodeSetConversion.BTCConverter createCharBTCConverter() {
--- a/src/share/classes/com/sun/corba/se/impl/encoding/EncapsOutputStream.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/encoding/EncapsOutputStream.java	Thu Jan 23 16:59:52 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, 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
@@ -39,6 +39,8 @@
 import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
 import com.sun.corba.se.impl.orbutil.ORBConstants;
 
+import sun.corba.EncapsInputStreamFactory;
+
 /**
  * Encapsulations are supposed to explicitly define their
  * code sets and GIOP version.  The original resolution to issue 2784
@@ -107,11 +109,11 @@
     public org.omg.CORBA.portable.InputStream create_input_stream() {
         freeInternalCaches();
 
-        return new EncapsInputStream(orb(),
-                                     getByteBuffer(),
-                                     getSize(),
-                                     isLittleEndian(),
-                                     getGIOPVersion());
+        return  EncapsInputStreamFactory.newEncapsInputStream(orb(),
+                getByteBuffer(),
+                getSize(),
+                isLittleEndian(),
+                getGIOPVersion());
     }
 
     protected CodeSetConversion.CTBConverter createCharCTBConverter() {
--- a/src/share/classes/com/sun/corba/se/impl/encoding/TypeCodeInputStream.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/encoding/TypeCodeInputStream.java	Thu Jan 23 16:59:52 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, 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
@@ -64,6 +64,8 @@
 import com.sun.corba.se.impl.encoding.CDROutputStream;
 import com.sun.corba.se.impl.encoding.MarshalInputStream;
 
+import sun.corba.EncapsInputStreamFactory;
+
 public class TypeCodeInputStream extends EncapsInputStream implements TypeCodeReader
 {
     private Map typeMap = null;
@@ -157,11 +159,13 @@
 
         // create an encapsulation using the marshal buffer
         if (is instanceof CDRInputStream) {
-            encap = new TypeCodeInputStream((ORB)_orb, encapBuffer, encapBuffer.length,
-                                            ((CDRInputStream)is).isLittleEndian(),
-                                            ((CDRInputStream)is).getGIOPVersion());
+            encap = EncapsInputStreamFactory.newTypeCodeInputStream((ORB) _orb,
+                    encapBuffer, encapBuffer.length,
+                    ((CDRInputStream) is).isLittleEndian(),
+                    ((CDRInputStream) is).getGIOPVersion());
         } else {
-            encap = new TypeCodeInputStream((ORB)_orb, encapBuffer, encapBuffer.length);
+            encap = EncapsInputStreamFactory.newTypeCodeInputStream((ORB) _orb,
+                    encapBuffer, encapBuffer.length);
         }
         encap.setEnclosingInputStream(is);
         encap.makeEncapsulation();
--- a/src/share/classes/com/sun/corba/se/impl/encoding/TypeCodeOutputStream.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/encoding/TypeCodeOutputStream.java	Thu Jan 23 16:59:52 2014 +0100
@@ -61,6 +61,8 @@
 import java.math.BigInteger;
 import java.nio.ByteBuffer;
 
+import sun.corba.EncapsInputStreamFactory;
+
 public final class TypeCodeOutputStream extends EncapsOutputStream
 {
     private OutputStream enclosure = null;
@@ -77,9 +79,9 @@
 
     public org.omg.CORBA.portable.InputStream create_input_stream()
     {
-        //return new TypeCodeInputStream((ORB)orb(), getByteBuffer(), getIndex(), isLittleEndian());
-        TypeCodeInputStream tcis
-            = new TypeCodeInputStream((ORB)orb(), getByteBuffer(), getIndex(), isLittleEndian(), getGIOPVersion());
+        TypeCodeInputStream tcis = EncapsInputStreamFactory
+                .newTypeCodeInputStream((ORB) orb(), getByteBuffer(),
+                        getIndex(), isLittleEndian(), getGIOPVersion());
         //if (TypeCodeImpl.debug) {
             //System.out.println("Created TypeCodeInputStream " + tcis + " with no parent");
             //tcis.printBuffer();
--- a/src/share/classes/com/sun/corba/se/impl/interceptors/CDREncapsCodec.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/interceptors/CDREncapsCodec.java	Thu Jan 23 16:59:52 2014 +0100
@@ -33,6 +33,8 @@
 import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
 import com.sun.corba.se.spi.logging.CORBALogDomains;
 
+import sun.corba.EncapsInputStreamFactory;
+
 import com.sun.corba.se.impl.corba.AnyImpl;
 import com.sun.corba.se.impl.encoding.EncapsInputStream;
 import com.sun.corba.se.impl.encoding.EncapsOutputStream;
@@ -193,8 +195,9 @@
         // it is turned into a FormatMismatch exception.
 
         try {
-            EncapsInputStream cdrIn = new EncapsInputStream( orb, data,
-                data.length, giopVersion );
+            EncapsInputStream cdrIn = EncapsInputStreamFactory.newEncapsInputStream( orb, data,
+                    data.length, giopVersion );
+
 
             cdrIn.consumeEndian();
 
--- a/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java	Thu Jan 23 16:59:52 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, 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
@@ -370,7 +370,7 @@
      * @exception IOException Any of the usual Input/Output related exceptions.
      * @since     JDK1.1
      */
-    public final Object readObjectDelegate() throws IOException
+    public final synchronized Object readObjectDelegate() throws IOException
     {
         try {
 
@@ -389,7 +389,7 @@
             }
     }
 
-    final Object simpleReadObject(Class clz,
+    final synchronized Object simpleReadObject(Class clz,
                                   String repositoryID,
                                   com.sun.org.omg.SendingContext.CodeBase sender,
                                   int offset)
@@ -461,7 +461,7 @@
         return obj;
     }
 
-    public final void simpleSkipObject(String repositoryID,
+    public final synchronized  void simpleSkipObject(String repositoryID,
                                        com.sun.org.omg.SendingContext.CodeBase sender)
                                        /* throws OptionalDataException, ClassNotFoundException, IOException */
     {
@@ -559,7 +559,7 @@
      *              objects.
      * @since     JDK1.1
      */
-    public final void defaultReadObjectDelegate()
+    final synchronized void defaultReadObjectDelegate()
     /* throws IOException, ClassNotFoundException, NotActiveException */
     {
         try {
@@ -988,7 +988,7 @@
         }
     }
 
-    private Object inputObject(Class clz,
+    private synchronized Object inputObject(Class clz,
                                String repositoryID,
                                com.sun.org.omg.SendingContext.CodeBase sender,
                                int offset)
@@ -1317,7 +1317,7 @@
      * a form of custom marshaling.
      *
      */
-    private Object inputObjectUsingFVD(Class clz,
+    private synchronized Object inputObjectUsingFVD(Class clz,
                                        String repositoryID,
                                        com.sun.org.omg.SendingContext.CodeBase sender,
                                        int offset)
--- a/src/share/classes/com/sun/corba/se/impl/io/InputStreamHook.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/io/InputStreamHook.java	Thu Jan 23 16:59:52 2014 +0100
@@ -201,7 +201,7 @@
         readObjectState.endDefaultReadObject(this);
     }
 
-    public abstract void defaultReadObjectDelegate();
+    abstract void defaultReadObjectDelegate();
 
     abstract void readFields(java.util.Map fieldToValueMap)
         throws java.io.InvalidClassException, java.io.StreamCorruptedException,
--- a/src/share/classes/com/sun/corba/se/impl/ior/EncapsulationUtility.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/ior/EncapsulationUtility.java	Thu Jan 23 16:59:52 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, 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
@@ -47,6 +47,8 @@
 import com.sun.corba.se.impl.encoding.EncapsOutputStream ;
 import com.sun.corba.se.impl.encoding.EncapsInputStream ;
 
+import sun.corba.EncapsInputStreamFactory;
+
 /**
  * This static utility class contains various utility methods for reading and
  * writing CDR encapsulations.
@@ -108,8 +110,8 @@
     static public InputStream getEncapsulationStream( InputStream is )
     {
         byte[] data = readOctets( is ) ;
-        EncapsInputStream result = new EncapsInputStream( is.orb(), data,
-            data.length ) ;
+        EncapsInputStream result = EncapsInputStreamFactory.newEncapsInputStream( is.orb(), data,
+                data.length ) ;
         result.consumeEndian() ;
         return result ;
     }
--- a/src/share/classes/com/sun/corba/se/impl/ior/ObjectKeyFactoryImpl.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/ior/ObjectKeyFactoryImpl.java	Thu Jan 23 16:59:52 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, 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
@@ -49,6 +49,8 @@
 import com.sun.corba.se.impl.logging.IORSystemException ;
 
 import com.sun.corba.se.impl.encoding.EncapsInputStream ;
+import sun.corba.EncapsInputStreamFactory;
+
 
 /** Based on the magic and scid, return the appropriate
 * ObjectKeyTemplate.  Expects to be called with a valid
@@ -217,7 +219,7 @@
     public ObjectKey create( byte[] key )
     {
         OctetSeqHolder osh = new OctetSeqHolder() ;
-        EncapsInputStream is = new EncapsInputStream( orb, key, key.length ) ;
+        EncapsInputStream is = EncapsInputStreamFactory.newEncapsInputStream( orb, key, key.length );
 
         ObjectKeyTemplate oktemp = create( is, fullKey, osh ) ;
         if (oktemp == null)
--- a/src/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java	Thu Jan 23 16:59:52 2014 +0100
@@ -70,6 +70,8 @@
 import com.sun.corba.se.impl.encoding.EncapsInputStream ;
 import com.sun.corba.se.impl.encoding.EncapsOutputStream ;
 
+import sun.corba.EncapsInputStreamFactory;
+
 import com.sun.corba.se.impl.util.JDKBridge;
 
 import com.sun.corba.se.impl.logging.IORSystemException;
@@ -170,8 +172,8 @@
             throw wrapper.invalidTaggedProfile() ;
         }
 
-        EncapsInputStream istr = new EncapsInputStream((ORB)orb, profile.profile_data,
-            profile.profile_data.length);
+        EncapsInputStream istr = EncapsInputStreamFactory.newEncapsInputStream((ORB)orb, profile.profile_data,
+                profile.profile_data.length);
         istr.consumeEndian();
         init( istr ) ;
     }
--- a/src/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryDynamicBase.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryDynamicBase.java	Thu Jan 23 16:59:52 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -25,6 +25,7 @@
 
 package com.sun.corba.se.impl.presentation.rmi ;
 
+import java.io.SerializablePermission;
 import java.lang.reflect.InvocationHandler ;
 import java.lang.reflect.Proxy ;
 
@@ -38,11 +39,18 @@
 {
     protected final ClassLoader loader ;
 
-    public StubFactoryDynamicBase( PresentationManager.ClassData classData,
-        ClassLoader loader )
-    {
-        super( classData ) ;
+    private static Void checkPermission() {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(new SerializablePermission(
+                    "enableSubclassImplementation"));
+        }
+        return null;
+    }
 
+    private StubFactoryDynamicBase(Void unused,
+            PresentationManager.ClassData classData, ClassLoader loader) {
+        super(classData);
         // this.loader must not be null, or the newProxyInstance call
         // will fail.
         if (loader == null) {
@@ -55,5 +63,11 @@
         }
     }
 
+    public StubFactoryDynamicBase( PresentationManager.ClassData classData,
+        ClassLoader loader )
+    {
+        this (checkPermission(), classData, loader);
+    }
+
     public abstract org.omg.CORBA.Object makeStub() ;
 }
--- a/src/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryFactoryProxyImpl.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryFactoryProxyImpl.java	Thu Jan 23 16:59:52 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -25,14 +25,23 @@
 
 package com.sun.corba.se.impl.presentation.rmi;
 
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 import com.sun.corba.se.spi.presentation.rmi.PresentationManager ;
 
 public class StubFactoryFactoryProxyImpl extends StubFactoryFactoryDynamicBase
 {
     public PresentationManager.StubFactory makeDynamicStubFactory(
-        PresentationManager pm, PresentationManager.ClassData classData,
-        ClassLoader classLoader )
+        PresentationManager pm, final PresentationManager.ClassData classData,
+        final ClassLoader classLoader )
     {
-        return new StubFactoryProxyImpl( classData, classLoader ) ;
+        return AccessController
+                .doPrivileged(new PrivilegedAction<StubFactoryProxyImpl>() {
+                    @Override
+                    public StubFactoryProxyImpl run() {
+                        return new StubFactoryProxyImpl(classData, classLoader);
+                    }
+                });
     }
 }
--- a/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java	Thu Jan 23 16:59:52 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, 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
@@ -115,6 +115,7 @@
 
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ConcurrentHashMap;
+import sun.corba.EncapsInputStreamFactory;
 
 /**
  * ClientDelegate is the RMI client-side subcontract or representation
@@ -847,8 +848,8 @@
         }
         byte[] data = ((UnknownServiceContext)sc).getData();
         EncapsInputStream in =
-            new EncapsInputStream((ORB)messageMediator.getBroker(),
-                                  data, data.length);
+                EncapsInputStreamFactory.newEncapsInputStream((ORB)messageMediator.getBroker(),
+                                      data, data.length);
         in.consumeEndian();
 
         String msg =
--- a/src/share/classes/com/sun/corba/se/impl/protocol/SharedCDRClientRequestDispatcherImpl.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/protocol/SharedCDRClientRequestDispatcherImpl.java	Thu Jan 23 16:59:52 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, 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
@@ -36,7 +36,8 @@
 import java.util.Iterator;
 import java.rmi.RemoteException;
 import java.nio.ByteBuffer;
-
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import javax.rmi.CORBA.Util;
 import javax.rmi.CORBA.Tie;
 
@@ -111,6 +112,7 @@
 import com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr;
 import com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr;
 import com.sun.corba.se.impl.transport.CorbaContactInfoListIteratorImpl;
+import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
 import com.sun.corba.se.impl.util.JDKBridge;
 
 /**
@@ -156,10 +158,17 @@
 
         ByteBufferWithInfo bbwi = cdrOutputObject.getByteBufferWithInfo();
         cdrOutputObject.getMessageHeader().setSize(bbwi.byteBuffer, bbwi.getSize());
-
-        CDRInputObject cdrInputObject =
-            new CDRInputObject(orb, null, bbwi.byteBuffer,
-                               cdrOutputObject.getMessageHeader());
+        final ORB inOrb = orb;
+        final ByteBuffer inBuffer = bbwi.byteBuffer;
+        final Message inMsg = cdrOutputObject.getMessageHeader();
+        CDRInputObject cdrInputObject = AccessController
+                .doPrivileged(new PrivilegedAction<CDRInputObject>() {
+                    @Override
+                    public CDRInputObject run() {
+                        return new CDRInputObject(inOrb, null, inBuffer,
+                                inMsg);
+                    }
+                });
         messageMediator.setInputObject(cdrInputObject);
         cdrInputObject.setMessageMediator(messageMediator);
 
@@ -192,9 +201,17 @@
         cdrOutputObject = (CDROutputObject) messageMediator.getOutputObject();
         bbwi = cdrOutputObject.getByteBufferWithInfo();
         cdrOutputObject.getMessageHeader().setSize(bbwi.byteBuffer, bbwi.getSize());
-        cdrInputObject =
-            new CDRInputObject(orb, null, bbwi.byteBuffer,
-                               cdrOutputObject.getMessageHeader());
+        final ORB inOrb2 = orb;
+        final ByteBuffer inBuffer2 = bbwi.byteBuffer;
+        final Message inMsg2 = cdrOutputObject.getMessageHeader();
+        cdrInputObject = AccessController
+                .doPrivileged(new PrivilegedAction<CDRInputObject>() {
+                    @Override
+                    public CDRInputObject run() {
+                        return new CDRInputObject(inOrb2, null, inBuffer2,
+                                inMsg2);
+                    }
+                });
         messageMediator.setInputObject(cdrInputObject);
         cdrInputObject.setMessageMediator(messageMediator);
 
--- a/src/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java	Thu Jan 23 16:59:52 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, 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
@@ -36,6 +36,8 @@
 import org.omg.CosNaming.NamingContextExt ;
 import org.omg.CosNaming.NamingContextExtHelper ;
 
+import sun.corba.EncapsInputStreamFactory;
+
 import com.sun.corba.se.spi.ior.IOR;
 import com.sun.corba.se.spi.ior.IORTemplate;
 import com.sun.corba.se.spi.ior.ObjectKey;
@@ -114,8 +116,8 @@
              buf[j] = (byte)((ORBUtility.hexOf(str.charAt(i)) << UN_SHIFT) & 0xF0);
              buf[j] |= (byte)(ORBUtility.hexOf(str.charAt(i+1)) & 0x0F);
         }
-        EncapsInputStream s = new EncapsInputStream(orb, buf, buf.length,
-            orb.getORBData().getGIOPVersion());
+        EncapsInputStream s = EncapsInputStreamFactory.newEncapsInputStream(orb, buf, buf.length,
+                orb.getORBData().getGIOPVersion());
         s.consumeEndian();
         return s.read_Object() ;
     }
--- a/src/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandlerImpl.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandlerImpl.java	Thu Jan 23 16:59:52 2014 +0100
@@ -89,4 +89,6 @@
             sm.checkPermission(perm);
 }
     }
+
+    private static final long serialVersionUID = 4571178305984833743L;
 }
--- a/src/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContexts.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContexts.java	Thu Jan 23 16:59:52 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, 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
@@ -58,6 +58,9 @@
 import com.sun.corba.se.impl.util.Utility ;
 import com.sun.corba.se.impl.logging.ORBUtilSystemException ;
 
+import sun.corba.EncapsInputStreamFactory;
+
+
 public class ServiceContexts {
     private static boolean isDebugging( OutputStream os )
     {
@@ -198,11 +201,11 @@
             // Note:  As of Jan 2001, no standard OMG or Sun service contexts
             // ship wchar data or are defined as using anything but GIOP 1.0 CDR.
             EncapsInputStream eis
-                = new EncapsInputStream(orb,
-                                        data,
-                                        data.length,
-                                        giopVersion,
-                                        codeBase);
+                = EncapsInputStreamFactory.newEncapsInputStream(orb,
+                                    data,
+                                    data.length,
+                                    giopVersion,
+                                    codeBase);
             eis.consumeEndian();
 
             // Now the input stream passed to a ServiceContext
--- a/src/share/classes/com/sun/tools/corba/se/idl/idl_ja.prp	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/com/sun/tools/corba/se/idl/idl_ja.prp	Thu Jan 23 16:59:52 2014 +0100
@@ -110,7 +110,7 @@
 ParseException.badCustom=%0 (\u884C%1): forward\u5024\u5BA3\u8A00\u306Fcustom\u3068\u3057\u3066\u5BA3\u8A00\u3067\u304D\u307E\u305B\u3093\u3002\n%2\n%3
 ParseException.badRepIDAlreadyAssigned=%0 (\u884C%1): \u578B%2\u306B\u306F\u3001\u524D\u306EID\u30D7\u30E9\u30B0\u30DE\u30FB\u30C7\u30A3\u30EC\u30AF\u30C6\u30A3\u30D6\u306E\u30EA\u30DD\u30B8\u30C8\u30EAID\u304C\u3059\u3067\u306B\u5272\u308A\u5F53\u3066\u3089\u308C\u3066\u3044\u307E\u3059\u3002\n%3\n%4
 ParseException.badRepIDForm=%0 (\u884C%1): \u30EA\u30DD\u30B8\u30C8\u30EAID '%2'\u306E\u5F62\u5F0F\u306F'<format>:<string>'\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n%3\n%4
-ParseException.badRepIDPrefix=%0 (\u884C%1): \u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9%2\u306B\u306F\u3001'%4'\u3067\u306F\u306A\u304F\u30EA\u30DD\u30B8\u30C8\u30EAID\u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9`%3'\u304C\u5FC5\u8981\u3067\u3059\u3002\n%5\n%6
+ParseException.badRepIDPrefix=%0 (\u884C%1): \u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9%2\u306B\u306F\u3001'%4'\u3067\u306F\u306A\u304F\u30EA\u30DD\u30B8\u30C8\u30EAID\u63A5\u982D\u8F9E`%3'\u304C\u5FC5\u8981\u3067\u3059\u3002\n%5\n%6
 ParseException.badState=%0 (\u884C%1): %2\u306F\u30B9\u30C6\u30FC\u30C8\u30D5\u30EB\u30FB\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u3067\u304D\u307E\u305B\u3093\u3002\u8907\u6570\u306E\u30B9\u30C6\u30FC\u30C8\u30D5\u30EB\u89AA\u304C\u3042\u308A\u307E\u3059\u3002\n%3\n%4
 ParseException.branchLabel=%0 (\u884C%1): case %2\u306F\u3059\u3067\u306B\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n%3\n%4
 ParseException.branchName=%0 (\u884C%1): %2\u3068\u3044\u3046\u540D\u524D\u306E\u5206\u5C90\u306F\u3059\u3067\u306B\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n%3\n%4
--- a/src/share/classes/javax/rmi/CORBA/Stub.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/javax/rmi/CORBA/Stub.java	Thu Jan 23 16:59:52 2014 +0100
@@ -61,13 +61,11 @@
     private transient StubDelegate stubDelegate = null;
     private static Class stubDelegateClass = null;
     private static final String StubClassKey = "javax.rmi.CORBA.StubClass";
-    private static final String defaultStubImplName = "com.sun.corba.se.impl.javax.rmi.CORBA.StubDelegateImpl";
 
     static {
-        Object stubDelegateInstance = (Object) createDelegateIfSpecified(StubClassKey, defaultStubImplName);
+        Object stubDelegateInstance = createDelegate(StubClassKey);
         if (stubDelegateInstance != null)
             stubDelegateClass = stubDelegateInstance.getClass();
-
     }
 
 
@@ -207,7 +205,7 @@
     // are in different packages and the visibility needs to be package for
     // security reasons. If you know a better solution how to share this code
     // then remove it from PortableRemoteObject. Also in Util.java
-    private static Object createDelegateIfSpecified(String classKey, String defaultClassName) {
+    private static Object createDelegate(String classKey) {
         String className = (String)
             AccessController.doPrivileged(new GetPropertyAction(classKey));
         if (className == null) {
@@ -218,7 +216,7 @@
         }
 
         if (className == null) {
-            className = defaultClassName;
+            return new com.sun.corba.se.impl.javax.rmi.CORBA.StubDelegateImpl();
         }
 
         try {
--- a/src/share/classes/javax/rmi/CORBA/Util.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/javax/rmi/CORBA/Util.java	Thu Jan 23 16:59:52 2014 +0100
@@ -60,14 +60,11 @@
 public class Util {
 
     // This can only be set at static initialization time (no sync necessary).
-    private static javax.rmi.CORBA.UtilDelegate utilDelegate = null;
+    private static final javax.rmi.CORBA.UtilDelegate utilDelegate;
     private static final String UtilClassKey = "javax.rmi.CORBA.UtilClass";
-    private static final String defaultUtilImplName =
-"com.sun.corba.se.impl.javax.rmi.CORBA.Util";
 
     static {
-        utilDelegate = (javax.rmi.CORBA.UtilDelegate)
-            createDelegateIfSpecified(UtilClassKey, defaultUtilImplName);
+        utilDelegate = (javax.rmi.CORBA.UtilDelegate)createDelegate(UtilClassKey);
     }
 
     private Util(){}
@@ -338,9 +335,7 @@
     // are in different packages and the visibility needs to be package for
     // security reasons. If you know a better solution how to share this code
     // then remove it from PortableRemoteObject. Also in Stub.java
-    private static Object createDelegateIfSpecified(String classKey,
-        String defaultClassName)
-    {
+    private static Object createDelegate(String classKey) {
         String className = (String)
             AccessController.doPrivileged(new GetPropertyAction(classKey));
         if (className == null) {
@@ -351,7 +346,7 @@
         }
 
         if (className == null) {
-            className = defaultClassName;
+            return new com.sun.corba.se.impl.javax.rmi.CORBA.Util();
         }
 
         try {
--- a/src/share/classes/javax/rmi/PortableRemoteObject.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/javax/rmi/PortableRemoteObject.java	Thu Jan 23 16:59:52 2014 +0100
@@ -65,17 +65,14 @@
  */
 public class PortableRemoteObject {
 
-    private static javax.rmi.CORBA.PortableRemoteObjectDelegate proDelegate = null;
+    private static final javax.rmi.CORBA.PortableRemoteObjectDelegate proDelegate;
 
     private static final String PortableRemoteObjectClassKey =
             "javax.rmi.CORBA.PortableRemoteObjectClass";
 
-    private static final String defaultPortableRemoteObjectImplName =
-            "com.sun.corba.se.impl.javax.rmi.PortableRemoteObject";
-
     static {
         proDelegate = (javax.rmi.CORBA.PortableRemoteObjectDelegate)
-            createDelegateIfSpecified(PortableRemoteObjectClassKey);
+            createDelegate(PortableRemoteObjectClassKey);
     }
 
     /**
@@ -181,7 +178,7 @@
     // are in different packages and the visibility needs to be package for
     // security reasons. If you know a better solution how to share this code
     // then remove it from here.
-    private static Object createDelegateIfSpecified(String classKey) {
+    private static Object createDelegate(String classKey) {
         String className = (String)
             AccessController.doPrivileged(new GetPropertyAction(classKey));
         if (className == null) {
@@ -191,7 +188,7 @@
             }
         }
         if (className == null) {
-                className = defaultPortableRemoteObjectImplName;
+            return new com.sun.corba.se.impl.javax.rmi.PortableRemoteObject();
         }
 
         try {
--- a/src/share/classes/org/omg/CORBA/ORB.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/org/omg/CORBA/ORB.java	Thu Jan 23 16:59:52 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, 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
@@ -174,15 +174,6 @@
     private static final String ORBSingletonClassKey = "org.omg.CORBA.ORBSingletonClass";
 
     //
-    // The last resort fallback ORB implementation classes in case
-    // no ORB implementation class is dynamically configured through
-    // properties or applet parameters. Change these values to
-    // vendor-specific class names.
-    //
-    private static final String defaultORB = "com.sun.corba.se.impl.orb.ORBImpl";
-    private static final String defaultORBSingleton = "com.sun.corba.se.impl.orb.ORBSingleton";
-
-    //
     // The global instance of the singleton ORB implementation which
     // acts as a factory for typecodes for generated Helper classes.
     // TypeCodes should be immutable since they may be shared across
@@ -294,10 +285,12 @@
             String className = getSystemProperty(ORBSingletonClassKey);
             if (className == null)
                 className = getPropertyFromFile(ORBSingletonClassKey);
-            if (className == null)
-                className = defaultORBSingleton;
-
-            singleton = create_impl(className);
+            if ((className == null) ||
+                    (className.equals("com.sun.corba.se.impl.orb.ORBSingleton"))) {
+                singleton = new com.sun.corba.se.impl.orb.ORBSingleton();
+            } else {
+                singleton = create_impl(className);
+            }
         }
         return singleton;
     }
@@ -347,10 +340,13 @@
             className = getSystemProperty(ORBClassKey);
         if (className == null)
             className = getPropertyFromFile(ORBClassKey);
-        if (className == null)
-            className = defaultORB;
+        if ((className == null) ||
+                    (className.equals("com.sun.corba.se.impl.orb.ORBImpl"))) {
+            orb = new com.sun.corba.se.impl.orb.ORBImpl();
+        } else {
+            orb = create_impl(className);
+        }
 
-        orb = create_impl(className);
         orb.set_parameters(args, props);
         return orb;
     }
@@ -375,10 +371,13 @@
             className = getSystemProperty(ORBClassKey);
         if (className == null)
             className = getPropertyFromFile(ORBClassKey);
-        if (className == null)
-            className = defaultORB;
+        if ((className == null) ||
+                    (className.equals("com.sun.corba.se.impl.orb.ORBImpl"))) {
+            orb = new com.sun.corba.se.impl.orb.ORBImpl();
+        } else {
+            orb = create_impl(className);
+        }
 
-        orb = create_impl(className);
         orb.set_parameters(app, props);
         return orb;
     }
--- a/src/share/classes/org/omg/CORBA_2_3/portable/InputStream.java	Fri Oct 25 11:51:01 2013 +0200
+++ b/src/share/classes/org/omg/CORBA_2_3/portable/InputStream.java	Thu Jan 23 16:59:52 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, 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
@@ -31,6 +31,10 @@
 
 package org.omg.CORBA_2_3.portable;
 
+import java.io.SerializablePermission;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 /**
  * InputStream provides for the reading of all of the mapped IDL types
  * from the stream. It extends org.omg.CORBA.portable.InputStream.  This
@@ -43,6 +47,43 @@
 
 public abstract class InputStream extends org.omg.CORBA.portable.InputStream {
 
+
+    private static final String ALLOW_SUBCLASS_PROP = "jdk.corba.allowInputStreamSubclass";
+
+    private static final boolean allowSubclass = AccessController.doPrivileged(
+        new PrivilegedAction<Boolean>() {
+            @Override
+            public Boolean run() {
+            String prop = System.getProperty(ALLOW_SUBCLASS_PROP);
+                return prop == null ? false :
+                           (prop.equalsIgnoreCase("false") ? false : true);
+            }
+        });
+
+    private static Void checkPermission() {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            if (!allowSubclass)
+                sm.checkPermission(new
+                    SerializablePermission("enableSubclassImplementation"));
+        }
+        return null;
+    }
+
+    private InputStream(Void ignore) { }
+
+    /**
+     * Create a new instance of this class.
+     *
+     * throw SecurityException if SecurityManager is installed and
+     * enableSubclassImplementation SerializablePermission
+     * is not granted or jdk.corba.allowOutputStreamSubclass system
+     * property is either not set or is set to 'false'
+     */
+    public InputStream() {
+        this(checkPermission());
+    }
+
     /**
      * Unmarshalls a value type from the input stream.
      * @return the value type unmarshalled from the input stream
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/corba/EncapsInputStreamFactory.java	Thu Jan 23 16:59:52 2014 +0100
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2013, 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 sun.corba;
+
+import java.nio.ByteBuffer;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+
+import com.sun.corba.se.impl.encoding.EncapsInputStream;
+import com.sun.corba.se.impl.encoding.TypeCodeInputStream;
+import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
+import com.sun.corba.se.pept.protocol.MessageMediator;
+import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
+import com.sun.corba.se.spi.orb.ORB;
+import com.sun.org.omg.SendingContext.CodeBase;
+
+public class EncapsInputStreamFactory {
+
+    public static EncapsInputStream newEncapsInputStream(
+            final org.omg.CORBA.ORB orb, final byte[] buf, final int size,
+            final boolean littleEndian, final GIOPVersion version) {
+        return AccessController
+                .doPrivileged(new PrivilegedAction<EncapsInputStream>() {
+                    @Override
+                    public EncapsInputStream run() {
+                        return new EncapsInputStream(orb, buf, size,
+                                littleEndian, version);
+                    }
+                });
+    }
+
+    public static EncapsInputStream newEncapsInputStream(
+            final org.omg.CORBA.ORB orb, final ByteBuffer byteBuffer,
+            final int size, final boolean littleEndian,
+            final GIOPVersion version) {
+        return AccessController
+                .doPrivileged(new PrivilegedAction<EncapsInputStream>() {
+                    @Override
+                    public EncapsInputStream run() {
+                        return new EncapsInputStream(orb, byteBuffer, size,
+                                littleEndian, version);
+                    }
+                });
+    }
+
+    public static EncapsInputStream newEncapsInputStream(
+            final org.omg.CORBA.ORB orb, final byte[] data, final int size) {
+        return AccessController
+                .doPrivileged(new PrivilegedAction<EncapsInputStream>() {
+                    @Override
+                    public EncapsInputStream run() {
+                        return new EncapsInputStream(orb, data, size);
+                    }
+                });
+    }
+
+    public static EncapsInputStream newEncapsInputStream(
+            final EncapsInputStream eis) {
+        return AccessController
+                .doPrivileged(new PrivilegedAction<EncapsInputStream>() {
+                    @Override
+                    public EncapsInputStream run() {
+                        return new EncapsInputStream(eis);
+                    }
+                });
+    }
+
+    public static EncapsInputStream newEncapsInputStream(
+            final org.omg.CORBA.ORB orb, final byte[] data, final int size,
+            final GIOPVersion version) {
+        return AccessController
+                .doPrivileged(new PrivilegedAction<EncapsInputStream>() {
+                    @Override
+                    public EncapsInputStream run() {
+                        return new EncapsInputStream(orb, data, size, version);
+                    }
+                });
+    }
+
+    public static EncapsInputStream newEncapsInputStream(
+            final org.omg.CORBA.ORB orb, final byte[] data, final int size,
+            final GIOPVersion version, final CodeBase codeBase) {
+        return AccessController
+                .doPrivileged(new PrivilegedAction<EncapsInputStream>() {
+                    @Override
+                    public EncapsInputStream run() {
+                        return new EncapsInputStream(orb, data, size, version,
+                                codeBase);
+                    }
+                });
+    }
+
+    public static TypeCodeInputStream newTypeCodeInputStream(
+            final org.omg.CORBA.ORB orb, final byte[] buf, final int size,
+            final boolean littleEndian, final GIOPVersion version) {
+        return AccessController
+                .doPrivileged(new PrivilegedAction<TypeCodeInputStream>() {
+                    @Override
+                    public TypeCodeInputStream run() {
+                        return new TypeCodeInputStream(orb, buf, size,
+                                littleEndian, version);
+                    }
+                });
+    }
+
+    public static TypeCodeInputStream newTypeCodeInputStream(
+            final org.omg.CORBA.ORB orb, final ByteBuffer byteBuffer,
+            final int size, final boolean littleEndian,
+            final GIOPVersion version) {
+        return AccessController
+                .doPrivileged(new PrivilegedAction<TypeCodeInputStream>() {
+                    @Override
+                    public TypeCodeInputStream run() {
+                        return new TypeCodeInputStream(orb, byteBuffer, size,
+                                littleEndian, version);
+                    }
+                });
+    }
+
+    public static TypeCodeInputStream newTypeCodeInputStream(
+            final org.omg.CORBA.ORB orb, final byte[] data, final int size) {
+        return AccessController
+                .doPrivileged(new PrivilegedAction<TypeCodeInputStream>() {
+                    @Override
+                    public TypeCodeInputStream run() {
+                        return new TypeCodeInputStream(orb, data, size);
+                    }
+                });
+    }
+}