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

compiler denies to declare inner class within an anonymous inner class

    Details

    • Subcomponent:
    • Resolved In Build:
      1.2beta
    • CPU:
      x86, sparc
    • OS:
      solaris_2.5.1, windows_95
    • Verification:
      Verified

      Description



      Name: laC46010 Date: 07/09/97



      Java compiler fails to compile a code, where an inner class is
      declared within an anonymous inner class. In example "Test.java"
      below, all JDK compilers from 1.1 thru 1.1.3 report the following
      compile-time error:

      Test.java:2: Superclass of local class Test. 1 not found.
      Object o = new Object() {
      ^
      1 error

      Note, that it is essential for this error that inner class
      (or interface) 'A' is declared withing anonymous class extending
      class 'Object'.

      --------------------Test.java----------------------
      class Test {
      Object o = new Object() {
      class A {}
      };
      }
      --------------------------------------------------------------------------------

      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              wmaddoxsunw William Maddox (Inactive)
              Reporter:
              leosunw Leo Leo (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: