The result type of getSuperclass is somewhat useless, consider this example:
Integer i = 1;
i.getClass().getSuperclass();
The static type of the last is expression is (before capture conversion is applied):
Class<? super X> where X extends Integer.
This is equivalent to:
Class<?>
which means that all information is lost.
The compiler knows that the restult type of i.getClass() is Class<? extends Integer> so the result type of i.getClass().getSuperclass() should be Class<? extends Number>.
###@###.### 10/29/04 23:54 GMT
Integer i = 1;
i.getClass().getSuperclass();
The static type of the last is expression is (before capture conversion is applied):
Class<? super X> where X extends Integer.
This is equivalent to:
Class<?>
which means that all information is lost.
The compiler knows that the restult type of i.getClass() is Class<? extends Integer> so the result type of i.getClass().getSuperclass() should be Class<? extends Number>.
###@###.### 10/29/04 23:54 GMT
- relates to
-
JDK-6187181 Please change the signature of java.lang.Object.getClass()
-
- Resolved
-