[JSR308] Constructor Annotation Inference

Niko Matsakis niko at alum.mit.edu
Fri Jan 16 09:10:13 EST 2009


>> Before answering your email, I would like to mention a convention
>> used within AnnotatedTypeFactory.  Many methods in the class follow
>> a naming convention: .fromFOO methods (e.g. fromTree,
>> fromExpression) return types with only the annotations that the user
>> explicitly inserted; .getAnnotatedType* methods (e.g.
>> getAnnotatedType, getAnnotatedTypeFromTypeTree) return types with
>> the annotations enforced in such trees whether explicitly inserted
>> by the user or implicitly inserted by the checker.
>
> Good to know.  Perhaps I am using the wrong method.  If I can't find a
> better one, however, I will simply override fromExpression().  I have
> to think about it a bit.

Ok, now I understand this part of the design better!  Once I switched  
to using getAnnotatedType() instead of fromExpression(), I realized I  
could easily add my inferred annotations in annotateImplicit(), and  
all is well (for the moment, at least ;).  Thanks again for the help!


Niko



More information about the JSR308 mailing list