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-MbVF32hFUzlqc5h5&resolved=false&rules=squid%3AS1155&severities=MAJOR
Location:
src/main/java/com/att/nsa/mr/tools/MessageCommand.java
Line No-116
Change-Id: I0ffaf59ffef7638642b4ce9997c56974c2190d31
Issue-ID: DMAAP-619
Signed-off-by: Surendra Reddy Katam <SK00524980@techmahindra.com>
logger.error("Problem sending message: ", e);
Thread.currentThread().interrupt();
}
- if ( left != null && left.size () > 0 )
+ if ( left != null && left.isEmpty() )
{
out.println ( left.size() + " messages not sent." );
}