Madan Jampani
Committed by Brian O'Connor

Avoid concurrent modification exception by iterating over a immutable collection

Change-Id: Icfffa1347071eb298a25b11ee0511f36002b0675
(cherry picked from commit e81f1cf2)
......@@ -47,7 +47,6 @@ import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.apache.felix.scr.annotations.ReferencePolicy;
import org.apache.felix.scr.annotations.Service;
import org.onosproject.app.ApplicationEvent;
import org.onosproject.app.ApplicationListener;
import org.onosproject.app.ApplicationService;
......@@ -252,7 +251,7 @@ public class DatabaseManager implements StorageService, StorageAdminService {
log.info("Successfully closed databases.");
}
});
maps.values().forEach(this::unregisterMap);
ImmutableList.copyOf(maps.values()).forEach(this::unregisterMap);
if (applicationService != null) {
applicationService.removeListener(appListener);
}
......