/** * Equality method for this definition. * * @param other another definition. * @param project the current project. * @return true if the definitions are the same. */ @Override public boolean sameDefinition(AntTypeDefinition other, Project project) { return (other != null && other.getClass() == getClass() && parent != null && parent.sameDefinition(((PreSetDefinition) other).parent, project) && element.similar(((PreSetDefinition) other).element)); }
/** * Equality method for this definition * * @param other another definition * @param project the current project * @return true if the definitions are the same */ @Override public boolean sameDefinition(AntTypeDefinition other, Project project) { if (!super.sameDefinition(other, project)) { return false; } MyAntTypeDefinition otherDef = (MyAntTypeDefinition) other; return macroDef.sameDefinition(otherDef.macroDef); }
/** * Check if two definitions are the same. * @param def the new definition. * @param old the old definition. * @return true if the two definitions are the same. */ private boolean sameDefinition(AntTypeDefinition def, AntTypeDefinition old) { boolean defValid = validDefinition(def); boolean sameValidity = (defValid == validDefinition(old)); //must have same validity; then if they are valid they must also be the same: return sameValidity && (!defValid || def.sameDefinition(old, project)); }