You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/12/20 02:02:52 UTC

[GitHub] [pulsar] codelipenghui commented on a diff in pull request #18981: [feat][client][pip-230] Throw exception when MessageIdImpl and BatchMessageIdImpl compare with each other

codelipenghui commented on code in PR #18981:
URL: https://github.com/apache/pulsar/pull/18981#discussion_r1052801279


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageIdImpl.java:
##########
@@ -204,11 +204,13 @@ public byte[] toByteArray() {
     @Override
     public int compareTo(@Nonnull MessageId o) {
         if (o instanceof MessageIdImpl) {
+            if (o instanceof BatchMessageIdImpl) {
+                throw new UnsupportedOperationException(this.getClass().getName()

Review Comment:
   But comparing `(1,1,0)` to `(1,2)` is expected, right? only comparing `(1,1,0)` to `1,1` is not expected.



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org