Skip to content

Commit

Permalink
Fix MetadataEntry's equals and hashCode methods
Browse files Browse the repository at this point in the history
  • Loading branch information
NebelNidas committed Sep 17, 2023
1 parent b65b92f commit b145413
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1714,6 +1714,8 @@ static final class MetadataEntry {

@Override
public boolean equals(Object other) {
if (other == this) return true;

if (!(other instanceof MetadataEntry)) {
return false;
}
Expand All @@ -1723,6 +1725,11 @@ public boolean equals(Object other) {
return this.key.equals(entry.key) && this.value.equals(entry.value);
}

@Override
public int hashCode() {
return key.hashCode() | value.hashCode();
}

final String key;
final String value;
final boolean overrideExisting;
Expand Down

0 comments on commit b145413

Please sign in to comment.