Sonar major issues 37/39037/1
authorSurendra Reddy Katam <SK00524980@techmahindra.com>
Tue, 27 Mar 2018 10:43:58 +0000 (16:13 +0530)
committerSurendra Reddy Katam <SK00524980@techmahindra.com>
Tue, 27 Mar 2018 10:43:58 +0000 (16:13 +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-MbPA32hFUzlqc5Wa&resolved=false&severities=MAJOR
Location:
src/main/java/com/att/nsa/mr/client/MRClientBuilders.java
Line-No:365

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

index 00c8915..177fd30 100644 (file)
@@ -362,7 +362,7 @@ public class MRClientBuilders
                 */
                public T build ()
                {
-                       if ( fHosts == null || fHosts.size() == 0 )
+                        if ( fHosts.isEmpty() ) 
                        {
                                throw new IllegalArgumentException ( "You must provide at least one host and a topic name." );
                        }