Sonar majior issues 00/76100/1
authorSurendra Reddy Katam <SK00524980@techmahindra.com>
Tue, 22 Jan 2019 07:17:47 +0000 (12:47 +0530)
committerSurendra Reddy Katam <SK00524980@techmahindra.com>
Tue, 22 Jan 2019 07:17:47 +0000 (12:47 +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-MbPA32hFUzlqc5WY&resolved=false&severities=MAJOR
Location:
src/main/java/org/onap/dmaap/mr/client/MRClientBuilders.java
Line No-152

Change-Id: I8e64ecb3f88df3e042f3c3cad249bb903ee24f95
Issue-ID: DMAAP-983
Signed-off-by: Surendra Reddy Katam <SK00524980@techmahindra.com>
src/main/java/org/onap/dmaap/mr/client/MRClientBuilders.java

index 60e0666..2c3101b 100644 (file)
@@ -149,7 +149,7 @@ public class MRClientBuilders
          */
         public MRConsumer build ()
         {
-            if ( fHosts == null || fHosts.size() == 0 || fTopic == null )
+            if ( fHosts == null || fHosts.isEmpty() || fTopic == null )
             {
                 throw new IllegalArgumentException ( "You must provide at least one host and a topic name." );
             }