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

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/johnzon.git


The following commit(s) were added to refs/heads/master by this push:
     new 86f6b93  JOHNZON-268 tolerate map in JsonObject#equals
86f6b93 is described below

commit 86f6b93ef61b92a88e62771af7156a2641c3b8b6
Author: Romain Manni-Bucau <[email protected]>
AuthorDate: Sun Aug 18 20:09:12 2019 +0200

    JOHNZON-268 tolerate map in JsonObject#equals
---
 .../src/main/java/org/apache/johnzon/core/JsonObjectImpl.java        | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/johnzon-core/src/main/java/org/apache/johnzon/core/JsonObjectImpl.java 
b/johnzon-core/src/main/java/org/apache/johnzon/core/JsonObjectImpl.java
index a84053f..03d65fe 100644
--- a/johnzon-core/src/main/java/org/apache/johnzon/core/JsonObjectImpl.java
+++ b/johnzon-core/src/main/java/org/apache/johnzon/core/JsonObjectImpl.java
@@ -154,8 +154,9 @@ final class JsonObjectImpl extends AbstractMap<String, 
JsonValue> implements Jso
 
     @Override
     public boolean equals(final Object obj) {
-        return JsonObjectImpl.class.isInstance(obj)
-                && 
unmodifieableBackingMap.equals(JsonObjectImpl.class.cast(obj).unmodifieableBackingMap);
+        return (JsonObjectImpl.class.isInstance(obj)
+                && 
unmodifieableBackingMap.equals(JsonObjectImpl.class.cast(obj).unmodifieableBackingMap))
+                || (Map.class.isInstance(obj) && 
unmodifieableBackingMap.equals(Map.class.cast(obj)));
     }
 
     @Override

Reply via email to