diff options
author | Surendra Reddy Katam <SK00524980@techmahindra.com> | 2019-01-10 11:52:25 +0530 |
---|---|---|
committer | Surendra Reddy Katam <SK00524980@techmahindra.com> | 2019-01-10 11:52:25 +0530 |
commit | 7d0b20a27df5a537aeb6b352b34d0f4374f5f605 (patch) | |
tree | e18300ba60cb024b45c98ac7e1cef687b78a6bb6 | |
parent | 203a6de85ecb784531747612bc61fe30f6bfe351 (diff) |
Sonar majior 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.msgrtr%3Amsgrtr&open=AWU41WkrwGn37JfbyH0h&resolved=false&severities=MAJOR
Location:
src/main/java/org/onap/dmaap/dmf/mr/backends/kafka/Kafka011Consumer.java
Line No-L116 L80
Change-Id: I8ece30c1fd0a0ff22ce50545befe32bcb5a733fc
Issue-ID: DMAAP-957
Signed-off-by: Surendra Reddy Katam <SK00524980@techmahindra.com>
-rw-r--r-- | src/main/java/org/onap/dmaap/dmf/mr/backends/kafka/Kafka011Consumer.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/onap/dmaap/dmf/mr/backends/kafka/Kafka011Consumer.java b/src/main/java/org/onap/dmaap/dmf/mr/backends/kafka/Kafka011Consumer.java index 93374fb..b66a251 100644 --- a/src/main/java/org/onap/dmaap/dmf/mr/backends/kafka/Kafka011Consumer.java +++ b/src/main/java/org/onap/dmaap/dmf/mr/backends/kafka/Kafka011Consumer.java @@ -77,7 +77,7 @@ public class Kafka011Consumer implements Consumer { fId = id; fCreateTimeMs = System.currentTimeMillis(); fLastTouch = fCreateTimeMs; - fPendingMsgs = new LinkedBlockingQueue<ConsumerRecord<String, String>>(); + fPendingMsgs = new LinkedBlockingQueue<>(); fLogTag = fGroup + "(" + fId + ")/" + fTopic; offset = 0; state = Kafka011Consumer.State.OPENED; @@ -113,7 +113,7 @@ public class Kafka011Consumer implements Consumer { public synchronized Consumer.Message nextMessage() { try { - if (fPendingMsgs.size() > 0) { + if (fPendingMsgs.isEmpty()) { return makeMessage(fPendingMsgs.take()); } } catch (InterruptedException x) { |