Synchronised BiMaps need to have their iterations protected by
explicit synchronisation (see the javadocs); this patch adds a missing
synchronisation in getExistingKey.
Change-Id: I4bea65e06aee26cf2d5e6ebae86f3bedd2dd6fc6
JIRA: OPNFLWPLUG-1013
Signed-off-by: Stephen Kitt <skitt@redhat.com>
return flowRegistryKey;
}
} else {
- for (Map.Entry<FlowRegistryKey, FlowDescriptor> keyValueSet : flowRegistry.entrySet()) {
- if (keyValueSet.getKey().equals(flowRegistryKey)) {
- return keyValueSet.getKey();
+ synchronized (flowRegistry) {
+ for (Map.Entry<FlowRegistryKey, FlowDescriptor> keyValueSet : flowRegistry.entrySet()) {
+ if (keyValueSet.getKey().equals(flowRegistryKey)) {
+ return keyValueSet.getKey();
+ }
}
}
}