Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GP-4222] Add verb (OPEN or CLOSED) to equivalence calculations #1287

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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