[Checkers] Annotations on new

Artemus Harper subanark at gmail.com
Sat Aug 30 18:27:26 EDT 2008


When I'm annotating an anonymous class element in annotateImplicit I'm not
seeing any of the annotations present on its deceleration (in the new).

This annotate implicit occurs on an anonymous class when an override check
is done (via the getEnclosingElement method).

E.g.

void method()
{
   new @SomeAnnotaiton SomeClass()
   {
      ...
   };
}

Or is it not intended that annotations on new be viewed from the anonymous
class? I'm not entirely sure what the purpose of the annotation on new
instances is, but seeing as there is no other way to annotate an anonymous
class (aside from annotating type parameters) I assumed that this is a valid
use.
I could potentially try to infer the annotation based on use, but from
within the annotateImplicit(Element,AnnotatedTypeMirror) I don't see of any
good way to get such use information.
-- 
Artemus Harper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.csail.mit.edu/mailman/private/checkers/attachments/20080830/c9a215b2/attachment.htm 


More information about the checkers mailing list