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>
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.)" );