From 822ce32cc213bc396a14b4a58a93be6f2f729ad0 Mon Sep 17 00:00:00 2001 From: Jozef Gloncak Date: Wed, 10 Sep 2014 16:33:25 +0200 Subject: [PATCH] BUG 1440 - incorrect inserting of augment node Augment node was incorrectly inserted to normalized node structure in cases when node was child of choice (case) or child of case. This fix cause that for such cases augment will never found and therefore children will be added to collection of children and not children which were added via augmentation. Change-Id: I9bb0e08def798ee387539bf57b60b4eea1cf65c2 Signed-off-by: Jozef Gloncak --- .../yang/data/codec/gson/CompositeNodeDataWithSchema.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/CompositeNodeDataWithSchema.java b/yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/CompositeNodeDataWithSchema.java index c2997a84d7..ee2541d8e6 100644 --- a/yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/CompositeNodeDataWithSchema.java +++ b/yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/CompositeNodeDataWithSchema.java @@ -13,16 +13,13 @@ import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Multimap; - import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Deque; import java.util.List; import java.util.Map.Entry; - import javax.annotation.Nonnull; - import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter; @@ -193,7 +190,7 @@ class CompositeNodeDataWithSchema extends AbstractNodeDataWithSchema { * node is found then it is returned, else null. */ AugmentationSchema findCorrespondingAugment(final DataSchemaNode parent, final DataSchemaNode child) { - if (parent instanceof AugmentationTarget) { + if (parent instanceof AugmentationTarget && !((parent instanceof ChoiceCaseNode) || (parent instanceof ChoiceNode))) { for (AugmentationSchema augmentation : ((AugmentationTarget) parent).getAvailableAugmentations()) { DataSchemaNode childInAugmentation = augmentation.getDataChildByName(child.getQName()); if (childInAugmentation != null) { -- 2.36.6