-
Bug
-
Resolution: Fixed
-
P4
-
None
-
b94
-
generic
-
generic
-
Verified
I ran into this while testing https://bugs.openjdk.java.net/browse/JDK-8062373.
This is however low priority, just so we have a record of it, I have created a ticket.
While compiling the following program:
final class F<T> {}
public class X {
F f = new F<String> () { };
}
we emit two error messages:
/home/srikanth/tmp/X.java:4: error: cannot inherit from final F
F f = new F<String> () { };
^
/home/srikanth/tmp/X.java:4: error: cannot inherit from final F
F f = new F<String> () { };
^
2 errors
one from hierarchy phase and and the other from headers phase.
When anonymous classes are not involved, the two error messages
have the same co-ordinate pair and so the second one is discarded.
Not so while dealing with anonymous classes.
This is however low priority, just so we have a record of it, I have created a ticket.
While compiling the following program:
final class F<T> {}
public class X {
F f = new F<String> () { };
}
we emit two error messages:
/home/srikanth/tmp/X.java:4: error: cannot inherit from final F
F f = new F<String> () { };
^
/home/srikanth/tmp/X.java:4: error: cannot inherit from final F
F f = new F<String> () { };
^
2 errors
one from hierarchy phase and and the other from headers phase.
When anonymous classes are not involved, the two error messages
have the same co-ordinate pair and so the second one is discarded.
Not so while dealing with anonymous classes.