Bug 868: Replaced use of toInstance() for build(). 89/14189/1
authorTony Tkacik <ttkacik@cisco.com>
Fri, 16 Jan 2015 09:21:59 +0000 (10:21 +0100)
committerTony Tkacik <ttkacik@cisco.com>
Fri, 16 Jan 2015 09:32:22 +0000 (10:32 +0100)
Change-Id: I55280880475f6011d5494dba30e4ac052c34b474
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
23 files changed:
bgp/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateAdjRIBsInTest.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/RIBImpl.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/AdjacencyRIBsInTest.java
bgp/rib-spi/src/test/java/org/opendaylight/protocol/bgp/rib/spi/AbstractAdjRIBsTest.java
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/AbstractTopologyBuilder.java
bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/AbstractTopologyBuilderTest.java
bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/Ipv4ReachabilityTopologyBuilderTest.java
bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/Ipv6ReachabilityTopologyBuilderTest.java
bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/LinkstateTopologyBuilderTest.java
concepts/src/test/java/org/opendaylight/protocol/concepts/DefaultInstanceReferenceTest.java
data-change-counter/src/main/java/org/opendaylight/controller/config/yang/bgpcep/data/change/counter/DataChangeCounterImplModule.java
data-change-counter/src/main/java/org/opendaylight/protocol/data/change/counter/TopologyDataChangeCounter.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/pcep/PcepRpcServicesRoutingTest.java
pcep/segment-routing/.project
pcep/topology-provider/src/main/java/org/opendaylight/controller/config/yang/pcep/topology/provider/PCEPTopologyProviderModule.java
pcep/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/AbstractPCEPSessionTest.java
pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/NodeChangedListener.java
pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/PCEPTunnelTopologyProvider.java
pcep/tunnel-provider/src/main/java/org/opendaylight/controller/config/yang/pcep/tunnel/provider/PCEPTunnelTopologyProviderModule.java
pcep/tunnel-provider/src/test/java/org/opendaylight/bgpcep/pcep/tunnel/provider/NodeChangedListenerTest.java
pcep/tunnel-provider/src/test/java/org/opendaylight/bgpcep/pcep/tunnel/provider/TunnelProgrammingTest.java
programming/impl/src/main/java/org/opendaylight/bgpcep/programming/impl/ProgrammingServiceImpl.java
programming/impl/src/test/java/org/opendaylight/bgpcep/programming/impl/ProgrammingServiceImplTest.java

