From: Surendra Reddy Katam Date: Thu, 16 Aug 2018 06:58:52 +0000 (+0530) Subject: Sonar major issues X-Git-Tag: 1.1.7~11^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=dmaap%2Fmessagerouter%2Fdmaapclient.git;a=commitdiff_plain;h=355b66b9d95ff73902fbc43207fa08013776b9c2 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 --- 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;