| <html> |
| <body> |
| Reports ambiguous accesses of a super class field from an inner or anonymous class, where a local variable, parameter or field with identical name is available |
| in the surrounding code. In this situation a cursory examination of the code may suggest that an element in the surrounding code is |
| accessed, when in actual fact a field from the super class is accessed. To clarify the intent of the code it is recommended to add a |
| <b>super</b> qualifier to the field access. |
| <p>Example: |
| <pre><code> |
| <b>class</b> X { |
| <b>protected</b> String s; |
| } |
| <b>class</b> Y { |
| <b>void</b> foo(String s) { |
| <b>new</b> X() {{ |
| System.out.println(s); // here the field is accessed not the parameter |
| }}; |
| } |
| } |
| </code></pre> |
| <!-- tooltip end --> |
| <p> |
| </body> |
| </html> |