[Checkers] Index File Brainstorming

Michael Ernst mernst at csail.mit.edu
Thu Aug 28 16:34:14 EDT 2008


Mahmood-

I'm very slow in replying to this, and we have resolved most of the issues
in other  fora, but I wanted to follow up to your message.

I think we've decided that it is best if every Java file is a valid index
file -- this permits both reuse of a distributed library without putting it
on the classpath, and it makes it easier to create an index file since no
conversion is needed.

Some extensions should be permitted, such as making the body of a method
empty (or maybe a semicolon).

> 2. I would really like to have some pattern matching syntax.   
> Something like:
> 
> class * {
>    String toString() @ReadOnly;
>    void clear() @Mutable;
> }

That's a nice idea too.

> I suspect that parsing the  
> entire JDK index file would add a significant overhead when compiling  
> a simple file for example.  I would like it to be similar to the  
> loading mechanism of java.
> 
> Possible solution:
> Have two phase parsing:
> - In the first phase, we index all the classes and their location in  
> the file (using a quick parser)
> - When a class type is queried, we examine if we have it in the index  
> file, and if it is we parse that region and cache the results.   
> Subsequent queries to the same file would be directed to the cache  
> instead.

This may work.  But first, let's get things working, and after that we can
worry about performance.

                    -Mike



More information about the checkers mailing list