[Checkers] Subtypes of Interned classes

Mahmood Ali mahmood at MIT.EDU
Fri Mar 21 13:16:16 EDT 2008


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  
     [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

More information about the checkers mailing list