Skip to content

Commit

Permalink
Add verb (OPEN or CLOSED) to equivalence calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
avarsava committed Apr 1, 2024
1 parent b3978b9 commit 992c2d7
Showing 1 changed file with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@
import java.text.Normalizer;
import java.time.Duration;
import java.time.Instant;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.TreeSet;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Supplier;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -86,8 +81,15 @@ public boolean equals(Object obj) {
return false;
}
if (summary == null) {
return other.summary == null;
} else return summary.equals(other.summary);
if (other.summary != null) {
return false;
}
} else if (!summary.equals(other.summary)) {
return false;
}
if (verb == null) {
return other.verb == null;
} else return verb.verb().equals(other.verb.verb());
}

@Override
Expand All @@ -106,11 +108,7 @@ public void generateUUID(Consumer<byte[]> digest) {

@Override
public int hashCode() {
final var prime = 31;
var result = 1;
result = prime * result + (connection == null ? 0 : connection.hashCode());
result = prime * result + (summary == null ? 0 : summary.hashCode());
return result;
return Objects.hash(connection, summary, verb);
}

@ActionParameter(required = false)
Expand Down

0 comments on commit 992c2d7

Please sign in to comment.