Currently there are cases where Types.supertype(Type) returns null.
This should not happen. Callers should not have to test for null.
Also, there should be no infinite supertype chains.
Currently, Types.supertype(ErrorType t) returns t. Clients
manipulating types via javax.lang.model.util.Types can too easily fall
into a trap while walking the superclass chain up to the root. The
expectation is that they'll eventually reach NoType. They shouldn't
need to additionally check for ErrorType.
The "See Also" field contains some examples of where these issues have
caused problems. There have been others as well.
This should not happen. Callers should not have to test for null.
Also, there should be no infinite supertype chains.
Currently, Types.supertype(ErrorType t) returns t. Clients
manipulating types via javax.lang.model.util.Types can too easily fall
into a trap while walking the superclass chain up to the root. The
expectation is that they'll eventually reach NoType. They shouldn't
need to additionally check for ErrorType.
The "See Also" field contains some examples of where these issues have
caused problems. There have been others as well.
- relates to
-
JDK-6346973 JSR 269 directSupertypes(Mirror m) causes java.lang.StackOverflowError
- Closed
-
JDK-6346453 JSR 269 Types.directSupertypes implementation returns an invalid list.
- Closed