Cleanup deprecation warnings in bgp/extensions/labeled-unicast 86/90786/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 27 Jun 2020 13:24:55 +0000 (15:24 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 27 Jun 2020 13:24:55 +0000 (15:24 +0200)
Eliminate some leftovers from codegen change.

Change-Id: I4599e8239c49e5b7d9c1f9643e7a14f58080e923
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/extensions/labeled-unicast/src/main/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv4RIBSupport.java
bgp/extensions/labeled-unicast/src/main/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv6RIBSupport.java
bgp/extensions/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LUNlriParserTest.java
bgp/extensions/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv4RIBSupportTest.java
bgp/extensions/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv6RIBSupportTest.java

index 1ec70877404db216f5087f882b246cf8bc137a0b..3a76dfb14f2396384160dde2491bc623dac6b48a 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.protocol.bgp.labeled.unicast;
 import static com.google.common.base.Verify.verify;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Map;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
@@ -33,8 +32,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 
 public final class LabeledUnicastIpv4RIBSupport
         extends AbstractLabeledUnicastRIBSupport<LabeledUnicastRoutesCase, LabeledUnicastRoutes> {
-    private static final LabeledUnicastRoutes EMPTY_CONTAINER
-            = new LabeledUnicastRoutesBuilder().setLabeledUnicastRoute(Collections.emptyList()).build();
+    private static final LabeledUnicastRoutes EMPTY_CONTAINER = new LabeledUnicastRoutesBuilder().build();
     private static LabeledUnicastIpv4RIBSupport SINGLETON;
 
     private LabeledUnicastIpv4RIBSupport(final BindingNormalizedNodeSerializer mappingService) {
index 2733c1bb1aafbf8d78a42be77377d800ef21a2a3..52056246d115ee5048413263ddfb13f0a7d776ff 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.protocol.bgp.labeled.unicast;
 import static com.google.common.base.Verify.verify;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Map;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
@@ -32,9 +31,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 
 final class LabeledUnicastIpv6RIBSupport
         extends AbstractLabeledUnicastRIBSupport<LabeledUnicastIpv6RoutesCase, LabeledUnicastIpv6Routes> {
-
-    private static final LabeledUnicastIpv6Routes EMPTY_CONTAINER
-            = new LabeledUnicastIpv6RoutesBuilder().setLabeledUnicastRoute(Collections.emptyList()).build();
+    private static final LabeledUnicastIpv6Routes EMPTY_CONTAINER = new LabeledUnicastIpv6RoutesBuilder().build();
     private static LabeledUnicastIpv6RIBSupport SINGLETON;
 
     private LabeledUnicastIpv6RIBSupport(final BindingNormalizedNodeSerializer mappingService) {
index 52cfd04bfa48616a449c4ace450bef544399801e..d3f2ee7d16ab0f473a1d4ef013e7205782529286 100644 (file)
@@ -38,9 +38,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labe
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.labeled.unicast._case.DestinationLabeledUnicastBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.PathId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.AttributesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.Attributes1;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.Attributes1Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.Attributes2;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.Attributes2Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.MpReachNlri;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.MpReachNlriBuilder;
@@ -257,8 +255,9 @@ public class LUNlriParserTest {
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class,
-            new Attributes1Builder().setMpReachNlri(mpReachExpected).build()).build(), output);
+        parser.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes1Builder().setMpReachNlri(mpReachExpected).build())
+            .build(), output);
         assertArrayEquals(LU_REACH_NLRI_IPV4, ByteArray.readAllBytes(output));
     }
 
@@ -285,8 +284,9 @@ public class LUNlriParserTest {
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class,
-            new Attributes1Builder().setMpReachNlri(mpReachExpected).build()).build(), output);
+        parser.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes1Builder().setMpReachNlri(mpReachExpected).build())
+            .build(), output);
         assertArrayEquals(LU_REACH_NLRI_IPV4_ADD_PATH, ByteArray.readAllBytes(output));
     }
 
@@ -329,13 +329,15 @@ public class LUNlriParserTest {
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
-            new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build()).build(), output);
+        parser.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build())
+            .build(), output);
         assertArrayEquals(LU_UNREACH_NLRI_IPV4, ByteArray.readAllBytes(output));
 
         final ByteBuf output1 = Unpooled.buffer();
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
-            new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected1).build()).build(), output1);
+        parser.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected1).build())
+            .build(), output1);
         assertArrayEquals(LU_UNREACH_NLRI_IPV4, ByteArray.readAllBytes(output1));
     }
 
