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>
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;