import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.TypesUtil;
import org.jetbrains.plugins.groovy.lang.psi.util.GrTraitUtil;
+import static org.jetbrains.plugins.groovy.lang.psi.util.GroovyPropertyUtils.GET_PREFIX;
+
/**
* @author ven
*/
if (another == this) return true;
if (!(another instanceof GrAccessorMethod)) return false;
- if (!((GrAccessorMethod)another).getName().equals(getName())) return false;
- return getManager().areElementsEquivalent(myProperty, ((GrAccessorMethod)another).getProperty());
+ GrAccessorMethod anotherAccessor = (GrAccessorMethod)another;
+ if (isSetter()) {
+ if (!anotherAccessor.isSetter()) return false;
+ }
+ else {
+ if (!getName().startsWith(GET_PREFIX) == anotherAccessor.getName().startsWith(GET_PREFIX)) return false;
+ }
+ return getManager().areElementsEquivalent(myProperty, anotherAccessor.getProperty());
}
@NotNull