From c7d4f81fca7493d5377da10c027b81b447861412 Mon Sep 17 00:00:00 2001 From: Surendra Reddy Katam Date: Tue, 21 Aug 2018 14:58:19 +0530 Subject: Sonar major issues 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 --- src/main/java/com/att/nsa/mr/test/clients/SamplePublisher.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/com/att/nsa/mr/test/clients/SamplePublisher.java b/src/main/java/com/att/nsa/mr/test/clients/SamplePublisher.java index 36c2b7f..0233dcb 100644 --- a/src/main/java/com/att/nsa/mr/test/clients/SamplePublisher.java +++ b/src/main/java/com/att/nsa/mr/test/clients/SamplePublisher.java @@ -42,7 +42,7 @@ public class SamplePublisher { 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 @@ -74,7 +74,7 @@ public class SamplePublisher { // 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 stuck = pub.close ( 20, TimeUnit.SECONDS ); - if ( stuck.size () > 0 ) + if ( stuck.isEmpty()) { LOG.warn ( stuck.size() + " messages unsent" ); } -- cgit 1.2.3-korg