[ONOS-7565] Flow rules error while rerouting intents with Flow Objectives 1.12

Change-Id: Ic16a74b38c9a3c263fae6115ee70ed3790a9d690
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 108f380..f998dad 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 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) {