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

interfaces improperly inherit protected members from object

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • tools
    • None
    • generic
    • solaris_8

      ==== 9.2-implicit-6 Interfaces do not implicitly have any protected
              methods from Object. Javac compiles this, but the resulting class
              causes a VerifyError, so it should not have compiled. FAILED
      ==== Contents of test case:

          compile [saveas T92i6.java {
      interface T92i6 extends Cloneable {
          class Inner {
              Object bar(T92i6 i) {
                  try {
                      // Because this call is nested in the interface, it would have
                      // full access to protected i.clone() if that existed.
                      return i.clone();
                  } catch (CloneNotSupportedException e) {
                      return null;
                  }
              }
          }
      }
      }]

      ---- Result was:
      PASS
      ---- Result should have been:
      FAIL
      ==== 9.2-implicit-6 FAILED

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: