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

new of an abstract inner class hides abstract class warning

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.2.0
    • 1.2.0
    • tools
    • None
    • 1.2fcs
    • sparc
    • solaris_2.6
    • Not verified

      Compile the following code:

      class t {
          void foo() { new inner(); }
          class inner implements Runnable { };
      }

      You will get an error for the "new inner()" complaining that inner is an abstract class, but you wont get the error that inner is an abstract class and not declared so. What you need to *fix* the problem is the second, suppressed error because it will tell you what method you are not implementing. If you move inner to be a top-level class you get both errors, which is much more useful.

      This worked correctly in Beta3, and got broken in Beta4 (I'm using build K).

            tturnidgsunw Todd Turnidge (Inactive)
            karnoldsunw Kenneth Arnold (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: