Fix immutable NormalizedNode equality
[yangtools.git] / data / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / builder / impl / ImmutableLeafSetNodeBuilder.java
index d034b7f942659476d60aeeb64e7e7221b7740911..057fcc0187eedd059ff9d7dc48aa510c05395d6d 100644 (file)
@@ -161,7 +161,18 @@ public class ImmutableLeafSetNodeBuilder<T> implements ListNodeBuilder<T, System
 
         @Override
         protected boolean valueEquals(final SystemLeafSetNode<?> other) {
-            return children.equals(((ImmutableLeafSetNode<?>) other).children);
+            if (other instanceof ImmutableLeafSetNode) {
+                return children.equals(((ImmutableLeafSetNode<?>) other).children);
+            }
+            if (size() != other.size()) {
+                return false;
+            }
+            for (var child : children.values()) {
+                if (!child.equals(other.childByArg(child.getIdentifier()))) {
+                    return false;
+                }
+            }
+            return true;
         }
     }
 }