On Fri, 28 Feb 2003, Artur Biesiadowski wrote: > Chris Gray wrote: > > > Nonetheless, javac certainly used to do that, and I'm pretty sure it still > > does. (I could swear that the JLS actually specifies this behaviour, but > > I'm darned if I can find the words now.) > > 13.4.8 > > http://java.sun.com/docs/books/jls/second_edition/html/binaryComp.doc.html#45139 > > [...] > One reason for requiring inlining of constants is that switch statements > require constants on each case, and no two such constant values may be > the same. The compiler checks for duplicate constant values in a switch > statement at compile time; the class file format does not do symbolic > linkage of case values > [...]
Knew it was there somewhere. :) Thx. IMO that text is just a bogus justification for a misguided "optimisation" built into ur-javac. They could as well have said that if two switch cases turn out at runtime to be the same then the result is undefined. As it is we have major breakage. :( -- Chris Gray VM Architect, ACUNIA _______________________________________________ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath

