Bug 865: Fixed use of removed deprecated YANGInstanceIdentifier methods. 47/12047/4
authorTony Tkacik <ttkacik@cisco.com>
Fri, 17 Oct 2014 12:05:06 +0000 (14:05 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Fri, 17 Oct 2014 13:18:40 +0000 (15:18 +0200)
Some components in controller still used methods which was deprecated
before Helium and was removed after Helium was released to accomodate
API changes for 0.7.0 Yangtools. This patch migrates code to replacement
methods.

Change-Id: I146a08caefeb0d666223cf66600a4342a5b49165
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/AugmentationIdentifierGenerator.java
opendaylight/md-sal/sal-common-impl/src/test/java/org/opendaylight/controller/md/sal/common/impl/util/compat/DataNormalizerTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/md/cluster/datastore/model/CompositeModel.java
opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/sal/dom/broker/BackwardsCompatibleMountPointManagerTest.java

index e2c4c358935c184c9244b969533fcf86175e55e8..7f7cdc650ee70c5038a7159fb4d7ea4a81a80679 100644 (file)
@@ -46,7 +46,7 @@ public class AugmentationIdentifierGenerator {
                     .create(name.trim()));
         }
 
                     .create(name.trim()));
         }
 
-        return new YangInstanceIdentifier.AugmentationIdentifier(null, childNames);
+        return new YangInstanceIdentifier.AugmentationIdentifier(childNames);
     }
 
 }
     }
 
 }
index 1595288608cfdbcd5166ccc8f780c1cb98a8e837..3fa8d4e5e9ad48c57b3e811188d916c33e5c5f5f 100644 (file)
@@ -119,7 +119,7 @@ public class DataNormalizerTest {
 
     static final Short OUTER_LIST_ID = (short) 10;
 
 
     static final Short OUTER_LIST_ID = (short) 10;
 
-    static final YangInstanceIdentifier OUTER_LIST_PATH_LEGACY = YangInstanceIdentifier.builder(TEST_QNAME)
+    static final YangInstanceIdentifier OUTER_LIST_PATH_LEGACY = YangInstanceIdentifier.builder(TEST_PATH)
             .nodeWithKey(OUTER_LIST_QNAME, ID_QNAME, OUTER_LIST_ID).build();
 
     static final YangInstanceIdentifier LEAF_TWO_PATH_LEGACY = YangInstanceIdentifier.builder(OUTER_LIST_PATH_LEGACY)
             .nodeWithKey(OUTER_LIST_QNAME, ID_QNAME, OUTER_LIST_ID).build();
 
     static final YangInstanceIdentifier LEAF_TWO_PATH_LEGACY = YangInstanceIdentifier.builder(OUTER_LIST_PATH_LEGACY)
@@ -295,7 +295,7 @@ public class DataNormalizerTest {
                 .withNodeIdentifier(new NodeIdentifier(TEST_QNAME)).withChild(testAnyXmlNode).build();
 
         DataNormalizer normalizer = new DataNormalizer(createTestContext());
                 .withNodeIdentifier(new NodeIdentifier(TEST_QNAME)).withChild(testAnyXmlNode).build();
 
         DataNormalizer normalizer = new DataNormalizer(createTestContext());
-        Node<?> legacyNode = normalizer.toLegacy(YangInstanceIdentifier.builder(TEST_QNAME).build(), testContainerNode);
+        Node<?> legacyNode = normalizer.toLegacy(YangInstanceIdentifier.builder().node(TEST_QNAME).build(), testContainerNode);
 
         verifyLegacyNode(
                 legacyNode,
 
         verifyLegacyNode(
                 legacyNode,
@@ -332,7 +332,7 @@ public class DataNormalizerTest {
 
         DataNormalizer normalizer = new DataNormalizer(createTestContext());
 
 
         DataNormalizer normalizer = new DataNormalizer(createTestContext());
 
-        Node<?> legacyNode = normalizer.toLegacy(YangInstanceIdentifier.builder(TEST_QNAME).build(), testContainerNode);
+        Node<?> legacyNode = normalizer.toLegacy(YangInstanceIdentifier.builder().node(TEST_QNAME).build(), testContainerNode);
 
         verifyLegacyNode(
                 legacyNode,
 
         verifyLegacyNode(
                 legacyNode,
@@ -359,7 +359,7 @@ public class DataNormalizerTest {
 
         DataNormalizer normalizer = new DataNormalizer(createTestContext());
 
 
         DataNormalizer normalizer = new DataNormalizer(createTestContext());
 
-        Node<?> legacyNode = normalizer.toLegacy(YangInstanceIdentifier.builder(TEST_QNAME).build(), testContainerNode);
+        Node<?> legacyNode = normalizer.toLegacy(YangInstanceIdentifier.builder().node(TEST_QNAME).build(), testContainerNode);
 
         verifyLegacyNode(
                 legacyNode,
 
         verifyLegacyNode(
                 legacyNode,
index ece312752d83164e845bce5e4e674499bdc3fd47..1f3732e36259c760ca4a910faf3650900012b440 100644 (file)
@@ -293,7 +293,7 @@ public class CompositeModel {
     Set<QName> childAugmentations = new HashSet<>();
     childAugmentations.add(AUG_QNAME);
     final YangInstanceIdentifier.AugmentationIdentifier augmentationIdentifier =
     Set<QName> childAugmentations = new HashSet<>();
     childAugmentations.add(AUG_QNAME);
     final YangInstanceIdentifier.AugmentationIdentifier augmentationIdentifier =
-        new YangInstanceIdentifier.AugmentationIdentifier(null, childAugmentations);
+        new YangInstanceIdentifier.AugmentationIdentifier(childAugmentations);
     final AugmentationNode augmentationNode =
         Builders.augmentationBuilder()
             .withNodeIdentifier(augmentationIdentifier)
     final AugmentationNode augmentationNode =
         Builders.augmentationBuilder()
             .withNodeIdentifier(augmentationIdentifier)
index 4d239a93f7fe953f1fd6203a47fd3b44e247e483..05c4793218646a85d238bd9ba6d4fc74f8269090 100644 (file)
@@ -48,7 +48,7 @@ public class BackwardsCompatibleMountPointManagerTest {
 
     private BackwardsCompatibleMountPointManager compatibleMountPointManager;
     static final QName qName = QName.create("namespace", "12-12-1212", "mount");
 
     private BackwardsCompatibleMountPointManager compatibleMountPointManager;
     static final QName qName = QName.create("namespace", "12-12-1212", "mount");
-    static final YangInstanceIdentifier id = YangInstanceIdentifier.builder(qName).build();
+    static final YangInstanceIdentifier id = YangInstanceIdentifier.of(qName);
 
     @Before
     public void setUp() throws Exception {
 
     @Before
     public void setUp() throws Exception {