JDK-6239354 : ORB.create_value_tc() does not set TypeCode.concrete_base variable properly
  • Type: Bug
  • Component: other-libs
  • Sub-Component: corba:orb
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-03-11
  • Updated: 2006-08-30
  • Resolved: 2006-08-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b98Fixed
Description
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

Comments
EVALUATION The fix in the description looks good.
12-08-2006