[Checkers] r2622: modifying visitNewClass on TypeFromTree

Telmo telmo at MIT.EDU
Wed Jun 4 12:02:41 EDT 2008


Oh. I wasn't aware of the possibility of adding annotations between new 
and the new class name.

What annotations should be added to the new object, though? Namely, if one 
writes

new @A SomeObject();

and the constructor of SomeObject takes the form

SomeObject() @B { ... }

should the created type have both the @A and @B annotations?

-Telmo


On Tue, 3 Jun 2008, Mahmood Ali wrote:

> Hi Telmo again,
>
> I reviewed your code, and it is a bit buggy.  I just checked in two failing 
> cases: a framework (to test AnnotatedTypeFactory.constructorFromUse) and a 
> Javari test (to test JavariAnnotatedTypeFactory.constructorFromUse).
>
> The offending lines are:
>> Map<? extends AnnotatedTypeMirror, AnnotatedTypeMirror> receiverTypeMap
>> 	= Collections.singletonMap<exType.getReceiverType(), type);
>> return exType.substitute(receiverTypeMap);
>
> You may only substitute polymorphic annotation and nothing else!
>
> - Mahmood



More information about the checkers mailing list