aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2018-12-17 22:52:05 +0000
committerGerrit Code Review <gerrit@onap.org>2018-12-17 22:52:05 +0000
commit78977cb577e3b0c2d392da41c63f3955c5e3173a (patch)
treef5d665d2b3f1f4bd545398d93a83082d81ebb22d
parent34875a704191654c224966deb0f99968e76ba429 (diff)
parent0290fe64a150cab9b7ddfad5ae524716411d40a5 (diff)
Merge "Sonar Fix: SdncAaiDmaapConsumer.java"
-rw-r--r--dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java
index 3733fa60..5cf36940 100644
--- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java
+++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
+ * Modifications Copyright © 2018 IBM.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -128,13 +129,13 @@ public class SdncAaiDmaapConsumer extends SdncDmaapConsumerImpl {
JSONObject eventHeader = jsonObj.getJSONObject(EVENT_HEADER);
for(Object key : eventHeader.keySet())
{
- if (!key.equals("action")) {
+ if (!("action").equals(key)) {
context.put(((String)key).replaceAll("-", ""), eventHeader.get((String)key));
} else {
String action = (String) eventHeader.get((String) key);
- if (action.equalsIgnoreCase("create")) {
+ if (("create").equalsIgnoreCase(action)) {
context.put((String)key,"Update");
- } else if (action.equalsIgnoreCase("delete")) {
+ } else if (("delete").equalsIgnoreCase(action)) {
context.put((String) key, "Delete");
} else {
throw new IOException("Action type not supported " + action);
@@ -202,7 +203,7 @@ public class SdncAaiDmaapConsumer extends SdncDmaapConsumerImpl {
JsonNode eventTypeNode = eventHeaderNode.get(EVENT_TYPE);
String eventType = eventTypeNode.textValue();
- if(AAI_EVENT.equals(eventType) == false) {
+ if(!AAI_EVENT.equals(eventType)) {
LOG.info("Unknown Event Type {}", eventType);
return;
}