JDK-4196251 : incorrect (?) handling of inner classes
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1998-12-09
  • Updated: 2000-03-02
  • Resolved: 2000-03-02
Related Reports
Relates :  
Description

Name: wm38563			Date: 12/09/98


compiling the following code with javac:
public class Example {
  Example() {
    class Inner{}
  }

  Object anon = new Object() {
    class Inner{}
  };
}

gives the following error:
Example.java:7: Class Example. 1.Inner already defined in Example.java.
    class Inner{}
          ^

but this restriction is not (as far as I have found) mentioned in the language spec
(Review ID: 47488)
======================================================================

Comments
EVALUATION The problem reported here is not reproducible in JDK 1.3. However, the example given does not generate correct code -- one of the classfiles is missing. See 4302890. william.maddox@Eng 2000-01-13 Name: ab88733 Date: 03/02/2000 This bug is being closed because the new javac compiler does not exhibit this behavior. No work on the old javac compiler is planned. The new javac compiler is shipping with the 1.3 release of J2SE. The old compiler is provided in 1.3 for backwards compatibility; it will be withdrawn in a future release of J2SE. ======================================================================
11-06-2004