index cda63e46733c878b1a9033cffcff6fdb9f22cc5a..980a1d040ed6bcb59f8b7ec53050c09a337bb355 100644 (file)
@@ -109,7 +109,7 @@ public class LinkstateAdjRIBsInTest extends AbstractDataBrokerTest {
     public void setUp() {
         MockitoAnnotations.initMocks(this);
         final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
-        final InstanceIdentifier<Rib> iid = InstanceIdentifier.builder(BgpRib.class).child(Rib.class, new RibKey(new RibId("test-rib"))).toInstance();
+        final InstanceIdentifier<Rib> iid = InstanceIdentifier.builder(BgpRib.class).child(Rib.class, new RibKey(new RibId("test-rib"))).build();
         final KeyedInstanceIdentifier<Tables, TablesKey> key = iid.child(LocRib.class).child(Tables.class, new TablesKey(LinkstateAddressFamily.class,
             LinkstateSubsequentAddressFamily.class));
 
index 708529c6224dc801ff7879d62b2a81c52aafbdbe..432869c178d25299a21209183a47d4f860841b32 100644 (file)
@@ -145,7 +145,7 @@ public final class RIBImpl extends DefaultRibReference implements AutoCloseable,
     public RIBImpl(final RibId ribId, final AsNumber localAs, final Ipv4Address localBgpId, final RIBExtensionConsumerContext extensions,
         final BGPDispatcher dispatcher, final ReconnectStrategyFactory tcpStrategyFactory,
         final ReconnectStrategyFactory sessionStrategyFactory, final DataBroker dps, final List<BgpTableType> localTables) {
-        super(InstanceIdentifier.builder(BgpRib.class).child(Rib.class, new RibKey(Preconditions.checkNotNull(ribId))).toInstance());
+        super(InstanceIdentifier.builder(BgpRib.class).child(Rib.class, new RibKey(Preconditions.checkNotNull(ribId))).build());
         this.chain = dps.createTransactionChain(this);
         this.localAs = Preconditions.checkNotNull(localAs);
         this.comparator = new BGPObjectComparator(localAs);
index 3636a9e3bb4a5658bb64a0fc2123d1f0aa1b498a..108c54dd6169536f674698bedc69adeca47e13f8 100644 (file)
@@ -59,7 +59,7 @@ public class AdjacencyRIBsInTest extends AbstractDataBrokerTest {
 
     private WriteTransaction trans;
 
-    private final DefaultRibReference rib = new DefaultRibReference(InstanceIdentifier.builder(BgpRib.class).child(Rib.class, new RibKey(new RibId("test"))).toInstance());
+    private final DefaultRibReference rib = new DefaultRibReference(InstanceIdentifier.builder(BgpRib.class).child(Rib.class, new RibKey(new RibId("test"))).build());
 
     private final RIBActivator act = new RIBActivator();
 
index 4caf3f3675f90f6e599c85f21991f40dc11bb302..7df05df800a6a7b0b57d1cc85dd68e28cc1307f3 100644 (file)
@@ -58,7 +58,7 @@ public class AbstractAdjRIBsTest {
 
     private static final Ipv4Prefix IPV4_PREFIX2 = new Ipv4Prefix("2.2.2.2/32");
 
-    private static final InstanceIdentifier<Rib> RIB_IID = InstanceIdentifier.builder(BgpRib.class).child(Rib.class, new RibKey(new RibId("test-rib"))).toInstance();
+    private static final InstanceIdentifier<Rib> RIB_IID = InstanceIdentifier.builder(BgpRib.class).child(Rib.class, new RibKey(new RibId("test-rib"))).build();
 
     private static final KeyedInstanceIdentifier<Tables, TablesKey> TABLES_IID = RIB_IID.child(LocRib.class).child(Tables.class, new TablesKey(Ipv4AddressFamily.class,
             UnicastSubsequentAddressFamily.class));
index 6b54314bf7d24662c24a50e5b36258c84ac9fcfb..c59e499395254b5197a305242b77461ba13816d5 100644 (file)
@@ -64,7 +64,7 @@ public abstract class AbstractTopologyBuilder<T extends Route> implements AutoCl
         this.chain = dataProvider.createTransactionChain(this);
 
         final TopologyKey tk = new TopologyKey(Preconditions.checkNotNull(topologyId));
-        this.topology = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, tk).toInstance();
+        this.topology = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, tk).build();
 
         LOG.debug("Initiating topology builder from {} at {}", locRibReference, this.topology);
 
@@ -89,7 +89,7 @@ public abstract class AbstractTopologyBuilder<T extends Route> implements AutoCl
 
     public final InstanceIdentifier<Tables> tableInstanceIdentifier(final Class<? extends AddressFamily> afi,
             final Class<? extends SubsequentAddressFamily> safi) {
-        return this.locRibReference.getInstanceIdentifier().builder().child(LocRib.class).child(Tables.class, new TablesKey(afi, safi)).toInstance();
+        return this.locRibReference.getInstanceIdentifier().builder().child(LocRib.class).child(Tables.class, new TablesKey(afi, safi)).build();
     }
 
     protected abstract void createObject(ReadWriteTransaction trans, InstanceIdentifier<T> id, T value);
index 99b07001840335c394ca433797b3d2e39e575a99..07da88cbd1dfff478d04b3b1d5cb1d582253fe4a 100644 (file)
@@ -36,7 +36,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 public abstract class AbstractTopologyBuilderTest extends AbstractDataBrokerTest {
 
     protected static final TopologyId TEST_TOPOLOGY_ID = new TopologyId("test-topo");
-    protected static RibReference LOC_RIB_REF = new DefaultRibReference(InstanceIdentifier.builder(BgpRib.class).child(Rib.class, new RibKey(Preconditions.checkNotNull(new RibId("test-rib")))).toInstance());
+    protected static RibReference LOC_RIB_REF = new DefaultRibReference(InstanceIdentifier.builder(BgpRib.class).child(Rib.class, new RibKey(Preconditions.checkNotNull(new RibId("test-rib")))).build());
 
     protected ListenerRegistration<DataChangeListener> reg;
 
@@ -47,7 +47,7 @@ public abstract class AbstractTopologyBuilderTest extends AbstractDataBrokerTest
 
     protected void createEmptyTopology() {
         final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
-        wTx.put(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.builder(NetworkTopology.class).toInstance(), new NetworkTopologyBuilder().setTopology(Collections.<Topology>emptyList()).build());
+        wTx.put(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.builder(NetworkTopology.class).build(), new NetworkTopologyBuilder().setTopology(Collections.<Topology>emptyList()).build());
         wTx.submit();
     }
 
index 614834968b561374162700ea0e867718a3fe2989..d75d5f6896eac30e8973dada5012668d52facee7 100644 (file)
@@ -58,7 +58,7 @@ public class Ipv4ReachabilityTopologyBuilderTest extends AbstractTopologyBuilder
         wTx.put(LogicalDatastoreType.OPERATIONAL, path, new TablesBuilder().setAfi(Ipv4AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class)
                 .setAttributes(new AttributesBuilder().setUptodate(Boolean.TRUE).build()).setRoutes(new Ipv4RoutesCaseBuilder().build()).build(), true);
         wTx.submit();
-        this.ipv4RouteIID = path.builder().child(Ipv4Routes.class).child(Ipv4Route.class, new Ipv4RouteKey(new Ipv4Prefix(ROUTE_IP4PREFIX))).toInstance();
+        this.ipv4RouteIID = path.builder().child(Ipv4Routes.class).child(Ipv4Route.class, new Ipv4RouteKey(new Ipv4Prefix(ROUTE_IP4PREFIX))).build();
     }
 
     @Test
index 4b23724c6feebb93fcf74e13491a91cd07de3462..ac74610ecd264ed8bb935f73a1d01424b41f1ec5 100644 (file)
@@ -58,7 +58,7 @@ public class Ipv6ReachabilityTopologyBuilderTest extends AbstractTopologyBuilder
         wTx.put(LogicalDatastoreType.OPERATIONAL, path, new TablesBuilder().setAfi(Ipv6AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class)
                 .setAttributes(new AttributesBuilder().setUptodate(Boolean.TRUE).build()).setRoutes(new Ipv6RoutesCaseBuilder().build()).build(), true);
         wTx.submit();
-        this.ipv6RouteIID = path.builder().child(Ipv6Routes.class).child(Ipv6Route.class, new Ipv6RouteKey(new Ipv6Prefix(ROUTE_IP6PREFIX))).toInstance();
+        this.ipv6RouteIID = path.builder().child(Ipv6Routes.class).child(Ipv6Route.class, new Ipv6RouteKey(new Ipv6Prefix(ROUTE_IP6PREFIX))).build();
     }
 
     @Test
index 0d718cf28d15b1928f34ebfb1557e0b93e1695e9..804c14d901acaf5ecc8e0a47fa70f895767f3dce 100644 (file)
@@ -105,7 +105,7 @@ public class LinkstateTopologyBuilderTest extends AbstractTopologyBuilderTest {
         wTx.put(LogicalDatastoreType.OPERATIONAL, path, new TablesBuilder().setAfi(LinkstateAddressFamily.class).setSafi(LinkstateSubsequentAddressFamily.class)
                 .setAttributes(new AttributesBuilder().setUptodate(Boolean.TRUE).build()).setRoutes(new LinkstateRoutesCaseBuilder().build()).build(), true);
         wTx.submit();
-        this.linkstateRouteIID = (InstanceIdentifier<LinkstateRoute>) path.builder().child((Class)LinkstateRoutes.class).child(LinkstateRoute.class, new LinkstateRouteKey(LINKSTATE_ROUTE_KEY)).toInstance();
+        this.linkstateRouteIID = (InstanceIdentifier<LinkstateRoute>) path.builder().child((Class)LinkstateRoutes.class).child(LinkstateRoute.class, new LinkstateRouteKey(LINKSTATE_ROUTE_KEY)).build();
     }
 
     @Test
index 2a79514f4bce0c2ae9d6e7b7dfb6b9882e3b751a..1f258530470e84f10777a2ba4566e9c29851bcec 100644 (file)
@@ -15,7 +15,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 public class DefaultInstanceReferenceTest {
 
-    private static final InstanceIdentifier<NetworkTopology> IID = InstanceIdentifier.builder(NetworkTopology.class).toInstance();
+    private static final InstanceIdentifier<NetworkTopology> IID = InstanceIdentifier.builder(NetworkTopology.class).build();
 
     @Test
     public void testDefaultInstanceReference() {
index 64ffe5d0c6c181e6ddbe9d082d6e461a8dd29914..02fcd38436bf02cfac228c587a1e41d50221e394 100644 (file)
@@ -43,7 +43,7 @@ public class DataChangeCounterImplModule extends org.opendaylight.controller.con
     public java.lang.AutoCloseable createInstance() {
         final TopologyDataChangeCounter counter = new TopologyDataChangeCounter(getDataProviderDependency());
         final InstanceIdentifier<Topology> topoIId = InstanceIdentifier.builder(NetworkTopology.class)
-                .child(Topology.class, new TopologyKey(new TopologyId(getTopologyName()))).toInstance();
+                .child(Topology.class, new TopologyKey(new TopologyId(getTopologyName()))).build();
         final ListenerRegistration<DataChangeListener> registration = getDataProviderDependency().registerDataChangeListener(
                 LogicalDatastoreType.OPERATIONAL, topoIId, counter, DataBroker.DataChangeScope.SUBTREE);
         return new DataChangeCounterCloseable(counter, registration);
index 2ce311adb7ab9ad00c0f60b524c243ea1f5309e8..fc5067cfdf7f1bd11b42592d2d7a7182813f9fac 100644 (file)
@@ -26,7 +26,7 @@ public class TopologyDataChangeCounter implements DataChangeListener {
     private static final Logger LOG = LoggerFactory.getLogger(TopologyDataChangeCounter.class);
 
     protected static final InstanceIdentifier<DataChangeCounter> IID = InstanceIdentifier
-            .builder(DataChangeCounter.class).toInstance();
+            .builder(DataChangeCounter.class).build();
 
     private final DataBroker dataBroker;
     private AtomicLong count;
index 20e379678c775c09103226338ba045556794a8df..5125e1a986bb22f53016f70df3645963138480a9 100644 (file)
@@ -57,7 +57,7 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
         assertNotNull(getBroker());
 
         final InstanceIdentifier<Topology> topology = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class,
-                new TopologyKey(getTopologyId("Topo1"))).toInstance();
+                new TopologyKey(getTopologyId("Topo1"))).build();
 
         BindingAwareProvider provider1 = new AbstractTestProvider() {
 
@@ -76,7 +76,7 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
         broker.registerProvider(provider1, getBundleContext());
 
         final InstanceIdentifier<Topology> topology2 = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class,
-                new TopologyKey(getTopologyId("Topo2"))).toInstance();
+                new TopologyKey(getTopologyId("Topo2"))).build();
 
         BindingAwareProvider provider2 = new AbstractTestProvider() {
 
@@ -160,7 +160,7 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
         assertNotNull(getBroker());
 
         final InstanceIdentifier<Topology> topology = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class,
-                new TopologyKey(getTopologyId("Topo1"))).toInstance();
+                new TopologyKey(getTopologyId("Topo1"))).build();
 
         BindingAwareProvider provider1 = new AbstractTestProvider() {
 
@@ -179,7 +179,7 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
         broker.registerProvider(provider1, getBundleContext());
 
         final InstanceIdentifier<Topology> topology2 = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class,
-                new TopologyKey(getTopologyId("Topo2"))).toInstance();
+                new TopologyKey(getTopologyId("Topo2"))).build();
 
         BindingAwareProvider provider2 = new AbstractTestProvider() {
 
@@ -251,7 +251,7 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
         assertNotNull(getBroker());
 
         final InstanceIdentifier<Topology> topology = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class,
-                new TopologyKey(getTopologyId("Topo1"))).toInstance();
+                new TopologyKey(getTopologyId("Topo1"))).build();
 
         BindingAwareProvider provider1 = new AbstractTestProvider() {
 
@@ -270,7 +270,7 @@ public class PcepRpcServicesRoutingTest extends AbstractPcepOsgiTest {
         broker.registerProvider(provider1, getBundleContext());
 
         final InstanceIdentifier<Topology> topology2 = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class,
-                new TopologyKey(getTopologyId("Topo2"))).toInstance();
+                new TopologyKey(getTopologyId("Topo2"))).build();
 
         BindingAwareProvider provider2 = new AbstractTestProvider() {
 
index 4ce7acbdf001d0752c43798bf1b5440d88071106..73246590e46a358721412bfaa4ce77b20947cf2c 100644 (file)
                        <arguments>
                        </arguments>
                </buildCommand>
+               <buildCommand>
+                       <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
                <buildCommand>
                        <name>org.eclipse.m2e.core.maven2Builder</name>
                        <arguments>
@@ -20,5 +25,6 @@
                <nature>org.eclipse.pde.PluginNature</nature>
                <nature>org.eclipse.jdt.core.javanature</nature>
                <nature>org.eclipse.m2e.core.maven2Nature</nature>
+               <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
        </natures>
 </projectDescription>
index e9e35eea1b6eef6fb8dd236d514b31b30c558f26..542f96e556c63dd4c5e18c3c1421dc12f98e690f 100644 (file)
@@ -127,7 +127,7 @@ public final class PCEPTopologyProviderModule extends
     @Override
     public java.lang.AutoCloseable createInstance() {
         final InstanceIdentifier<Topology> topology = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class,
-                new TopologyKey(getTopologyId())).toInstance();
+                new TopologyKey(getTopologyId())).build();
         final InetSocketAddress address = new InetSocketAddress(listenAddress(), getListenPort().getValue());
         final KeyMapping keys = contructKeys();
 
index 5b5ab8448fa6b6389e800a26d6fe1d17ec6f1aa6..93b1fa9d11f7e820f5c2565c252256dd0a1302ab 100644 (file)
@@ -67,7 +67,7 @@ public abstract class AbstractPCEPSessionTest<T extends TopologySessionListenerF
 
     protected static final String TEST_TOPOLOGY_NAME = "testtopo";
     protected static final InstanceIdentifier<Topology> TOPO_IID = InstanceIdentifier.builder(NetworkTopology.class).child(
-            Topology.class, new TopologyKey(new TopologyId(TEST_TOPOLOGY_NAME))).toInstance();
+            Topology.class, new TopologyKey(new TopologyId(TEST_TOPOLOGY_NAME))).build();
     protected static final String TEST_ADDRESS = "127.0.0.1";
     protected static final NodeId NODE_ID = new NodeId("pcc://" + TEST_ADDRESS);
     protected static final String TEST_LSP_NAME = "tunnel0";
index b8f2b0da373626f3d6c40fc399ad1b21e3263e9e..7c2b2c884491f1649247c72ad61618d878758a72 100644 (file)
@@ -105,7 +105,7 @@ public final class NodeChangedListener implements DataChangeListener {
         }
 
         for (final ReportedLsp l : pccnode.getPathComputationClient().getReportedLsp()) {
-            lsps.add(id.builder().augmentation(Node1.class).child(PathComputationClient.class).child(ReportedLsp.class, l.getKey()).toInstance());
+            lsps.add(id.builder().augmentation(Node1.class).child(PathComputationClient.class).child(ReportedLsp.class, l.getKey()).build());
         }
     }
 
