This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new b2c7b7e1ea Consider value as well as key in equals()
b2c7b7e1ea is described below

commit b2c7b7e1ead38f1ee40dce844aabb2013ddcbb45
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Jul 10 08:36:29 2026 +0100

    Consider value as well as key in equals()
---
 .../apache/catalina/tribes/tipis/AbstractReplicatedMap.java   | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java 
b/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
index ad005129bf..9fbd52250b 100644
--- a/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
+++ b/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
@@ -1770,9 +1770,16 @@ public abstract class AbstractReplicatedMap<K, V>
             @SuppressWarnings("rawtypes")
             MapEntry other = (MapEntry) o;
             if (key == null) {
-                return other.key == null;
+                if (value == null) {
+                    return other.key == null && other.value == null;
+                } else {
+                    return other.key == null && value.equals(other.value);
+                }
+            }
+            if (value == null) {
+                return key.equals(other.key) && other.value == null;
             }
-            return key.equals(other.key);
+            return key.equals(other.key) && value.equals(other.value);
         }
 
         /**


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to