From a459bd158fe210efc8558be79165821ab6fcbee8 Mon Sep 17 00:00:00 2001 From: Surendra Reddy Katam Date: Thu, 29 Mar 2018 10:37:53 +0530 Subject: Sonar major 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-MbQb32hFUzlqc5Zl&resolved=false&severities=MAJOR Location: src/main/java/com/att/nsa/mr/client/impl/MRBatchPublisher.java Line No-161 Change-Id: I19a085d5a602005807c56d75e2b5327050b311b2 Issue-ID: DMAAP-161 Signed-off-by: Surendra Reddy Katam --- src/main/java/com/att/nsa/mr/client/impl/MRBatchPublisher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/att/nsa/mr/client/impl/MRBatchPublisher.java b/src/main/java/com/att/nsa/mr/client/impl/MRBatchPublisher.java index 02c3c69..1310986 100644 --- a/src/main/java/com/att/nsa/mr/client/impl/MRBatchPublisher.java +++ b/src/main/java/com/att/nsa/mr/client/impl/MRBatchPublisher.java @@ -158,7 +158,7 @@ public class MRBatchPublisher implements MRBatchingPublisher try { final List remains = close ( Long.MAX_VALUE, TimeUnit.MILLISECONDS ); - if ( remains.size() > 0 ) + if ( remains.isEmpty() ) { fLog.warn ( "Closing publisher with " + remains.size() + " messages unsent. " + "(Consider using the alternate close method to capture unsent messages in this case.)" ); -- cgit 1.2.3-korg