From 159c08f9808865484f0efad24fc3d721549abe61 Mon Sep 17 00:00:00 2001 From: Martin Sunal Date: Wed, 29 Nov 2017 16:21:04 +0100 Subject: Fixed bug in ModificationDiff when leaf is modified in augmentation modification type is subtree-modified. Implementation expected only type write or delete. Change-Id: I3146b1a7322bd73d7972fecaceeafa654eeb84a4 Signed-off-by: Martin Sunal Signed-off-by: Maros Marsalek --- .../src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'infra') diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java index 74e21dfa1..9d97d9141 100644 --- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java +++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java @@ -18,6 +18,7 @@ package io.fd.honeycomb.data.impl; import static com.google.common.base.Preconditions.checkNotNull; import static org.opendaylight.yangtools.yang.data.api.schema.tree.ModificationType.DELETE; +import static org.opendaylight.yangtools.yang.data.api.schema.tree.ModificationType.SUBTREE_MODIFIED; import static org.opendaylight.yangtools.yang.data.api.schema.tree.ModificationType.WRITE; import com.google.common.collect.ImmutableMap; @@ -50,6 +51,7 @@ final class ModificationDiff { private static final ModificationDiff EMPTY_DIFF = new ModificationDiff(Collections.emptyMap()); private static final EnumSet VALID_MODIFICATIONS = EnumSet.of(WRITE, DELETE); + private static final EnumSet LEAF_VALID_MODIFICATIONS = EnumSet.of(WRITE, DELETE, SUBTREE_MODIFIED); private final Map updates; @@ -194,7 +196,7 @@ final class ModificationDiff { // For some reason, we get modifications on unmodified list keys // and that messes up our modifications collection here, so we need to skip .filter(Modification::isBeforeAndAfterDifferent) - .filter(child -> VALID_MODIFICATIONS.contains(child.getModificationType())) + .filter(child -> LEAF_VALID_MODIFICATIONS.contains(child.getModificationType())) .findFirst() .isPresent(); -- cgit 1.2.3-korg