Sonar major issues 27/60427/1
authorSurendra Reddy Katam <SK00524980@techmahindra.com>
Tue, 14 Aug 2018 05:16:31 +0000 (10:46 +0530)
committerSurendra Reddy Katam <SK00524980@techmahindra.com>
Tue, 14 Aug 2018 05:16:31 +0000 (10:46 +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-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>
src/main/java/com/att/nsa/mr/client/impl/MRSimplerBatchPublisher.java

index 741705f..ef0d13a 100644 (file)
@@ -235,7 +235,7 @@ public class MRSimplerBatchPublisher extends MRBaseClient implements MRBatchingP
 
        private synchronized boolean shouldSendNow() {
                boolean shouldSend = false;
-               if (fPending.size() > 0) {
+               if (fPending.isEmpty()) {
                        final long nowMs = Clock.now();
 
                        shouldSend = (fPending.size() >= fMaxBatchSize);