summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArindam Mondal <arind.mondal@samsung.com>2018-07-10 15:11:38 +0900
committerONAP <arind.mondal@samsung.com>2018-07-10 15:39:58 +0900
commit16ecee44bc14dcb0a128cfdabf0ae8b17f1db057 (patch)
tree24c8d7336bdbcf6dc4212a95b633590df9585fd1
parentb13fc8a9b134c43a437d7a48ceb509295df4713a (diff)
Sonar issue fix blocker, critical
Issue-ID: CCSDK-332 Change-Id: I8741cb5bf68d71f0376105d2b1683ac05534a001 Signed-off-by: Arindam Mondal <arind.mondal@samsung.com>
-rw-r--r--dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java1
-rw-r--r--dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java1
-rw-r--r--ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java6
3 files changed, 4 insertions, 4 deletions
diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java
index 13146e4e..c02ec5df 100644
--- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java
+++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java
@@ -97,6 +97,7 @@ public class MessageRouterHttpClient implements SdncDmaapConsumer {
Thread.sleep(fetchPause);
} catch (InterruptedException e) {
Log.error("Could not sleep thread", e);
+ Thread.currentThread().interrupt();
}
}
}
diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java
index 3336b81f..a6744045 100644
--- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java
+++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java
@@ -111,6 +111,7 @@ public class MessageRouterHttpClientJdk implements SdncDmaapConsumer {
Thread.sleep(fetchPause);
} catch (InterruptedException e) {
Log.error("Could not sleep thread", e);
+ Thread.currentThread().interrupt();
}
}
}
diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java
index 8ea041e6..4ae5acd9 100644
--- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java
+++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java
@@ -399,8 +399,7 @@ public class SdncUebCallback implements INotificationCallback {
// Save zip if TOSCA_CSAR
if (artifact.getArtifactType().contains("TOSCA_CSAR") || artifact.getArtifactName().contains(".csar")) {
- try {
- FileOutputStream outFile = new FileOutputStream(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName());
+ try(FileOutputStream outFile = new FileOutputStream(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName())) {
outFile.write(payloadBytes, 0, payloadBytes.length);
outFile.close();
writeSucceeded = true;
@@ -411,8 +410,7 @@ public class SdncUebCallback implements INotificationCallback {
} else {
String payload = new String(payloadBytes);
- try {
- FileWriter spoolFileWriter = new FileWriter(spoolFile);
+ try(FileWriter spoolFileWriter = new FileWriter(spoolFile)) {
spoolFileWriter.write(payload);
spoolFileWriter.close();
writeSucceeded = true;