@@ -379,13 +381,15 @@ public class LUNlriParserTest {
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
-            new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build()).build(), output);
+        parser.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build())
+            .build(), output);
         assertArrayEquals(LU_UNREACH_NLRI_IPV4_ADD_PATH, ByteArray.readAllBytes(output));
 
         final ByteBuf output1 = Unpooled.buffer();
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
-            new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected1).build()).build(), output1);
+        parser.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected1).build())
+            .build(), output1);
         assertArrayEquals(LU_UNREACH_NLRI_IPV4_ADD_PATH, ByteArray.readAllBytes(output1));
     }
 
@@ -413,8 +417,9 @@ public class LUNlriParserTest {
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class,
-            new Attributes1Builder().setMpReachNlri(mpReachExpected).build()).build(), output);
+        parser.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes1Builder().setMpReachNlri(mpReachExpected).build())
+            .build(), output);
         assertArrayEquals(LU_REACH_NLRI_IPV6, ByteArray.readAllBytes(output));
     }
 
@@ -442,8 +447,9 @@ public class LUNlriParserTest {
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class,
-            new Attributes1Builder().setMpReachNlri(mpReachExpected).build()).build(), output);
+        parser.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes1Builder().setMpReachNlri(mpReachExpected).build())
+            .build(), output);
         assertArrayEquals(LU_REACH_NLRI_IPV6_ADD_PATH, ByteArray.readAllBytes(output));
     }
 
@@ -484,13 +490,15 @@ public class LUNlriParserTest {
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
-            new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build()).build(), output);
+        parser.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build())
+            .build(), output);
         assertArrayEquals(LU_UNREACH_NLRI_IPV6, ByteArray.readAllBytes(output));
 
         final ByteBuf output1 = Unpooled.buffer();
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
-            new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected1).build()).build(), output1);
+        parser.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected1).build())
+            .build(), output1);
         assertArrayEquals(LU_UNREACH_NLRI_IPV6, ByteArray.readAllBytes(output1));
     }
 
@@ -533,13 +541,15 @@ public class LUNlriParserTest {
 
         //test serializer
         final ByteBuf output = Unpooled.buffer();
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
-            new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build()).build(), output);
+        parser.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build())
+            .build(), output);
         assertArrayEquals(LU_UNREACH_NLRI_IPV6_ADD_PATH, ByteArray.readAllBytes(output));
 
         final ByteBuf output1 = Unpooled.buffer();
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
-            new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected1).build()).build(), output1);
+        parser.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected1).build())
+            .build(), output1);
         assertArrayEquals(LU_UNREACH_NLRI_IPV6_ADD_PATH, ByteArray.readAllBytes(output1));
     }
 }
index 707e458ff58073509b9bfc7a8ccd4be9003c6fef..0413dddd1e04dd8d6c2966e043ca8a8e8edc41f8 100644 (file)
@@ -17,6 +17,7 @@ import io.netty.buffer.Unpooled;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
@@ -94,7 +95,7 @@ public class LabeledUnicastIpv4RIBSupportTest extends AbstractRIBSupportTest<Lab
                 .setPathId(PATH_ID)
                 .setLabelStack(LABEL_STACK)
                 .setAttributes(new AttributesBuilder().build()).build();
-        ROUTES = new LabeledUnicastRoutesBuilder().setLabeledUnicastRoute(Collections.singletonList(ROUTE)).build();
+        ROUTES = new LabeledUnicastRoutesBuilder().setLabeledUnicastRoute(Map.of(ROUTE.key(), ROUTE)).build();
     }
 
     private LabeledUnicastIpv4RIBSupport ribSupport;
index 66b61be63d508768acbf073f41c4dfdbdf23ff70..3b4176e5ef708a11479629321b271fcc02219db7 100644 (file)
@@ -17,6 +17,7 @@ import io.netty.buffer.Unpooled;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
@@ -94,7 +95,7 @@ public class LabeledUnicastIpv6RIBSupportTest extends AbstractRIBSupportTest<Lab
         ROUTE = new LabeledUnicastRouteBuilder().withKey(ROUTE_KEY)
                 .setPrefix(IPV6_PREFIX).setPathId(PATH_ID).setLabelStack(LABEL_STACK)
             .setAttributes(new AttributesBuilder().build()).build();
-        ROUTES = new LabeledUnicastIpv6RoutesBuilder().setLabeledUnicastRoute(Collections.singletonList(ROUTE)).build();
+        ROUTES = new LabeledUnicastIpv6RoutesBuilder().setLabeledUnicastRoute(Map.of(ROUTE.key(), ROUTE)).build();
     }
 
     @Override