Skip to content

Commit

Permalink
Add intellij generated equal and hashCode
Browse files Browse the repository at this point in the history
  • Loading branch information
k3KAW8Pnf7mkmdSMPHz27 committed Jan 12, 2021
1 parent 450ba10 commit edd24bd
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/main/java/org/jabref/model/groups/KeywordGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,22 @@ public boolean isDynamic() {
}

@Override
public boolean equals(Object other) {
if (super.equals(other)) {
KeywordGroup otherGroup = (KeywordGroup) other;
return (Objects.equals(isCaseSensitive(), otherGroup.isCaseSensitive()) &&
Objects.equals(getSearchField(), otherGroup.getSearchField()) &&
Objects.equals(getSearchExpression(), otherGroup.getSearchExpression()));
public boolean equals(Object o) {
if (this == o) {
return true;
}
return false;
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}
KeywordGroup that = (KeywordGroup) o;
return isCaseSensitive() == that.isCaseSensitive() && Objects.equals(getSearchField(), that.getSearchField()) && Objects.equals(getSearchExpression(), that.getSearchExpression());
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), isCaseSensitive(), getSearchField(), getSearchExpression());
return Objects.hash(super.hashCode(), getSearchField(), getSearchExpression(), isCaseSensitive());
}
}

0 comments on commit edd24bd

Please sign in to comment.