Sonar major issues 11/39611/1
authorSurendra Reddy Katam <SK00524980@techmahindra.com>
Wed, 28 Mar 2018 11:05:10 +0000 (16:35 +0530)
committerSurendra Reddy Katam <SK00524980@techmahindra.com>
Wed, 28 Mar 2018 11:05:10 +0000 (16:35 +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-MbQb32hFUzlqc5Zn&resolved=false&severities=MAJOR
Location:
src/main/java/com/att/nsa/mr/client/impl/MRBatchPublisher.java
Line No-416

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

index cf42907..02c3c69 100644 (file)
@@ -413,7 +413,7 @@ public class MRBatchPublisher implements MRBatchingPublisher
        private static boolean doSend ( LinkedList<TimestampedMessage> toSend, HttpClient client, String topic, boolean compress, Logger log )
        {
                // it's possible for this call to be made with an empty list. in this case, just return.
-               if ( toSend.size() < 1 )
+               if ( toSend.isEmpty()  )
                {
                        return true;
                }