Fix duplicate NodeIdentifier instances 23/22323/1
authorRobert Varga <rovarga@cisco.com>
Wed, 10 Jun 2015 08:17:11 +0000 (10:17 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 11 Jun 2015 05:27:22 +0000 (05:27 +0000)
Memory dump has shown we have multitude of NodeIdentifiers pointing to
the prefix QName. This turns out to be the automatic completion of
missing key leaves. Fix the caller to set the leaf up correctly, thus
sharing the NodeIdentifier instance.

Change-Id: I5fb563a9048f4d48c2a2c5b96b8b9bfd08b867f6
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 390fbfa3f810ad278d3c55a256bd1deea2ac1bb0)

bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AbstractIPRIBSupport.java

index 47604443e2f26e340054099fff7aafea3e1405c3..6f6e4f4d4dad06b1a544f7962459abc55545d640 100644 (file)
@@ -57,6 +57,7 @@ abstract class AbstractIPRIBSupport extends AbstractRIBSupport {
         void apply(final DOMDataWriteTransaction tx, final YangInstanceIdentifier base, final NodeIdentifierWithPredicates routeKey, final DataContainerNode<?> route, final ContainerNode attributes) {
             final DataContainerNodeBuilder<NodeIdentifierWithPredicates, MapEntryNode> b = ImmutableNodes.mapEntryBuilder();
             b.withNodeIdentifier(routeKey);
+            b.withChild(ImmutableNodes.leafNode(routeKeyLeafIdentifier(), routeKey.getKeyValues().get(routeQName())));
 
             // FIXME: All route children, there should be a utility somewhere to do this
             for (final DataContainerChild<? extends PathArgument, ?> child : route.getValue()) {