summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java3
-rw-r--r--dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java12
-rw-r--r--ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java4
3 files changed, 9 insertions, 10 deletions
diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java
index ed71337a3..2b416e7db 100644
--- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java
+++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java
@@ -35,7 +35,6 @@ public abstract class SdncDmaapConsumer implements Runnable {
private static final Logger LOG = LoggerFactory
.getLogger(SdncDmaapConsumer.class);
- private String propertiesPath = "";
private Properties properties = null;
private MRConsumer consumer = null;
private MRConsumerResponse consumerResponse = null;
@@ -66,8 +65,6 @@ public abstract class SdncDmaapConsumer implements Runnable {
public void init(Properties properties, String propertiesPath) {
- this.propertiesPath = propertiesPath;
-
try (FileInputStream in = new FileInputStream(new File(propertiesPath))) {
LOG.debug("propertiesPath: " + propertiesPath);
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 1d499a1e7..06e8ebe95 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
@@ -124,6 +124,8 @@ public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer {
private Map<String, String> loadMap(String msgType, String mapDirName) {
Map<String, String> results = new HashMap<>();
+ String dirName = mapDirName;
+
if (mapDirName == null) {
String rootdir = System.getenv(DMAAPLISTENERROOT);
@@ -131,16 +133,16 @@ public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer {
rootdir = "/opt/app/dmaap-listener";
}
- mapDirName = rootdir + "/lib";
+ dirName = rootdir + "/lib";
}
- String mapFilename = mapDirName + "/" + msgType + ".map";
+ String mapFilename = dirName + "/" + msgType + ".map";
File mapFile = new File(mapFilename);
if (!mapFile.canRead()) {
LOG.error(String.format("Cannot read map file (%s)", mapFilename));
- return (null);
+ return null;
}
try (BufferedReader mapReader = new BufferedReader(new FileReader(mapFile))) {
@@ -160,9 +162,9 @@ public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer {
mapReader.close();
} catch (Exception e) {
LOG.error("Caught exception reading map " + mapFilename, e);
- return (null);
+ return null;
}
- return (results);
+ return results;
}
}
diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java
index a2556b4ba..78d9c5bc9 100644
--- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java
+++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java
@@ -137,7 +137,7 @@ public class SdncOdlConnection {
respRdr = new BufferedReader(new InputStreamReader(httpConn.getErrorStream()));
}
- StringBuffer respBuff = new StringBuffer();
+ StringBuilder respBuff = new StringBuilder();
String respLn;
@@ -150,7 +150,7 @@ public class SdncOdlConnection {
LOG.info("Response body :\n" + respString);
- return (respString);
+ return respString;
}