diff options
author | Surendra Reddy Katam <SK00524980@techmahindra.com> | 2018-08-21 14:58:19 +0530 |
---|---|---|
committer | Surendra Reddy Katam <SK00524980@techmahindra.com> | 2018-08-21 14:58:19 +0530 |
commit | c7d4f81fca7493d5377da10c027b81b447861412 (patch) | |
tree | 0fa0a468ea4232d5fea3dab2d9da667e62a66296 /src/main/java/com/att/nsa | |
parent | 18c89f49a0bf412591d7017500160b2baaab5486 (diff) |
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 <SK00524980@techmahindra.com>
Diffstat (limited to 'src/main/java/com/att/nsa')
-rw-r--r-- | src/main/java/com/att/nsa/mr/test/clients/SamplePublisher.java | 4 |
1 files changed, 2 insertions, 2 deletions
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<message> stuck = pub.close ( 20, TimeUnit.SECONDS ); - if ( stuck.size () > 0 ) + if ( stuck.isEmpty()) { LOG.warn ( stuck.size() + " messages unsent" ); } |