Fix sonar
[clamp.git] / src / main / java / org / onap / clamp / clds / sdc / controller / SdcSingleController.java
index a629604..21deb64 100644 (file)
@@ -200,10 +200,10 @@ public class SdcSingleController {
     public void treatNotification(INotificationData iNotif) {\r
         CsarHandler csar = null;\r
         try {\r
-            // wait for a random time, so that 2 running Clamp will not treat the same Notification at the same time \r
-            int i = ThreadLocalRandom.current().nextInt(1, 5);\r
-            Thread.sleep(i * 1000);\r
-\r
+            // wait for a random time, so that 2 running Clamp will not treat\r
+            // the same Notification at the same time\r
+            long i = ThreadLocalRandom.current().nextInt(1, 5);\r
+            Thread.sleep(i * 1000L);\r
             logger.info("Notification received for service UUID:" + iNotif.getServiceUUID());\r
             this.changeControllerStatus(SdcSingleControllerStatus.BUSY);\r
             csar = new CsarHandler(iNotif, this.sdcConfig.getSdcControllerName(),\r
@@ -247,6 +247,7 @@ public class SdcSingleController {
                     e.getMessage(), System.currentTimeMillis());\r
         } catch (InterruptedException e) {\r
             logger.error("Interrupt exception caught during the notification processing", e);\r
+            Thread.currentThread().interrupt();\r
         } catch (RuntimeException e) {\r
             logger.error("Unexpected exception caught during the notification processing", e);\r
         } finally {\r