Sonar major issues 55/60855/1
authorSurendra Reddy Katam <SK00524980@techmahindra.com>
Thu, 16 Aug 2018 06:58:52 +0000 (12:28 +0530)
committerSurendra Reddy Katam <SK00524980@techmahindra.com>
Thu, 16 Aug 2018 06:58:52 +0000 (12:28 +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-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 <SK00524980@techmahindra.com>
src/main/java/com/att/nsa/mr/client/impl/MRSimplerBatchPublisher.java

index 741705f..409ee70 100644 (file)
@@ -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;