To clarify the intent of the code, it is recommended to add an explicit
super
qualifier to the field access.
Example:
class First {
protected String ambiguous;
}
class Second {
void foo(String ambiguous) {
new First() {
{
System.out.println(ambiguous); // the field is accessed, not the parameter
}
};
}
}
After the quick-fix is applied:
class First {
protected String ambiguous;
}
class Second {
void foo(String ambiguous) {
new First() {
{
System.out.println(super.ambiguous);
}
};
}
}