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 4, 2024
1 parent b3978b9 commit bd833bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 2 additions & 0 deletions changes/fix_jira-equivalence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix jira tickets not closing if open was once generated, and vice versa

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 bd833bf

Please sign in to comment.