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-MbTf32hFUzlqc5gL&resolved=false&severities=MAJOR
Location:
src/main/java/com/att/nsa/mr/test/clients/SamplePublisher.java
Line No- L77 L45
Change-Id: I240d7411f80a644b119f28271bf9ee13298f770f
Issue-ID: DMAAP-620
Signed-off-by: Surendra Reddy Katam <SK00524980@techmahindra.com>
final String hosts = ( args.length > 0 ? args[0] : "localhost:8181" );
// read the topic name from the command line
- //final String topic = ( args.length > 1 ? args[1] : "MY-EXAMPLE-TOPIC" );
+
final String topic = ( args.length > 1 ? args[1] : "com.att.app.dmaap.mr.testingTopic" );
// set up some batch limits and the compression flag
// publisher interface allows the app to get the set of unsent messages. It could
// write them to disk, for example, to try to send them later.
final List<message> stuck = pub.close ( 20, TimeUnit.SECONDS );
- if ( stuck.size () > 0 )
+ if ( stuck.isEmpty())
{
LOG.warn ( stuck.size() + " messages unsent" );
}