JDK-8011986 : [corba] idlj generates read/write union helper methods that throw wrong exception in some cases
  • Type: Bug
  • Component: other-libs
  • Sub-Component: corba
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2013-04-11
  • Updated: 2013-08-14
  • Resolved: 2013-04-29
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 JDK 7 JDK 8
6u60Fixed 7u40Fixed 8 b01Fixed
Description
IDL-to-java code generator generates read/write union helper methods that throw org.omg.CORBA.BAD_OPERATION in cases when boolean discriminator's value isn't matched. This is wrong.

According to section "7.11.2.2  Discriminated Unions" [1]:

  It is not required that all possible values of the union discriminator be
  listed in the <switch_body>. The value of a union is the value of the
  discriminator together with one of the following:

  ��� If the discriminator value was explicitly listed in a case statement, the
  value of the element associated with that case statement;

  ��� If a default case label was specified, the value of the element associated
  with the default case label;

  ��� No additional value.

[1] http://www.omg.org/spec/CORBA/3.2/Interfaces/PDF/