diff options
Diffstat (limited to 'org/omg/DynamicAny/NameDynAnyPairHelper.java')
-rw-r--r-- | org/omg/DynamicAny/NameDynAnyPairHelper.java | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/org/omg/DynamicAny/NameDynAnyPairHelper.java b/org/omg/DynamicAny/NameDynAnyPairHelper.java index a0e5c6b85..a9d9edba7 100644 --- a/org/omg/DynamicAny/NameDynAnyPairHelper.java +++ b/org/omg/DynamicAny/NameDynAnyPairHelper.java @@ -40,6 +40,7 @@ package org.omg.DynamicAny; import gnu.CORBA.Minor; import gnu.CORBA.NameDynAnyPairHolder; +import gnu.CORBA.OrbRestricted; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -64,11 +65,6 @@ import org.omg.CORBA.portable.OutputStream; public abstract class NameDynAnyPairHelper { /** - * The cached typecode value, computed only once. - */ - private static TypeCode typeCode; - - /** * Extract the NameDynAnyPair from given Any. * This method uses the NameDynAnyPairHolder. * @@ -107,25 +103,21 @@ public abstract class NameDynAnyPairHelper */ public static TypeCode type() { - if (typeCode == null) - { - ORB orb = ORB.init(); - StructMember[] members = new StructMember[ 2 ]; - - TypeCode field; - - field = - orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0", - "FieldName", - orb.get_primitive_tc(TCKind.tk_string) - ); - members [ 0 ] = new StructMember("id", field, null); - - field = DynAnyHelper.type(); - members [ 1 ] = new StructMember("value", field, null); - typeCode = orb.create_struct_tc(id(), "NameDynAnyPair", members); - } - return typeCode; + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 2 ]; + + TypeCode field; + + field = + orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0", + "FieldName", + orb.get_primitive_tc(TCKind.tk_string) + ); + members [ 0 ] = new StructMember("id", field, null); + + field = DynAnyHelper.type(); + members [ 1 ] = new StructMember("value", field, null); + return orb.create_struct_tc(id(), "NameDynAnyPair", members); } /** |