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

package private methods do not override across package boundary

XMLWordPrintable

    • mantis
    • generic
    • solaris_8
    • Verified

      The following test case exposes a failure also detected by jacks test 8.1.1.1-default-abstract-9

      ==================== Tryit.java ====================
           1 /*
           2 * @test %W% %E%
           3 * @bug 4686811
           4 * @summary package private methods do not override across package boundary
           5 * @author gafter
           6 *
           7 * @compile p1/A.java p1/C.java p2/B.java
           8 */
      ==================== p1/A.java ====================
           1 package p1;
           2
           3 public abstract class A {
           4 abstract void f();
           5 }
      ==================== p1/C.java ====================
           1 package p1;
           2 public abstract class C extends p2.B {
           3 void f() {} // overrides noninherited A.f()
           4 }
      ==================== p2/B.java ====================
           1 package p2;
           2
           3 public abstract class B extends p1.A {
           4 }
           5
           6 class D extends p1.C {
           7 }

            gafter Neal Gafter (Inactive)
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: