Issue 1385: Discriminated Union value issue (java-rtf) Source: (, ) Nature: Revision Severity: Summary: Summary: An IDL Discriminated Union has a discriminator of some type. The discriminator is permitted to take any value allowed by its type - nothing in the CORBA spec constrains the discriminator"s value to be those of the branch labels present in the union or just one catch-all default. For this reason, CORBA 2.2, section 3.8.2 defines a Discriminated Union"s value as follows: <example>So, if I were to create a foo and set the discriminator to 74, someone receiving this instance from me should be able to discern that the discriminator"s value was set to 74. As it stands, the IDL->Java mapping provides for discovering the value of the discriminator, so if some other ORB sent me a foo with the discriminator set to 74 I could discern this, but as far as I can tell from reading the current IDL->Java mapping (CORBA 2.2 - no relevant changes appear to be present on orbos/98-03-10) there is no way that I could set the discriminator"s value to 74. Resolution: closed issue Revised Text: Actions taken: May 19, 1998: received issue July 30, 1998: closed issue Discussion: End of Annotations:===== Return-Path: From: Jeffrey Mischkinsky Subject: new java rtf issue To: issues@omg.org, juergen@omg.org Date: Mon, 18 May 1998 20:48:24 -0700 (PDT) Hi Juergen, Please open a new Java-rtf issue. thx, jeff An IDL Discriminated Union has a discriminator of some type. The discriminator is permitted to take any value allowed by its type - nothing in the CORBA spec constrains the discriminator's value to be those of the branch labels present in the union or just one catch-all default. For this reason, CORBA 2.2, section 3.8.2 defines a Discriminated Union's value as follows: "It is not required that all possible values of the union discriminator be listed in the . The value of a union is the value of the discriminator together with one of the following: o If the discriminator value was explicitly listed in a case statement, the value of the element associated with that case statement; o If a default case label was specified, the value of the element associated with the default case label; o No additional value. Access to the discriminator and the related element is language-mapping dependent." The implication is that the following union foo switch (int) { case 1: string bar; }; declares a union type foo whose value consists either of: - the integer value 1 together with a string value for bar OR - some integer value other than 1. So, if I were to create a foo and set the discriminator to 74, someone receiving this instance from me should be able to discern that the discriminator's value was set to 74. As it stands, the IDL->Java mapping provides for discovering the value of the discriminator, so if some other ORB sent me a foo with the discriminator set to 74 I could discern this, but as far as I can tell from reading the current IDL->Java mapping (CORBA 2.2 - no relevant changes appear to be present on orbos/98-03-10) there is no way that I could set the discriminator's value to 74. -- Jeff Mischkinsky jmischki@dcn.davis.ca.us +1 530-758-9850 jeffm@inprise.com +1 650-312-5158 jeffm@visigenic.com +1 650-312-5158