From 3ebd96ec413b7eff5f73cd3bcf5bc02abe535f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=A7=E6=98=93=E5=AE=A2?= Date: Tue, 29 Nov 2022 11:59:13 +0800 Subject: [PATCH] [improve][broker] Make Consumer#equals more effective (#18662) --- .../main/java/org/apache/pulsar/broker/service/Consumer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java index ac924725f7e810..494327ef28d406 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java @@ -908,7 +908,7 @@ public CompletableFuture checkPermissionsAsync() { public boolean equals(Object obj) { if (obj instanceof Consumer) { Consumer other = (Consumer) obj; - return Objects.equals(cnx.clientAddress(), other.cnx.clientAddress()) && consumerId == other.consumerId; + return consumerId == other.consumerId && Objects.equals(cnx.clientAddress(), other.cnx.clientAddress()); } return false; }