mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-138441 Methods named like getters are wrongly treated as pure
don't track state for primitive get* methods for reference-typed methods, track state only inside "if (getX() != null) ..." flush dfa variables on non-pure getter-like calls
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
class A {
|
||||
private String s;
|
||||
private int next = 0;
|
||||
|
||||
public A(final String s) {
|
||||
this.s = s;
|
||||
}
|
||||
|
||||
private char getChar() {
|
||||
return s.charAt(next++);
|
||||
}
|
||||
|
||||
private void foo() {
|
||||
char c = getChar();
|
||||
if (c == 'a') {
|
||||
if (getChar() == 'b') {
|
||||
System.out.println("ab");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user