@@ -167,7 +167,7 @@ public final class NodeChangedListener implements DataChangeListener {
                                 for (final IpAddress a : ((Ip) tpt).getIpAddress()) {
                                     if (addr.equals(a)) {
                                         handleSni(sni, n, inControl, trans);
-                                        return this.target.builder().child(Node.class, n.getKey()).child(TerminationPoint.class, tp.getKey()).toInstance();
+                                        return this.target.builder().child(Node.class, n.getKey()).child(TerminationPoint.class, tp.getKey()).build();
                                     }
                                 }
                             } else {
@@ -260,7 +260,7 @@ public final class NodeChangedListener implements DataChangeListener {
     }
 
     private InstanceIdentifier<TerminationPoint> tpIdentifier(final NodeId node, final TpId tp) {
-        return this.target.builder().child(Node.class, new NodeKey(node)).child(TerminationPoint.class, new TerminationPointKey(tp)).toInstance();
+        return this.target.builder().child(Node.class, new NodeKey(node)).child(TerminationPoint.class, new TerminationPointKey(tp)).build();
     }
 
     private InstanceIdentifier<Node> nodeIdentifier(final NodeId node) {
index f3c2cb11f6fedb8fdeaef7445717b273a4e5209d..9ac3bda833c49276ee45542a7119e2b918f82ee6 100644 (file)
@@ -35,7 +35,7 @@ public final class PCEPTunnelTopologyProvider implements AutoCloseable {
     public static PCEPTunnelTopologyProvider create(final DataBroker dataProvider,
             final InstanceIdentifier<Topology> sourceTopology, final TopologyId targetTopology) {
         final InstanceIdentifier<Topology> dst = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class,
-                new TopologyKey(targetTopology)).toInstance();
+                new TopologyKey(targetTopology)).build();
         final NodeChangedListener ncl = new NodeChangedListener(dataProvider, dst);
 
         final InstanceIdentifier<Node> src = sourceTopology.child(Node.class);
index b38cf6c37c3062e366b4d15064bbb995195ddafe..89264abc046f81b9b93efd77232ee15e3c6f5bc8 100644 (file)
@@ -61,7 +61,7 @@ public final class PCEPTunnelTopologyProviderModule extends AbstractPCEPTunnelTo
         final BindingAwareBroker.RoutedRpcRegistration<TopologyTunnelPcepProgrammingService> reg = getRpcRegistryDependency().addRoutedRpcImplementation(
                 TopologyTunnelPcepProgrammingService.class, tp);
         final InstanceIdentifier<Topology> topology = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class,
-                new TopologyKey(getTopologyId())).toInstance();
+                new TopologyKey(getTopologyId())).build();
         reg.registerPath(NetworkTopologyContext.class, topology);
 
         final class TunnelTopologyReferenceCloseable extends DefaultTopologyReference implements AutoCloseable {
index 29d0516c27c7158b7d37a5d799434c32bb22b85c..6518957c27ee6dfc75ad2c8b0d0f842b62907cd9 100644 (file)
@@ -75,8 +75,8 @@ public class NodeChangedListenerTest extends AbstractDataBrokerTest {
     private static final String LSP2_NAME = "lsp2";
     private static final long LSP2_ID = 2;
 
-    private static final InstanceIdentifier<Topology> PCEP_TOPO_IID = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, new TopologyKey(PCEP_TOPOLOGY_ID)).toInstance();
-    private static final InstanceIdentifier<Topology> TUNNEL_TOPO_IID = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, new TopologyKey(TUNNEL_TOPOLOGY_ID)).toInstance();
+    private static final InstanceIdentifier<Topology> PCEP_TOPO_IID = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, new TopologyKey(PCEP_TOPOLOGY_ID)).build();
+    private static final InstanceIdentifier<Topology> TUNNEL_TOPO_IID = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, new TopologyKey(TUNNEL_TOPOLOGY_ID)).build();
 
     private ListenerRegistration<DataChangeListener> listenerRegistration;
 
