tisonkun commented on code in PR #18843:
URL: https://github.com/apache/pulsar/pull/18843#discussion_r1046568429
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/BatchMessageIdImpl.java:
##########
@@ -90,30 +91,15 @@ public int hashCode() {
@Override
public boolean equals(Object o) {
- if (o instanceof MessageIdImpl) {
- MessageIdImpl other = (MessageIdImpl) o;
- int batchIndex = (o instanceof BatchMessageIdImpl) ?
((BatchMessageIdImpl) o).batchIndex : NO_BATCH;
- return messageIdEquals(
- this.ledgerId, this.entryId, this.partitionIndex,
this.batchIndex,
- other.ledgerId, other.entryId, other.partitionIndex, batchIndex
- );
- } else if (o instanceof TopicMessageIdImpl) {
- return equals(((TopicMessageIdImpl) o).getInnerMessageId());
+ if (o instanceof MessageId) {
+ return compareTo((MessageId) o) == 0;
Review Comment:
Updated. I change the impl in `MultiMessageIdImpl` also since it previous
throws exception on type mistach in `equals` which seems unnecessary.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]