[Checkers] AnnotatedTypeMirror is not sufficiently unique

Artemus Harper subanark at gmail.com
Thu Oct 2 23:35:32 EDT 2008

Currently the AnnotatedTypeMirror does not uniquely identify a program
element. For example there is no way to determine the difference between the
return types of methods that have the same type and same annotations. This
causes me a problem since I want to be able to retrieve additional
information on an AnnotatedType (in particular the receiver of the method,
if any, that is scope with the deceleration). I assume that it is intended
that the AnnotatedTypeMirror act like Element in unique identification.

Possible solutions I see to this would be:

1. Initialize the enclosingType to the enclosed method (and modify equals to
check for that).

2. Add an Element for the receiver and return type (this would require a
change to the framework and the core java public API)

3. Make the AnnotatedTypeMirror immutable after the annotateImplicit call
and return the same object for the same Element or Tree in the
getAnnotatedType method (instead of returning a copy from the cache). This
way I could keep a mapping from AnnotatedType to reciever.

Artemus Harper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.csail.mit.edu/mailman/private/checkers/attachments/20081002/f88e7303/attachment.htm 

More information about the checkers mailing list