[Checkers] Arrays and checkers
mpapi at csail.mit.edu
Thu Mar 20 13:06:58 EDT 2008
> /DS/home-0/mernst/tmp/try-freepastry/pastry/src/rice/p2p/util/XMLObjectOutputStream.java:656: invalid type, type need to be a supertype of the required type.
> found : java.lang.Class
> required: @checkers.quals.Interned java.lang.Class
> return (Class) v.toArray(new Class);
> There's an English error ("need" should be "needs"), but more seriously
> there are 4 uses of "type" in the message, and it's not clear what any of
> them refer to.
Maybe we could instead do something like one of these:
- 'the type "@Mutable String" is not permitted for the expression ...'
with found/required types as above
- '@Mutable may not be applied to the type "@Immutable String"' where
"@Mutable" is the annotation(s) from the found type and "@Immutable
String" is the required type
(While those seem to fail for @Interned -- we'd get the nonsensical 'the
type "Class" is not permitted' -- I believe that invalid @Interned types
are caused only by bugs, so fixing these bugs and/or adding better
assertions makes this a non-issue.)
More information about the checkers