Why does directSupertypes() not return a raw type as required by JLS 4.10?
16:53 11 Nov 2025

The contract for Types#directSupertypes(TypeMirror) says that it will return "the direct supertypes of a type". It also references section 4.10 of the Java Language Specification.

The set of direct supertypes that 4.10 defines is a superset of the set of types that Types#directSupertypes(TypeMirror) returns. Why does directSupertypes(TypeMirror) return a subset?

java annotation-processing jls javax.lang.model