@@ -165,13 +165,13 @@ public class NodeChangedListenerTest extends AbstractDataBrokerTest {
         node1Builder.setPathComputationClient(new PathComputationClientBuilder().setStateSync(PccSyncState.Synchronized).setReportedLsp(Lists.newArrayList(reportedLps)).setIpAddress(new IpAddress(new Ipv4Address(ipv4Address))).build());
         nodeBuilder.addAugmentation(Node1.class, node1Builder.build());
         final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
-        wTx.put(LogicalDatastoreType.OPERATIONAL, PCEP_TOPO_IID.builder().child(Node.class, new NodeKey(nodeId)).toInstance(), nodeBuilder.build());
+        wTx.put(LogicalDatastoreType.OPERATIONAL, PCEP_TOPO_IID.builder().child(Node.class, new NodeKey(nodeId)).build(), nodeBuilder.build());
         wTx.submit().checkedGet();
     }
 
     private void removeNode(final NodeId nodeId) throws TransactionCommitFailedException {
         final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
-        wTx.delete(LogicalDatastoreType.OPERATIONAL, PCEP_TOPO_IID.builder().child(Node.class, new NodeKey(nodeId)).toInstance());
+        wTx.delete(LogicalDatastoreType.OPERATIONAL, PCEP_TOPO_IID.builder().child(Node.class, new NodeKey(nodeId)).build());
         wTx.submit().checkedGet();
     }
 
