package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl;
import com.google.common.collect.Iterables;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
@Override
protected boolean valueEquals(final UserLeafSetNode<?> other) {
- return children.equals(((ImmutableUserLeafSetNode<?>) other).children);
+ if (other instanceof ImmutableUserLeafSetNode) {
+ return children.equals(((ImmutableUserLeafSetNode<?>) other).children);
+ }
+ // Note: performs a size() check first
+ return Iterables.elementsEqual(children.values(), other.body());
}
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private Map<NodeWithValue, LeafSetEntryNode<T>> getChildren() {
return Collections.unmodifiableMap(children);
}