summaryrefslogtreecommitdiffstats
path: root/dmaap-listener
diff options
context:
space:
mode:
authorsurya-huawei <a.u.surya@huawei.com>2017-09-19 15:32:16 +0530
committersurya-huawei <a.u.surya@huawei.com>2017-09-19 15:34:31 +0530
commitbb315ff0cce96b31f8e741b3af0981a011e66095 (patch)
tree3319b55d46044d80ff40ec7f0cf2b7c6abcc7e5e /dmaap-listener
parent298d795205068f9ba7ce548a09bec474b8375270 (diff)
Fix Sonar Issues
few major issues in sli/northbound *Remove unused imports *Iterate over the "entrySet" instead of the "keySet" *Replace the type specification with the diamond operator ("<>") Issue-Id: CCSDK-87 Signed-off-by: surya-huawei <a.u.surya@huawei.com> Change-Id: Ib2a6f97d3de759b937c1e2acd2e39312e88ad10b
Diffstat (limited to 'dmaap-listener')
-rw-r--r--dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java22
1 files changed, 5 insertions, 17 deletions
diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java
index 1754957da..a3d70c8d9 100644
--- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java
+++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java
@@ -22,24 +22,12 @@
package org.onap.ccsdk.sli.northbound.dmaapclient;
import java.io.BufferedReader;
-import java.io.DataOutputStream;
import java.io.File;
import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.Authenticator;
-import java.net.HttpURLConnection;
-import java.net.PasswordAuthentication;
-import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLSession;
-
-import org.apache.commons.codec.binary.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -108,14 +96,14 @@ public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer {
ObjectNode inputNode = oMapper.createObjectNode();
- for (String fromField : fieldMap.keySet()) {
+ for (Map.Entry<String, String> entry: fieldMap.entrySet()) {
- if (!SDNC_ENDPOINT.equals(fromField)) {
- JsonNode curNode = instarRootNode.get(fromField);
+ if (!SDNC_ENDPOINT.equals(entry.getKey())) {
+ JsonNode curNode = instarRootNode.get(entry.getKey());
if (curNode != null) {
String fromValue = curNode.textValue();
- inputNode.put(fieldMap.get(fromField), fromValue);
+ inputNode.put(entry.getValue(), fromValue);
}
}
}
@@ -141,7 +129,7 @@ public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer {
}
private Map<String,String> loadMap(String msgType, String mapDirName) {
- Map<String, String> results = new HashMap<String, String>();
+ Map<String, String> results = new HashMap<>();
if (mapDirName == null) {