mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-15 09:21:06 +02:00
Fix ConcurrentModificationException
Change-Id: Ie4c3a56312156ded1cbc2fd8a0e4da822ff57205
This commit is contained in:
parent
6a7d3677f2
commit
f2f8ef043b
@ -463,9 +463,12 @@ public class DeviceConfiguration implements DeviceProperties {
|
|||||||
*/
|
*/
|
||||||
public Set<IpPrefix> getSubnets(DeviceId deviceId) {
|
public Set<IpPrefix> getSubnets(DeviceId deviceId) {
|
||||||
SegmentRouterInfo srinfo = deviceConfigMap.get(deviceId);
|
SegmentRouterInfo srinfo = deviceConfigMap.get(deviceId);
|
||||||
if (srinfo != null) {
|
if (srinfo != null && srinfo.subnets != null) {
|
||||||
|
// Note: ImmutableSet.Builder.addAll calls the iterator of parameter internally,
|
||||||
|
// which is not protected by SynchronizedCollection mutex.
|
||||||
ImmutableSet.Builder<IpPrefix> builder = ImmutableSet.builder();
|
ImmutableSet.Builder<IpPrefix> builder = ImmutableSet.builder();
|
||||||
return builder.addAll(srinfo.subnets.values()).build();
|
srinfo.subnets.forEach((k, v) -> builder.add(v));
|
||||||
|
return builder.build();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user