DfaMemoryStateImpl#resolveVariableValue: filter special fields

Otherwise String.length() matches to every field which results in warning every time field is checked for negative value after assignment
This commit is contained in:
Tagir Valeev
2017-09-08 14:29:32 +07:00
parent 36397e583c
commit 458c0e35ad
3 changed files with 23 additions and 1 deletions
@@ -0,0 +1,19 @@
class FieldReassignInt {
void test() {
Holder res = new Holder();
int pos = getSomething();
if (pos == -1) System.out.println("oops");
res.position = pos;
if (pos == -1) System.out.println("oops");
if (res.position == -1) System.out.println("oops");
System.out.println(res);
}
static class Holder {
int position;
}
int getSomething() {
return 42;
}
}