Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6239354

ORB.create_value_tc() does not set TypeCode.concrete_base variable properly

XMLWordPrintable

    • b98
    • generic
    • generic

      Method ORB.create_value_tc creates TypeCode but does not set variable TypeCode.concrete_base properly. Method concrete_base_type() of new created instance returns null instead of specified concrete base type.

      Example:
      ----------------------------------------------------------------------
      import org.omg.CORBA.*;

      public class Tester {


          public static void main(String [] args) throws Exception {
              String name = "name";
              String id = "id";
              ORB orb = ORB.init(args, null);
              TypeCode concrete_base = orb.create_abstract_interface_tc(id,name);
              TypeCode tc = orb.create_value_tc(id, name, (short) 0, concrete_base,
                          new ValueMember[0]);
              System.out.println("Expected: " + concrete_base);
              System.out.println("Returned: " + tc.concrete_base_type());
          }
      }
      Result:

      Expected: com.sun.corba.se.impl.corba.TypeCodeImpl@80fa6f =
      abstractInterface name...
      Returned: null
      -------------------------------------------------------------------------

      It seems, that the problem can be in com/sun/corba/se/impl/corba/TypeCodeImpl.java:
              ....
      public TypeCodeImpl(ORB orb,
                              int creationKind,
                              String id,
                              String name,
                              short type_modifier,
                              TypeCode concrete_base,
                              ValueMember[] members) {
                 ...
                  if (_concrete_base != null) {
                      ^^^^^^^^^^
      should it be concrete_base instead?

                      _concrete_base = convertToNative(_orb, concrete_base);
                  }
      ...

      Please note, that JCK test api/org_omg/CORBA/ORBTest (doTest25) will fail due to this bug (but only after fixing JCK bug #6239328).


      ###@###.### 2005-03-11 10:28:21 GMT

            hgodugusunw Harsha Godugu (Inactive)
            agavrilosunw Alexey Gavrilov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: