panacekcz / checker-framework

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

If !a.endsWith(c), then a.indexOf(c)<a.length-1 #19

Closed panacekcz closed 7 years ago

panacekcz commented 7 years ago

This is safe:

void m(@MinLen(1) String s){
 if(!a.endsWith("x")){
  @LTLengthOf("a") int i = a.indexOf("x") + 1;
 }
}
panacekcz commented 7 years ago

A nontrivial feature with low impact. I think this is not worth working on now.