2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2014-06-05 17:57:10 +00:00
|
|
|
* @test /nodynamiccopyright/
|
|
|
|
* @bug 4721069
|
2007-12-01 00:00:00 +00:00
|
|
|
* @summary javac allows an interface to override a final method in Object
|
2014-06-05 17:57:10 +00:00
|
|
|
* @author gafter
|
2007-12-01 00:00:00 +00:00
|
|
|
*
|
2014-06-05 17:57:10 +00:00
|
|
|
* @compile/fail/ref=T4721069.out -XDrawDiagnostics T4721069.java
|
2007-12-01 00:00:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
interface I {
|
|
|
|
Class getClass(); // error: cannot overide final from Object
|
|
|
|
static class T {
|
|
|
|
static void f(I i) {
|
|
|
|
if (i == null) {
|
2016-04-19 01:41:38 +00:00
|
|
|
Integer x = Integer.valueOf(2);
|
2007-12-01 00:00:00 +00:00
|
|
|
} else {
|
|
|
|
I x = i;
|
|
|
|
x.getClass();
|
|
|
|
}
|
|
|
|
}
|
2023-01-17 04:43:40 +00:00
|
|
|
public static void meth() {
|
2007-12-01 00:00:00 +00:00
|
|
|
f(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|