liangyepianzhou commented on code in PR #18981:
URL: https://github.com/apache/pulsar/pull/18981#discussion_r1052807610
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/BatchMessageIdImpl.java:
##########
@@ -71,11 +72,14 @@ public int getBatchIndex() {
@Override
public int compareTo(@Nonnull MessageId o) {
if (o instanceof MessageIdImpl) {
+ if (!(o instanceof BatchMessageIdImpl)) {
+ throw new
UnsupportedOperationException(this.getClass().getName()
Review Comment:
If we use the way of throwing exceptions then `illegalArgumentException` may
be better here when the BatchMessageID and MessageID have the same ledger ID
and entry ID.
--
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]