==== 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
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
- duplicates
-
JDK-4526026 javac allows access to interface members inherited protected from Object
-
- Closed
-