Reports field accesses of a super class where a local variable, parameter or field of the same name is available in the surrounding class. In this case a cursory reader of the code may think that a variable in the surrounding class is accessed, when in fact a field from the super class is accessed. To make the intent of the code more clear it is recommended to add a this qualifier to the field access call.

Example:


class X {
  protected String s;
}
class Y {
  void foo(String s) {
    new X() {{
      System.out.println(s); // here the field is accessed not the parameter
    }};
  }
}