Sonar major issues 99/39999/1
authorSurendra Reddy Katam <SK00524980@techmahindra.com>
Thu, 29 Mar 2018 05:07:53 +0000 (10:37 +0530)
committerSurendra Reddy Katam <SK00524980@techmahindra.com>
Thu, 29 Mar 2018 05:07:53 +0000 (10:37 +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-MbQb32hFUzlqc5Zl&resolved=false&severities=MAJOR
Location:
src/main/java/com/att/nsa/mr/client/impl/MRBatchPublisher.java
Line No-161

Change-Id: I19a085d5a602005807c56d75e2b5327050b311b2
Issue-ID: DMAAP-161
Signed-off-by: Surendra Reddy Katam <SK00524980@techmahindra.com>
src/main/java/com/att/nsa/mr/client/impl/MRBatchPublisher.java

index 02c3c69..1310986 100644 (file)
@@ -158,7 +158,7 @@ public class MRBatchPublisher implements MRBatchingPublisher
                try
                {
                        final List<message> remains = close ( Long.MAX_VALUE, TimeUnit.MILLISECONDS );
-                       if ( remains.size() > 0 )
+                       if ( remains.isEmpty() )
                        {
                                fLog.warn ( "Closing publisher with " + remains.size() + " messages unsent. "
                                        + "(Consider using the alternate close method to capture unsent messages in this case.)" );