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>
public void treatNotification(INotificationData iNotif) {\r
CsarHandler csar = null;\r
try {\r
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
logger.info("Notification received for service UUID:" + iNotif.getServiceUUID());\r
this.changeControllerStatus(SdcSingleControllerStatus.BUSY);\r
csar = new CsarHandler(iNotif, this.sdcConfig.getSdcControllerName(),\r
e.getMessage(), System.currentTimeMillis());\r
} catch (InterruptedException e) {\r
logger.error("Interrupt exception caught during the notification processing", e);\r
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
} catch (RuntimeException e) {\r
logger.error("Unexpected exception caught during the notification processing", e);\r
} finally {\r