From bf9c3366bee0400d6ee4c9d7de3fb2613afc445e Mon Sep 17 00:00:00 2001 From: Surendra Reddy Katam Date: Mon, 13 Aug 2018 11:22:11 +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-MbRu32hFUzlqc5eg&resolved=false&severities=MAJOR Location: src/main/java/com/att/nsa/mr/client/impl/MRSimplerBatchPublisher.java Line No-180 Change-Id: I7f191d42a87ba5e70005ad282d3d8bbda71998f4 Issue-ID: DMAAP-584 Signed-off-by: Surendra Reddy Katam --- src/main/java/com/att/nsa/mr/client/impl/MRSimplerBatchPublisher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/att/nsa/mr/client/impl/MRSimplerBatchPublisher.java b/src/main/java/com/att/nsa/mr/client/impl/MRSimplerBatchPublisher.java index 5bb5087..991c0e4 100644 --- a/src/main/java/com/att/nsa/mr/client/impl/MRSimplerBatchPublisher.java +++ b/src/main/java/com/att/nsa/mr/client/impl/MRSimplerBatchPublisher.java @@ -177,7 +177,7 @@ public class MRSimplerBatchPublisher extends MRBaseClient implements MRBatchingP public void close() { try { final List remains = close(Long.MAX_VALUE, TimeUnit.MILLISECONDS); - if (remains.size() > 0) { + if (remains.isEmpty()) { getLog().warn("Closing publisher with " + remains.size() + " messages unsent. " + "Consider using MRBatchingPublisher.close( long timeout, TimeUnit timeoutUnits ) to recapture unsent messages on close."); } -- cgit 1.2.3-korg