[sonar] 'equals(Object obj)' should be overridden along with the 'compareTo(T obj)' method

pull/3/head
Mahmoud Ben Hassine 10 years ago
parent 045a590be4
commit 671e9a5407

@ -303,6 +303,26 @@ public class AnnotatedRulesEngine extends AbstractRulesEngine<Object> {
}
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ActionMethodBean)) return false;
ActionMethodBean that = (ActionMethodBean) o;
if (order != that.order) return false;
if (!method.equals(that.method)) return false;
return true;
}
@Override
public int hashCode() {
int result = method.hashCode();
result = 31 * result + order;
return result;
}
}
/**
@ -338,6 +358,26 @@ public class AnnotatedRulesEngine extends AbstractRulesEngine<Object> {
}
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof RuleBean)) return false;
RuleBean ruleBean = (RuleBean) o;
if (priority != ruleBean.priority) return false;
if (!rule.equals(ruleBean.rule)) return false;
return true;
}
@Override
public int hashCode() {
int result = priority;
result = 31 * result + rule.hashCode();
return result;
}
}
}

Loading…
Cancel
Save