[Checkers] Framework Errors

Mahmood Ali mahmood at MIT.EDU
Sun Apr 27 13:13:51 EDT 2008

Hi everyone,

While I was doing my IGJ case studies, I found and fixed some bugs  
that may impact your case studies.

1. FIXED: NullPointerException while finding supertypes or checking  
for subtyping
- The error is due to a typo (a missing '!') that caused interfaces  
not to be a subtype of Object

2. FIXED: Checker.isSubtype() fails when checking raw types
- The framework wasn't returning raw super types for raw types

3. FIXED: type variables on fields are not resolved when accessed  
without 'this.'
- It's a bit complicated case to explain, but simply put: when  
accessing a field in a super class with a type variable in a subclass  
with the type variable resolved, but when the field is accessed  
without preceeded with 'this.' or 'super.', the type variable is not  
- it has been fixed any way.

FLOW: I don't know if these are bugs, but they are unexpected for me
4. NOT FIXED YET: Flow does not handle compound assignments well
For example:
    String s = "interned";   // s is inferred to be '@Interned String'  
due to assignment
    s += new String("not any more");  // s as rvalue isn't Interned  
              // However flow reports it as Interned, and checker  
emits an error

- This is an interesting property. JLS specifies that += lvalue is  
evaluated only once and has one type, but when dealing with flow  
inference the lvalue is actually has two possible types.
- Not fixed, but added a test for it in Basic (FlowTest)

5. NOT FIXED YET: Flow infers the type of fields based on their  
compiler value, even though they are not final
- Check test flow/Fields.java
- Added a test for it

The previous two bugs account for 10 false-positives (out of 14 I  
noticed) for the interned checker in Daikon; and the first flow bug  
accounts for three false-positives (the only false-positives I found)  
in pastry.

- Mahmood

More information about the checkers mailing list