index 659f054d3c7f1898cd765285c48c47327f0bf276..4a558b6fda4b44f753b0269ab5e186987cd5af56 100644 (file)
@@ -100,7 +100,7 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 public class TunnelProgrammingTest extends AbstractDataBrokerTest {
 
     private static final TopologyId TOPOLOGY_ID = new TopologyId("tunnel-topo");
-    private static final InstanceIdentifier<Topology> TOPO_IID = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, new TopologyKey(TOPOLOGY_ID)).toInstance();
+    private static final InstanceIdentifier<Topology> TOPO_IID = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, new TopologyKey(TOPOLOGY_ID)).build();
 
     private static final String NODE1_IPV4 = "127.0.0.1";
     private static final NodeId NODE1_ID = new NodeId("pcc://" + NODE1_IPV4);
@@ -301,7 +301,7 @@ public class TunnelProgrammingTest extends AbstractDataBrokerTest {
         linkBuilder.setKey(new LinkKey(LINK1_ID));
         linkBuilder.addAugmentation(Link1.class, new Link1Builder().setSymbolicPathName(LINK1_ID.getValue()).build());
         final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
-        wTx.put(LogicalDatastoreType.OPERATIONAL, TOPO_IID.builder().child(Link.class, new LinkKey(LINK1_ID)).toInstance(), linkBuilder.build(), true);
+        wTx.put(LogicalDatastoreType.OPERATIONAL, TOPO_IID.builder().child(Link.class, new LinkKey(LINK1_ID)).build(), linkBuilder.build(), true);
         wTx.submit().checkedGet();
     }
 
