Read only archive ; use for new issues
Bug 678 - DynStruct with reference component
Summary: DynStruct with reference component
Status: NEW
Alias: None
Product: JacORB
Classification: Unclassified
Component: DynAny (show other bugs)
Version: 2.2.3
Hardware: PC All
: P2 normal
Assignee: Gerald Brose
Depends on:
Reported: 2006-04-05 16:21 CEST by Michal Jelen
Modified: 2006-04-05 16:21 CEST (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Michal Jelen 2006-04-05 16:21:28 CEST
DynStruct.set_members() and DynStruct.set_members_as_dynany() do not work if
struct's member is an object reference of type narrower than generic
CORBA::Object. TypeMismatch exception is erroneously thrown.

---- IDL:
  interface Ifc{

  struct Stc{
    Ifc ref; 

---- Testcase:
  // ORB orb = ...;
  // POA poa = ...;
  // DynAnyFactory daf = ...;  

  DynStruct dstr = (DynStruct)
  NameValuePair nvp[] = new NameValuePair[1];
  Any any = orb.create_any();
  nvp[0] = new NameValuePair("ref",any);

---- Exception :
	at org.jacorb.orb.dynany.DynStruct.set_members(
	at Test.testDyns(
	at Test.main(

---- Analysis:
Exception is thrown from this test in

if( ! nvp[i].value.type().equivalent( members[i].value.type() ))
  throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();

The expected type (members[0].value.type()) is, which is
NOT *equivalent* to any narrower type (such as Ifc in the example).