From 50a756f026b92c964924437c9cccc73b0554e135 Mon Sep 17 00:00:00 2001 From: ezhil Date: Tue, 18 Dec 2018 15:26:14 +0530 Subject: Fixed soanr issue in LockHelperImpl.java Fixed major sonar issues Issue-ID: CCSDK-835 Change-Id: I53375dd95cdcec36f1a97630c9fdc2d9f57d8613 Signed-off-by: ezhil --- .../java/org/onap/ccsdk/sli/adaptors/lock/comp/LockHelperImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'resource-assignment') diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/comp/LockHelperImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/comp/LockHelperImpl.java index 1611b5372..0efd8977a 100644 --- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/comp/LockHelperImpl.java +++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/comp/LockHelperImpl.java @@ -73,6 +73,7 @@ public class LockHelperImpl implements LockHelper { try { Thread.sleep(lockWait * 1000); } catch (InterruptedException ex) { + log.error("Interrupted Exception", ex); } } } @@ -80,7 +81,7 @@ public class LockHelperImpl implements LockHelper { @Override public void unlock(Collection lockNames, boolean force) { - if (lockNames == null || lockNames.size() == 0) { + if (lockNames == null || lockNames.isEmpty()) { return; } @@ -105,7 +106,7 @@ public class LockHelperImpl implements LockHelper { } public void tryLock(Collection resourceNameList, String lockRequester, int lockTimeout /* Seconds */) { - if (resourceNameList == null || resourceNameList.size() == 0) { + if (resourceNameList == null || resourceNameList.isEmpty()) { return; } -- cgit 1.2.3-korg