Closed ilya-klyuchnikov closed 9 years ago
TODO:
@NotNull
parameter analysis. If possible reference result is passed to another method it is likely that it will be dereferenced in this method. Also it will work for such code:Object x = foo();
Assert.notNull(x);
return x;
Current state: this approach is quite fast for inference of @NotNull
methods - it seems that there are no problem to propagate all constraints (thanks to smart result origins analysis). The downside is that this approach is slower for inference of @Contract
annotations. The reason is that in many cases work for inference of @Contract
annotations is idle. It may require a separate research to elaborate some heuristics for filtering methods without @Contract
annotations. Another approach is to process contract annotations offline. Usually contract annotations quite rare and they do not (usually) depend on other jars, so they may be calculated independently for jars.
merged in master manually
A fruitful and simple way to infer more
@NotNull annotations
. State has a set of values that should be not null at this point. Values are: parameters, values originated at some instruction.Currently this propagation is for methods without cycles only. It is unclear yet about propagation for methods with cycles - since there are generalizations and we should apply generalization to constraints as well.