Fixed soanr issue in LockHelperImpl.java 92/74792/1
authorezhil <ezhrajam@in.ibm.com>
Tue, 18 Dec 2018 09:56:14 +0000 (15:26 +0530)
committerezhil <ezhrajam@in.ibm.com>
Tue, 18 Dec 2018 09:56:24 +0000 (15:26 +0530)
Fixed major sonar issues
Issue-ID: CCSDK-835
Change-Id: I53375dd95cdcec36f1a97630c9fdc2d9f57d8613
Signed-off-by: ezhil <ezhrajam@in.ibm.com>
resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/comp/LockHelperImpl.java

index 1611b53..0efd897 100644 (file)
@@ -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<String> 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<String> resourceNameList, String lockRequester, int lockTimeout /* Seconds */) {
-        if (resourceNameList == null || resourceNameList.size() == 0) {
+        if (resourceNameList == null || resourceNameList.isEmpty()) {
             return;
         }