From cdca195585725e78f0837848fda2b60f5b98ab6f Mon Sep 17 00:00:00 2001 From: Devin Lim Date: Wed, 28 Mar 2018 18:13:33 -0700 Subject: [PATCH] [ONOS-7565] Flow rules error while rerouting intents with Flow Objectives Change-Id: I785e2e82cabda23b07816e572ccfde4bed45a3f2 --- .../onosproject/store/flow/impl/ECFlowRuleStore.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/store/dist/src/main/java/org/onosproject/store/flow/impl/ECFlowRuleStore.java b/core/store/dist/src/main/java/org/onosproject/store/flow/impl/ECFlowRuleStore.java index 108f3800dd..f998dadfe3 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/flow/impl/ECFlowRuleStore.java +++ b/core/store/dist/src/main/java/org/onosproject/store/flow/impl/ECFlowRuleStore.java @@ -837,11 +837,11 @@ public class ECFlowRuleStore } public void add(FlowEntry rule) { - StoredFlowEntry stored = getFlowEntriesInternal(rule.deviceId(), rule.id()) - .putIfAbsent((StoredFlowEntry) rule, (StoredFlowEntry) rule); - if (stored == null) { - lastUpdateTimes.put(rule.deviceId(), System.currentTimeMillis()); - } + getFlowEntriesInternal(rule.deviceId(), rule.id()) + .compute((StoredFlowEntry) rule, (k, stored) -> { + return (StoredFlowEntry) rule; + }); + lastUpdateTimes.put(rule.deviceId(), System.currentTimeMillis()); } public void update(FlowEntry rule) {