blob: 3090a6415135b236532b28f0d843af1f90d06876 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
package com.siyeh.igtest.visibility.ambiguous_field_access;
public class AmbiguousFieldAccess {
}
class Foo { protected String name; public void set(String s){} }
class Bar {
public void set(String s) {}
private String name;
void foo(java.util.List<String> name) {
for(String name1: name) {
doSome(new Foo() {{
set(<warning descr="Access of field 'name' from superclass 'Foo' looks like access of parameter">name</warning>);
}});
}
}
void foo() {
String name = "name";
new Foo() {{
System.out.println(<warning descr="Access of field 'name' from superclass 'Foo' looks like access of local variable">name</warning>);
}};
}
void bar() {
new Foo() {
void foo() {
System.out.println(<warning descr="Access of field 'name' from superclass 'Foo' looks access of field from surrounding class">name</warning>);
}
};
}
private void doSome(Foo foo) {
}
}
|