Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4196251

incorrect (?) handling of inner classes

XMLWordPrintable

    • x86
    • windows_nt



      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)
      ======================================================================

            wmaddoxsunw William Maddox (Inactive)
            wmaddoxsunw William Maddox (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: