IDLJ Compiler

I am using JDK 1.4.2_03 and idlj compiler with version 3.1.

I have the following idl snippet .

/*

StringTypeOpt is a type carrying an optional parameter.

If the boolean is TRUE, then the value is present.

Otherwise the value is absent.

*/

union StringTypeOpt switch (boolean)

{

case TRUE: string value;

};

When I run idlj compiler, the Java Class file "StringTypeOpt .java" get generated having one of the methods as following :-

private void verifyDefault( boolean value )

{

switch (value) {

case true:

throw new org.omg.CORBA.BAD_OPERATION() ;

default:

return;

}

Now, when I try to compile this generated Java source code, I get the following compiler error

/user/gssachdeva/3gpp/generated/ManagedGenericIRPConstDefs/StringTypeOpt.java:64: incompatible types

found: boolean

required: int

switch (value) {

What this basically means is that applying switch on a boolean type is not allowed. But the generated code does so.

Is there some way / option for idlj compiler to stop generating such erroneous code or is it a well known problem.

[1201 byte] By [gssachdevaa] at [2007-10-1 18:03:39]
# 1
Cross-post http://forum.java.sun.com/thread.jspa?threadID=642628
Athenaa at 2007-7-11 12:42:05 > top of Java-index,Other Topics,Algorithms...