diff options
author | 2018-09-28 12:40:15 -0700 | |
---|---|---|
committer | 2018-09-29 17:26:00 -0700 | |
commit | 480e77e15e0da305d10374d12ad5e999f64f797d (patch) | |
tree | fa887f60da8b834f0335649ae660f2eb223b331c /holmes-actions/src/main/java/org/onap | |
parent | d00f96d02f8f44ca0fe84a1a38c726edf80128ce (diff) |
Fix String compare
Issue-ID: HOLMES-172
Change-Id: Ie49b1088cb04dbf94b83830224bcd7464870e001
Signed-off-by: Guobiao Mo <guobiaomo@chinamobile.com>
Diffstat (limited to 'holmes-actions/src/main/java/org/onap')
-rw-r--r-- | holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java index f19b89c..db57f3c 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java @@ -15,6 +15,7 @@ */ package org.onap.holmes.common.dmaap; +import java.util.Map.Entry; import java.util.Optional; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; @@ -186,12 +187,13 @@ public class DmaapService { } private void deleteRequestId(PolicyMsg policyMsg){ - String status = policyMsg.getClosedLoopEventStatus().toString(); - if(status == "ABATED"){ + EVENT_STATUS status = policyMsg.getClosedLoopEventStatus(); + if(EVENT_STATUS.ABATED.equals(status)) { String requestId = policyMsg.getRequestID(); - for(String key: alarmUniqueRequestID.keySet()){ - if(alarmUniqueRequestID.get(key).equals(requestId)){ - alarmUniqueRequestID.remove(key); + for(Entry<String, String> kv: alarmUniqueRequestID.entrySet()) { + if(kv.getValue().equals(requestId)) { + alarmUniqueRequestID.remove(kv.getKey()); + break; } } log.info("Clear alarm, requestId deleted successful"); |