New Miscompilation Into Bytecode Error

Ranjit Mathew rmathew@gmail.com
Fri Jul 2 07:04:00 GMT 2004


On 01 Jul 2004 09:32:56 -0600, Tom Tromey <tromey@redhat.com> wrote:
> 
> >>>>> "Ranjit" == Ranjit Mathew <rmathew@gmail.com> writes:
> 
> Ranjit> For this testcase, the JDK creates the following class files:
> Ranjit>   Hello.class
> Ranjit>   Hello$1.class
> Ranjit>   Hello$1Local.class
> Ranjit> while GCJ creates:
> Ranjit>   Hello.class
> Ranjit>   Hello$1$Local.class
> Ranjit>   Hello$Local$2.class
> Ranjit> Is this divergence intentional and/or OK?
> 
> It is ok.  The names of local and anonymous classes are not fixed (or
> afaik described) by any standard.  The only way to refer to such
> classes outside their compilation unit is via reflection -- but if you
> are doing this then there is something pretty wrong IMO.  We diverge
> from what Sun does here simply because it was easier to implement our
> own approach than it was to reverse engineer what they do.

The original inner class specification that came with JDK 1.1
does impose some conditions:

  http://sunsite.tus.ac.jp/java/docs/jdk1.1/innerclasses.pdf

(See pages 17 and 24 in that PDF.)

I could not, however, find these in the JLS or JVMS based
on a quick "non-thorough" perusal.

Ranjit.

-- 
Ranjit Mathew          Email: rmathew AT gmail DOT com

Bangalore, INDIA.      Web: http://ranjitmathew.tripod.com/



More information about the Java mailing list