Duplicate list in resolveAdjacency 92/79992/1
authorStephen Kitt <skitt@redhat.com>
Tue, 29 Jan 2019 15:05:36 +0000 (16:05 +0100)
committerStephen Kitt <skitt@redhat.com>
Tue, 29 Jan 2019 15:05:36 +0000 (16:05 +0100)
BaseVrfEntryHandler::resolveAdjacency sorts the list of route paths,
so we need to ensure that the list is modifiable. This patch does so
by creating a new ArrayList with the list of route paths.

Change-Id: I8612d94e3061f4f3f18a07ebb8e18d954de1cb65
Signed-off-by: Stephen Kitt <skitt@redhat.com>
fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/BaseVrfEntryHandler.java

index 01cdccb6ccf084dc01b7434d14b4146ee11e9503..05b5b1af09ba9043ac4eacdc26fc74c37cc76675 100644 (file)
@@ -158,7 +158,7 @@ public class BaseVrfEntryHandler implements AutoCloseable {
     @Nonnull
     protected List<AdjacencyResult> resolveAdjacency(final BigInteger remoteDpnId, final long vpnId,
                                                      final VrfEntry vrfEntry, String rd) {
-        List<RoutePaths> routePaths = vrfEntry.nonnullRoutePaths();
+        List<RoutePaths> routePaths = new ArrayList<>(vrfEntry.nonnullRoutePaths());
         FibHelper.sortIpAddress(routePaths);
         List<AdjacencyResult> adjacencyList = new ArrayList<>();
         List<String> prefixIpList;