Consider the following:
@CompileStatic
class Pogo {
boolean flag
Pogo(Pogo that) {
flag = that.flag // 2 occurrences
}
void setFlag(boolean value) {
if (condition()) {
flag = false // 1 occurrence
} else {
flag = value // 1 occurrence
}
}
private boolean condition() {}
}
When searching for references of the field "flag", only "that.flag" is producing a match within the class Pogo.