Skip to content

Commit

Permalink
Fix TransactionPartnerUser.hashCode(), ReactionTypeAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
pengrad committed Aug 20, 2024
1 parent 0d9fd3d commit 742a401
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,14 @@ public PaidMedia[] paidMedia() {
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
TransactionPartnerUser that = (TransactionPartnerUser) o;
return Objects.equals(type(), that.type()) &&
Objects.equals(user, that.user) &&
Objects.equals(invoice_payload, that.invoice_payload) &&
Objects.equals(paid_media, that.paid_media);
return Objects.equals(user, that.user) && Objects.equals(invoice_payload, that.invoice_payload) && Objects.deepEquals(paid_media, that.paid_media);
}

@Override
public int hashCode() {
return Objects.hash(type(), user, invoice_payload);
return Objects.hash(super.hashCode(), user, invoice_payload, Arrays.hashCode(paid_media));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public ReactionType deserialize(JsonElement element, Type type, JsonDeserializat
} else if (ReactionTypeCustomEmoji.CUSTOM_EMOJI_TYPE.equals(discriminator)) {
return context.deserialize(object, ReactionTypeCustomEmoji.class);
} else if (ReactionTypePaid.PAID_TYPE.equals(discriminator)) {
return context.deserialize(object, ReactionTypeCustomEmoji.class);
return context.deserialize(object, ReactionTypePaid.class);
}

return new ReactionType(discriminator);
Expand Down

0 comments on commit 742a401

Please sign in to comment.