aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-04-12 15:28:59 +0200
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-04-12 15:28:59 +0200
commitc322f5b44ef208ebf8d72bf8e710b2d7881cac2f (patch)
tree41d14c85492c4807bb5b66726a7b7de028cb9bc1 /src/main/java/org
parent0c8c6ff37abb1080fec59ee2558689c312a953a1 (diff)
Fix sonar
Fix sonar bugs reported in the new code Issue-ID: CLAMP-147 Change-Id: I77d686ddfd561f260aeb52f82085b73e3e1f1249 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java b/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java
index a62960440..21deb649b 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java
@@ -200,10 +200,10 @@ public class SdcSingleController {
public void treatNotification(INotificationData iNotif) {
CsarHandler csar = null;
try {
- // wait for a random time, so that 2 running Clamp will not treat the same Notification at the same time
- int i = ThreadLocalRandom.current().nextInt(1, 5);
- Thread.sleep(i * 1000);
-
+ // wait for a random time, so that 2 running Clamp will not treat
+ // the same Notification at the same time
+ long i = ThreadLocalRandom.current().nextInt(1, 5);
+ Thread.sleep(i * 1000L);
logger.info("Notification received for service UUID:" + iNotif.getServiceUUID());
this.changeControllerStatus(SdcSingleControllerStatus.BUSY);
csar = new CsarHandler(iNotif, this.sdcConfig.getSdcControllerName(),
@@ -247,6 +247,7 @@ public class SdcSingleController {
e.getMessage(), System.currentTimeMillis());
} catch (InterruptedException e) {
logger.error("Interrupt exception caught during the notification processing", e);
+ Thread.currentThread().interrupt();
} catch (RuntimeException e) {
logger.error("Unexpected exception caught during the notification processing", e);
} finally {