[Checkers] Subtypes of Interned classes

Matt Papi mpapi at csail.mit.edu
Fri Mar 21 14:09:43 EDT 2008


It seems that r1989 (made a few hours ago) "fixed" the bug. That commit 
added a missing call to asSuperOf in SimpleSubtypeRelation.isSubtype (in 
the same way that IGJ's isSubtype uses it) as a fix for a completely 
different bug. In fact, I hadn't even tried reproducing the bug until I 
saw Mahmood's email.

So now, while the Interned checker still doesn't implicitly annotate the 
commonapi.NodeHandle, asSuperOf in isSubtype raises commonapi.NodeHandle 
to @Interned pastry.NodeHandle, so the override check now passes.

We should probably still talk about the annotation inheritance problem, 
but now it can definitely wait until after the release.

- Matt


Mahmood Ali wrote:
> Hi,
> 
> I have been investigating the bug that Mike has reported about  
> Pastry.  I assume that they were about NodeHandle not being annotated  
> as Interned by default, hence getting a method override exception  
> (along with a lot of false warnings):
>      [javac] /Users/mahmood/pastry/src/rice/pastry/client/ 
> PastryAppl.java:372: getHint() in <anonymous  
> rice.pastry.client.PastryAppl$1> cannot override getHint() in  
> rice.p2p.commonapi.MessageReceipt; attempting to use an incompatible  
> return type
>      [javac] found   : rice.pastry.NodeHandle
>      [javac] required: @checkers.quals.Interned  
> rice.p2p.commonapi.NodeHandle
>      [javac]       public NodeHandle getHint() {
> 
> 
> It seems to me that the problem was due to InternedChecker not  
> assuming that the subtype of an interned is interned.
> 
> There are two NodeHandle: rice.pastry.NodeHandle (which is not  
> annotated as Interned) and rice.p2p.common.api.NodeHandle. When the  
> take the base of rice.pastry.NodeHandle as  
> rice.p2p.common.api.NodeHandle we get one without the Interned.
> 
> This comes back to the question of default annotations. I don't think  
> that I will be able to fix this in this release (unless it is a hack).
> 
> - Mahmood
> 
> _______________________________________________
> checkers mailing list
> checkers at lists.csail.mit.edu
> https://lists.csail.mit.edu/mailman/listinfo/checkers



More information about the checkers mailing list