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

javac allows private abstract method to go unimplemented

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1.1
    • tools
    • None
    • x86
    • windows_95



      Name: tb29552 Date: 07/30/97


      Reported by: "Roly Perera" <###@###.###> of GMID sa

      The following class C is in error, since it
      inherits an inaccessible abstract method from
      B; however, javac considers B's f() to be
      implemented by the concrete method in C,
      resulting in an AbstractMethodError at
      run-time when f() is invoked via B.

      public abstract class B {
          private abstract void f (); // now OK?

          static class C extends B {
              void f () { // implements private abstract method
              }
          }

          public static void main (String[] args) {
              B b = new C();
              b.f();
          }
      }

      class C extends B {
          void f () { // oops: does NOT implement B.f!
          }
      }
      ======================================================================

            dstoutamsunw David Stoutamire (Inactive)
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: