mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-24 13:51:27 +02:00
ONOS-2626: Make a immutable copy of multimap before iterating over it
Change-Id: I04cddc4fb9a007920783e44b62143d5d2c0553ba
This commit is contained in:
parent
05b169deab
commit
d33b07736a
@ -50,6 +50,7 @@ import org.onosproject.store.service.StorageService;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.ImmutableMultimap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Multimaps;
|
||||
import com.google.common.collect.SetMultimap;
|
||||
@ -174,7 +175,8 @@ public class ECHostStore
|
||||
|
||||
@Override
|
||||
public Set<Host> getConnectedHosts(DeviceId deviceId) {
|
||||
return locations.entries()
|
||||
return ImmutableMultimap.copyOf(locations)
|
||||
.entries()
|
||||
.stream()
|
||||
.filter(entry -> entry.getKey().deviceId().equals(deviceId))
|
||||
.map(entry -> entry.getValue())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user