String accessorTextName) {
ExecutableElement accessorElement = (ExecutableElement) accessorDeclaration.getElement();
if (!(accessorElement instanceof PropertyAccessorElement)) {
return false;
}
PropertyAccessorElement propertyAccessorElement = (PropertyAccessorElement) accessorElement;
PropertyAccessorElement counterpartAccessor = null;
ClassElement enclosingClassForCounterpart = null;
if (propertyAccessorElement.isGetter()) {
counterpartAccessor = propertyAccessorElement.getCorrespondingSetter();
} else {
counterpartAccessor = propertyAccessorElement.getCorrespondingGetter();
// If the setter and getter are in the same enclosing element, return, this prevents having
// MISMATCHED_GETTER_AND_SETTER_TYPES reported twice.
if (counterpartAccessor != null
&& counterpartAccessor.getEnclosingElement() == propertyAccessorElement.getEnclosingElement()) {
return false;
}
}
if (counterpartAccessor == null) {
// If the accessor is declared in a class, check the superclasses.