[Checkers] Nullness inference

Fausto Spoto fausto.spoto at univr.it
Sat Jan 3 05:51:38 EST 2009


Thank you Mahmood !

For the library mode, I did not yet tested it for nullness. However,
consider that if you used the version of Julia freely downloaded from
the net, than it is more than one year old and we don't support it
anymore. The nullness analysis there is not that described in my paper.
I will provide the possibility of using the library mode (and test it
before!) with the next web interface, but the analyzer will not be
downloadable.

> 2. Imports: The sample stubs you provided don't include the import  
> statements for the annotation declarations, for  
> checkers.nullness.quals.*.

Good to know. I will add it.

> 3. Stub path: Currently, you need to supply the stub files in command  
> line.  I will add support to specify a stubpath (analogous to  
> classpath).  This should address your point regarding how julia  
> outputs multiple stub files.

If you prefer, I can output everything in a single file. It is just a
bit messy. It depends on how hard it is for you to deal with multiple
files.

> I should also note that julia inferred the parameter types for  
> PolyNull.id2() incorrectly.  For a method declared as:
> 
>    public Object id2(Object p1, Object p2) {
>      if (p1 == p2) return p1;
>      else return p2;
>    }
> 
> The declaration should be
>    public @PolyNull Object id2(@PolyNull Object l1, @PolyNull Object  
> l2);
> not (notice l1 declaration)
>    public @PolyNull Object id2(@Nullable Object l1, @PolyNull Object  
> l2);

I'm not sure that I understand the PolyNull annotation then. For me (and
for julia) it is enough for l2 (i.e. p2) to be non-null to infer that
the return value is non-null. This is obvious when p1 != p2. But if p1
== p2, then from the non-nullness of p2 you infer the non-nullness of p1
and hence of the return value. So I think that the annotation of julia
is just more precise (and more semantical). But I might miss something
in my understanding. Let me know.

Cheers,
  Fausto





More information about the checkers mailing list