Cleanup deprecation warnings in bgp/extensions/evpn 81/90781/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 27 Jun 2020 09:17:06 +0000 (11:17 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 27 Jun 2020 09:17:06 +0000 (11:17 +0200)
Eliminate some leftovers from codegen change.

Change-Id: I10a6898e73e85c8f7d1564651b90566237e231d1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/extensions/evpn/src/main/java/org/opendaylight/protocol/bgp/evpn/impl/EvpnRibSupport.java
bgp/extensions/evpn/src/test/java/org/opendaylight/protocol/bgp/evpn/impl/EvpnRibSupportTest.java
bgp/extensions/evpn/src/test/java/org/opendaylight/protocol/bgp/evpn/impl/nlri/EvpnNlriAttributesParserTest.java

index 2a6589cf4ad5d7f4415aab389ec5e332d53b77d7..89dc2a38630bf405bc5af38608ea2396825799e0 100644 (file)
@@ -56,8 +56,7 @@ final class EvpnRibSupport extends AbstractRIBSupport<EvpnRoutesCase, EvpnRoutes
     private static final Logger LOG = LoggerFactory.getLogger(EvpnRibSupport.class);
 
     private static final NodeIdentifier NLRI_ROUTES_LIST = NodeIdentifier.create(EvpnDestination.QNAME);
-    private static final EvpnRoutes EMPTY_CONTAINER
-            =  new EvpnRoutesBuilder().setEvpnRoute(Collections.emptyList()).build();
+    private static final EvpnRoutes EMPTY_CONTAINER = new EvpnRoutesBuilder().build();
     private static EvpnRibSupport SINGLETON;
 
     private EvpnRibSupport(final BindingNormalizedNodeSerializer mappingService) {
@@ -117,9 +116,8 @@ final class EvpnRibSupport extends AbstractRIBSupport<EvpnRoutesCase, EvpnRoutes
                         keys.add(routeKey);
                     }
                     return keys;
-                } else {
-                    LOG.warn("Routes {} are not a map", routes);
                 }
+                LOG.warn("Routes {} are not a map", routes);
             }
         }
         return Collections.emptyList();
index 084f72c2400daeae92e84eaf11bbb9b56fc696e8..ec842d859d7751c73c3682ddf9ef386bc8e6cbee 100644 (file)
@@ -19,6 +19,7 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Map;
 import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.protocol.bgp.evpn.impl.nlri.EvpnNlriParser;
@@ -89,7 +90,7 @@ public final class EvpnRibSupportTest extends AbstractRIBSupportTest<EvpnRoutesC
         ROUTE = new EvpnRouteBuilder().setRouteKey(ROUTE_KEY.getRouteKey())
                 .setPathId(ROUTE_KEY.getPathId())
                 .setAttributes(ATTRIBUTES).setRouteDistinguisher(RD).setEvpnChoice(ETHERNET_AD_ROUTE_CASE).build();
-        EVPN_ROUTES = new EvpnRoutesBuilder().setEvpnRoute(Collections.singletonList(ROUTE)).build();
+        EVPN_ROUTES = new EvpnRoutesBuilder().setEvpnRoute(Map.of(ROUTE.key(), ROUTE)).build();
     }
 
 
index f00fdd863bc74ddb4cc518a6f429f728c6cd1f41..3292b6082c2d33b8f00ca3c3a9f8173903fe376a 100644 (file)
@@ -24,9 +24,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.evpn._case.DestinationEvpnBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes;
 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;
@@ -50,8 +48,9 @@ public class EvpnNlriAttributesParserTest {
     @Test
     public void testAttributes1() throws BGPParsingException {
         final ByteBuf buffer = Unpooled.buffer();
-        final Attributes att = new AttributesBuilder().addAugmentation(Attributes1.class,
-            new Attributes1Builder().setMpReachNlri(createReach()).build()).build();
+        final Attributes att = new AttributesBuilder()
+                .addAugmentation(new Attributes1Builder().setMpReachNlri(createReach()).build())
+                .build();
         this.parser.serializeAttribute(att, buffer);
         Assert.assertArrayEquals(IncMultEthTagRParserTest.RESULT, ByteArray.getAllBytes(buffer));
     }
@@ -70,8 +69,9 @@ public class EvpnNlriAttributesParserTest {
     @Test
     public void testAttributes2() throws BGPParsingException {
         final ByteBuf buffer = Unpooled.buffer();
-        final Attributes att = new AttributesBuilder().addAugmentation(Attributes2.class,
-            new Attributes2Builder().setMpUnreachNlri(createUnreach()).build()).build();
+        final Attributes att = new AttributesBuilder()
+                .addAugmentation(new Attributes2Builder().setMpUnreachNlri(createUnreach()).build())
+                .build();
         this.parser.serializeAttribute(att, buffer);
         Assert.assertArrayEquals(IncMultEthTagRParserTest.RESULT, ByteArray.getAllBytes(buffer));
     }