[Checkers] Class supertypes and interfaces

Mahmood Ali mahmood at MIT.EDU
Fri Mar 7 05:32:56 EST 2008


Hi guys,

In the last few hours, I have been working on a more proper  
implementation of factory.directSupertypes().  Currently it takes the  
annotations on class tree extends and implement clauses into  
consideration.

Unfortunately, it fails when we have the TypeElement only, in cases we  
read classes from bytecode. I cannot seem to find the annotations on  
the element.

I added a test case (Supertypes.java) and it is passing now. I expect  
it to be working for Interned and NonNull. I think that it may break  
Javari and IGJ due to calling getAnnotatedType() on the  
AnnotatedTypeTree.

I think that we need to seperate the public interface of  
AnnotatedTypeFactory from its internal usage. I think that Matt has  
done much progress in this aspect in the new patch, but I haven't  
reviewed thoroughly, so maybe there is a better method to call other  
than getAnnotatedType().

The reason for separation is avoiding getting the implicit and default  
annotations. Using Javari for example, once we call getAnnotatedType()  
on the AnnotatedTree 'Clonable' it would return '@Mutable Clonable'  
even if its in the context of '@ReadOnly class MyClass extends  
Clonable { }'.

- Mahmood



More information about the checkers mailing list