From 355b66b9d95ff73902fbc43207fa08013776b9c2 Mon Sep 17 00:00:00 2001 From: Surendra Reddy Katam Date: Thu, 16 Aug 2018 12:28:52 +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-MbRu32hFUzlqc5ej&resolved=false&severities=MAJOR Location: src/main/java/com/att/nsa/mr/client/impl/MRSimplerBatchPublisher.java Line No-421 Change-Id: Ie8852caff9e0130aa9b69c4a410bf3949c66713f Issue-ID: DMAAP-604 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(-) 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 741705f..409ee70 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 @@ -418,7 +418,7 @@ public class MRSimplerBatchPublisher extends MRBaseClient implements MRBatchingP public synchronized MRPublisherResponse sendBatchWithResponse() { // it's possible for this call to be made with an empty list. in this // case, just return. - if (fPending.size() < 1) { + if (fPending.isEmpty()) { pubResponse.setResponseCode(String.valueOf(HttpStatus.SC_BAD_REQUEST)); pubResponse.setResponseMessage("No Messages to send"); return pubResponse; -- cgit 1.2.3-korg