// Do lookups in the enclosing class (and the inherited member) if the member is a method or
// a setter for StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER warning.
if (isMethod) {
String setterName = name.getName() + "=";
Element enclosingElementOfSetter = null;
ClassMember conflictingSetter = memberHashMap.get(setterName);
if (conflictingSetter != null) {
enclosingElementOfSetter = conflictingSetter.getElement().getEnclosingElement();
} else {
ExecutableElement elementFromInheritance = inheritanceManager.lookupInheritance(
enclosingClass,
setterName);
if (elementFromInheritance != null) {
enclosingElementOfSetter = elementFromInheritance.getEnclosingElement();
}
}
if (enclosingElementOfSetter != null) {
// report problem
errorReporter.reportErrorForNode(
StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER,
name,
enclosingClass.getDisplayName(),
name.getName(),
enclosingElementOfSetter.getDisplayName());
foundError |= true;
addThisMemberToTheMap = false;
}
} else if (isSetter) {
String methodName = name.getName();