Sonar major issues 09/59609/1
authorSurendra Reddy Katam <SK00524980@techmahindra.com>
Wed, 8 Aug 2018 07:17:14 +0000 (12:47 +0530)
committerSurendra Reddy Katam <SK00524980@techmahindra.com>
Wed, 8 Aug 2018 07:32:19 +0000 (13:02 +0530)
 Use isEmpty() to check whether the collection is empty or not
Sonar Link:
https://sonar.onap.org/project/issues?assignees=surendraReddy&id=org.onap.dmaap.messagerouter.dmaapclient%3AdmaapClient&open=AV4-MbOi32hFUzlqc5Vg&resolved=false&severities=MAJOR
Location:
src/main/java/com/att/nsa/mr/client/HostSelector.java
Line No-130

Change-Id: Iab107c06d9463f42d34d98fff1073b4a358f7681
Issue-ID: DMAAP-567"
Signed-off-by: Surendra Reddy Katam <SK00524980@techmahindra.com>
src/main/java/com/att/nsa/mr/client/HostSelector.java

index 0dba1e7..63ef404 100644 (file)
@@ -127,7 +127,7 @@ public class HostSelector
       workingSet.remove(be.getHost());
     }
 
-    if (workingSet.size() == 0)
+    if (workingSet.isEmpty())
     {
       log.warn("All hosts were blacklisted; reverting to full set of hosts.");
       workingSet.addAll(this.fBaseHosts);