Point to snapshot versions
[policy/models.git] / models-interactions / model-actors / actorServiceProvider / src / main / java / org / onap / policy / controlloop / actorserviceprovider / controlloop / ControlLoopEventContext.java
index 3e02da6..f7b58c1 100644 (file)
@@ -116,6 +116,14 @@ public class ControlLoopEventContext implements Serializable {
         properties.put(name, value);
     }
 
+    /**
+     * Removes a property.
+     * @param name property name
+     */
+    public void removeProperty(String name) {
+        properties.remove(name);
+    }
+
     /**
      * Obtains the given property.
      *
@@ -137,7 +145,7 @@ public class ControlLoopEventContext implements Serializable {
 
         // @formatter:off
         CompletableFuture<OperationOutcome> oldFuture =
-            retrievers.compute(name, (key, future) -> (future == null || future.isCancelled() ? null : future));
+            retrievers.computeIfPresent(name, (key, future) -> future.isCancelled() ? null : future);
         // @formatter:on
 
         if (oldFuture != null) {