Sonar major issues 65/39465/1
authorSurendra Reddy Katam <SK00524980@techmahindra.com>
Wed, 28 Mar 2018 07:08:36 +0000 (12:38 +0530)
committerSurendra Reddy Katam <SK00524980@techmahindra.com>
Wed, 28 Mar 2018 07:08:36 +0000 (12:38 +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-MbPA32hFUzlqc5WZ&resolved=false&severities=MAJOR
Location:
src/main/java/com/att/nsa/mr/client/MRClientBuilders.java
Line No-238

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

index 177fd30..c7707f1 100644 (file)
@@ -235,7 +235,7 @@ public class MRClientBuilders
                 */
                public MRBatchingPublisher 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." );
                        }