Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Corba > Sun IDL compile...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 426 of 558
Post > Topic >>

Sun IDL compiler generates invalid Java code!

by "Wernke" <wernke@[EMAIL PROTECTED] > Apr 28, 2006 at 05:56 AM

This problem was noticed with Sun IDL compiler 3.1 and 3.2 but not with
3.0 and not with JacORB. CORBA IDL allows a switch variable of type
boolean whereas Java only allows integers (and enumerations).

The IDL code:
// ----------------- Start IDL --------------------------------
    union OptType switch (boolean) {
        case TRUE: short aNumber;
    };

    interface A {
        void doit( in OptType opt );
    };
// ------------------- End IDL ------------------------------

produces Java code that contains:

// ------------------- Start Java ------------------------------
  private void verifyDefault( boolean value )
  {
    switch (value) {
      case true:
        throw new org.omg.CORBA.BAD_OPERATION() ;

      default:
        return;
    }
  }
// --------------------End Java -----------------------------

This is invalid as the variable 'value' of type boolean must not be
used as a switch variable.

Has anybody come across this problem? I could not find anything on the
web... why has nobody encountered this yet?
 




 1 Posts in Topic:
Sun IDL compiler generates invalid Java code!
"Wernke" <we  2006-04-28 05:56:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Dec 4 0:06:21 CST 2008.