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-MbRu32hFUzlqc5ei&resolved=false&severities=MAJOR
Location:
src/main/java/com/att/nsa/mr/client/impl/MRSimplerBatchPublisher.java
Line No-238
Change-Id: I7896ced67ab12816b92fe972322dad4ff4558cf8
Issue-ID: DMAAP-589
Signed-off-by: Surendra Reddy Katam <SK00524980@techmahindra.com>
private synchronized boolean shouldSendNow() {
boolean shouldSend = false;
- if (fPending.size() > 0) {
+ if (fPending.isEmpty()) {
final long nowMs = Clock.now();
shouldSend = (fPending.size() >= fMaxBatchSize);