panacekcz / checker-framework

Pluggable type-checking for Java
http://checkerframework.org/
Other
0 stars 0 forks source link

Inferring MinLen by loop bound condition #15

Closed panacekcz closed 7 years ago

panacekcz commented 7 years ago

In some cases, a minimum length could be inferred when comparing the bound of a loop, where a string is generated by concatenation of non-empty parts.

String s = "x";
for(int i=0;i<bound;++i){
 s+="yy";
}
if(bound >= 10){
 @MinLen(21) String s11 = s;
}
panacekcz commented 7 years ago

This issues is vaguely specified and seems not easy to implement. I think this is currently not worth pursuing.