javac allows private abstract method to go unimplemented

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P3
    • None
    • Affects Version/s: 1.1.1
    • Component/s: 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!
          }
      }
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: