Skip to content

Commit

Permalink
Cleanup SLM History Item .equals (#80938)
Browse files Browse the repository at this point in the history
There was some confusing dead code here and the field comparisons were
done in a needlessly confusing manner also.
  • Loading branch information
original-brownbear authored Nov 23, 2021
1 parent 98279cc commit d2217eb
Showing 1 changed file with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,19 +243,14 @@ public final XContentBuilder toXContent(XContentBuilder builder, Params params)
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
boolean result;
if (this == o) result = true;
if (o == null || getClass() != o.getClass()) result = false;
SnapshotHistoryItem that1 = (SnapshotHistoryItem) o;
result = isSuccess() == that1.isSuccess()
&& timestamp == that1.getTimestamp()
&& Objects.equals(getPolicyId(), that1.getPolicyId())
&& Objects.equals(getRepository(), that1.getRepository())
&& Objects.equals(getSnapshotName(), that1.getSnapshotName())
&& Objects.equals(getOperation(), that1.getOperation());
if (result == false) return false;
SnapshotHistoryItem that = (SnapshotHistoryItem) o;
return Objects.equals(getSnapshotConfiguration(), that.getSnapshotConfiguration())
return isSuccess() == that.isSuccess()
&& timestamp == that.getTimestamp()
&& Objects.equals(getPolicyId(), that.getPolicyId())
&& Objects.equals(getRepository(), that.getRepository())
&& Objects.equals(getSnapshotName(), that.getSnapshotName())
&& Objects.equals(getOperation(), that.getOperation())
&& Objects.equals(getSnapshotConfiguration(), that.getSnapshotConfiguration())
&& Objects.equals(getErrorDetails(), that.getErrorDetails());
}

Expand Down

0 comments on commit d2217eb

Please sign in to comment.