United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6239354 ORB.create_value_tc() does not set TypeCode.concrete_base variable properly
JDK-6239354 : ORB.create_value_tc() does not set TypeCode.concrete_base variable properly

Details
Type:
Bug
Submit Date:
2005-03-11
Status:
Resolved
Updated Date:
2006-08-30
Project Name:
JDK
Resolved Date:
2006-08-30
Component:
other-libs
OS:
generic
Sub-Component:
corba:orb
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:

Related Reports

Sub Tasks

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.
                                     
2006-08-12



Hardware and Software, Engineered to Work Together