summaryrefslogtreecommitdiffstats
path: root/infra/data-impl
diff options
context:
space:
mode:
authorMartin Sunal <msunal@frinx.io>2017-11-29 16:21:04 +0100
committerMarek Gradzki <mgradzki@cisco.com>2017-12-04 14:43:50 +0000
commit159c08f9808865484f0efad24fc3d721549abe61 (patch)
tree755136622299f295ece61a4cef308781e7433bed /infra/data-impl
parent1eb74ba49748b7416fa5a76797e424b9859b6cc6 (diff)
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 <msunal@frinx.io> Signed-off-by: Maros Marsalek <maros.mars@gmail.com>
Diffstat (limited to 'infra/data-impl')
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java4
1 files changed, 3 insertions, 1 deletions
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<YangInstanceIdentifier, NormalizedNodeUpdate> 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();