But in that case Annotated#getTypeClosures() would be totally useless and always be the same as getBaseType() + superclasses.
No, it's not. I can imagine a portable extension which performs a restriction similar to @Typed based on different source of metadata (XML, different annotation, ...), i.e. the extension can override the type closure read from the bean class.
The description of Annotated#getTypeClosure() strongly indicates that @Typed must get applied to AnnotatedType already.
I don't share the same opinion. Which part of the following sentence from 11.4. "Alternative metadata sources" is relevant?
getTypeClosure() returns all types to which the base type should be considered assignable.
|