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.

