As a followup to this question, first the background
Given a class with this declaration:
public class SomeClass
And a sub
It's a weird one. It seems, though, you could always get rid of the error without introducing any problems by extending SomeClass<Object>
instead of SomeClass
:
public class SomeSubClass extends SomeClass<Object> {
...
}
I don't quite know the rationale for this, but this behavior is specified in the Java Language Specification JLS S4.8:
The superclasses (respectively, superinterfaces) of a raw type are the erasures of the superclasses (superinterfaces) of any of its parameterized invocations.
Given that it's highly discouraged to use Raw types in new code, they wanted to simply the rules for interaction between Raw and Parameterized types I guess.