Futures.addCallback(future, new FutureCallback<Optional<FlowCapableNode>>() {
@Override
- public void onSuccess(Optional<FlowCapableNode> result) {
+ public void onSuccess(@Nonnull Optional<FlowCapableNode> result) {
result.asSet().stream()
.filter(Objects::nonNull)
.filter(flowCapableNode -> Objects.nonNull(flowCapableNode.getTable()))
}
private FlowRegistryKey getExistingKey(final FlowRegistryKey flowRegistryKey) {
- if (flowRegistryKey.getMatch().getAugmentation(GeneralAugMatchNodesNodeTableFlow.class) == null) {
+ if (flowRegistryKey.getMatch().augmentation(GeneralAugMatchNodesNodeTableFlow.class) == null) {
if (flowRegistry.containsKey(flowRegistryKey)) {
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();
+ }
}
}
}