(tomcat) branch main updated: Consider value as well as key in equals()
[email protected] Fri, 10 Jul 2026 07:40:47 +0000
| Newsgroups | gmane.comp.jakarta.tomcat.devel |
|---|---|
| Message-ID | <178366924722.2385482.9569824405892096046@gitbox3-he-fi.apache.org> |
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);
}
/**