JDK-4798151 : inner classes are dumped as enclosing$inner
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javap
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2002-12-30
  • Updated: 2008-06-24
  • Resolved: 2008-06-24
Related Reports
Relates :  
Description
When inner classes are dissembled with Javap, the new tool writes them in this format,

<EnclosingClassName>$<InnerClassName>

It should be

<EnclosingClassName>.<InnerClassName>  (the older javap was right ).

For the example
================
class a
{
        class inner
        {
                int     lInt = 2;
                char    lChar = 'c';
                boolean lBool = true;
                short   lShort = 2;
                long    lLong = 2l;
                double  lDouble = 2.0d;
                float   lFloat = 2.0f;
        }
}


when inner is dissembled,
=========================
jtools-sqe:/vijayan/testbase/src/other_tools/javap/primitives_7 1176 % javap -J-version
java version "1.4.2-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b11)
Java HotSpot(TM) Client VM (build 1.4.2-beta-b11, mixed mode)
jtools-sqe:/vijayan/testbase/src/other_tools/javap/primitives_7 1177 % javap a.inner
Compiled from "a.java"
class a$inner extends java.lang.Object{
    int lInt;
    char lChar;
    boolean lBool;
    short lShort;
    long lLong;
    double lDouble;
    float lFloat;
    a$inner(a);
}

class "a.inner" is dumped as "a$inner"

Comments
EVALUATION Neal's earlier comment about javap being a class file dumper, not a Java language dumper is the key point here. Further, it is hard to determine when the $ might have come from the user, or when it has come from the compiler synthesizing a class name. Finally, it would be even harder to infer the dots in the case of generic classes, now that javap understands the Signature attribute, which again uses the $ form, not the Java language form of the name.
24-06-2008

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
08-09-2004

PUBLIC COMMENTS ...
08-09-2004

EVALUATION javap is correct. That's what's in the class file. javap is not a java language dumper, it is a class file dumper. However, we may change to the old form for convenience when using this brief javap output format. ###@###.### 2003-01-06 deferring until after tiger fcs ###@###.### 2004-04-22
06-01-2003