index bbda508a0fe29e6ae62d67ffe6ab9e5f0f52f90e..791e2384462415779f649f92ced912dcf3bb0e1d 100644 (file)
@@ -116,7 +116,7 @@ public final class ProgrammingServiceImpl implements AutoCloseable, InstructionS
         this.notifs = Preconditions.checkNotNull(notifs);
         this.executor = Preconditions.checkNotNull(executor);
         this.timer = Preconditions.checkNotNull(timer);
-        this.qid = InstanceIdentifier.builder(InstructionsQueue.class).toInstance();
+        this.qid = InstanceIdentifier.builder(InstructionsQueue.class).build();
 
         final ReadWriteTransaction t = dataProvider.newReadWriteTransaction();
         try {
index f6c1b5c8d34ab53c4c0cb0ed0a4086aef938c66a..31c31476c6a83a21371bcbb9dd4af0561a594ef8 100644 (file)
@@ -333,7 +333,7 @@ public class ProgrammingServiceImplTest extends AbstractDataBrokerTest {
 
     private boolean assertInstructionExists(final InstructionId id) {
         try {
-            return getDataBroker().newReadOnlyTransaction().read(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.builder(InstructionsQueue.class).toInstance().child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev130930.instruction.queue.Instruction.class,
+            return getDataBroker().newReadOnlyTransaction().read(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.builder(InstructionsQueue.class).build().child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev130930.instruction.queue.Instruction.class,
                     new InstructionKey(id))).get().isPresent();
         } catch (InterruptedException | ExecutionException e) {
             return false;