From: Surendra Reddy Katam Date: Tue, 22 Jan 2019 07:17:47 +0000 (+0530) Subject: Sonar majior issues X-Git-Tag: 1.1.10~21 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=dmaap%2Fmessagerouter%2Fdmaapclient.git;a=commitdiff_plain;h=10fa44b0dc843ed19fb78d393a0c373ebfd388ec Sonar majior issues 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 --- diff --git a/src/main/java/org/onap/dmaap/mr/client/MRClientBuilders.java b/src/main/java/org/onap/dmaap/mr/client/MRClientBuilders.java index 60e0666..2c3101b 100644 --- a/src/main/java/org/onap/dmaap/mr/client/MRClientBuilders.java +++ b/src/main/java/org/onap/dmaap/mr/client/MRClientBuilders.java @@ -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." ); }