Skip to content

Commit

Permalink
fix: Comparison of Compatible Historical FlowRule Objects
Browse files Browse the repository at this point in the history
  • Loading branch information
soulx-zhang committed Aug 16, 2023
1 parent 22a4e48 commit 02b01cb
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,12 @@ public boolean equals(Object o) {
if (maxQueueingTimeMs != rule.maxQueueingTimeMs) { return false; }
if (clusterMode != rule.clusterMode) { return false; }
if (refResource != null ? !refResource.equals(rule.refResource) : rule.refResource != null) { return false; }
if (controller != null ? !controller.equals(rule.controller) : rule.controller != null) { return false; }
if (controlBehavior == RuleConstant.CONTROL_BEHAVIOR_CUSTOM) {
if (controller != null ? !controller.equals(rule.controller)
: rule.controller != null) {
return false;
}
}
return clusterConfig != null ? clusterConfig.equals(rule.clusterConfig) : rule.clusterConfig == null;
}

Expand All @@ -220,11 +225,13 @@ public int hashCode() {
result = 31 * result + strategy;
result = 31 * result + (refResource != null ? refResource.hashCode() : 0);
result = 31 * result + controlBehavior;
if (controlBehavior == RuleConstant.CONTROL_BEHAVIOR_CUSTOM) {
result = 31 * result + (controller != null ? controller.hashCode() : 0);
}
result = 31 * result + warmUpPeriodSec;
result = 31 * result + maxQueueingTimeMs;
result = 31 * result + (clusterMode ? 1 : 0);
result = 31 * result + (clusterConfig != null ? clusterConfig.hashCode() : 0);
result = 31 * result + (controller != null ? controller.hashCode() : 0);
return result;
}

Expand Down

0 comments on commit 02b01cb

Please sign in to comment.