Sonar major issues
Replace with the diamond operator
Sonar Link:
https://sonar.onap.org/project/issues?assignees=sumapriya&id=org.onap.dmaap.messagerouter.msgrtr%3Amsgrtr&open=AWU41WkywGn37JfbyH0l&resolved=false&severities=MAJOR
Location:
src/main/java/com/att/dmf/mr/backends/kafka/KafkaPublisher.java
Line No:L181 184
Change-Id: I5bed2ad41a016229a177db7a4dfaff9bb19fa0f2
Issue-ID: DMAAP-644
Signed-off-by: Sumapriya Sarvepalli <ss00493505@techmahindra.com>
diff --git a/src/main/java/com/att/dmf/mr/backends/kafka/KafkaPublisher.java b/src/main/java/com/att/dmf/mr/backends/kafka/KafkaPublisher.java
index dc4bcd5..9543828 100644
--- a/src/main/java/com/att/dmf/mr/backends/kafka/KafkaPublisher.java
+++ b/src/main/java/com/att/dmf/mr/backends/kafka/KafkaPublisher.java
@@ -178,10 +178,10 @@
throws IOException {
log.info("sending " + msgs.size() + " events to [" + topic + "]");
try{
- final List<ProducerRecord<String, String>> kms = new ArrayList<ProducerRecord<String, String>>(msgs.size());
+ final List<ProducerRecord<String, String>> kms = new ArrayList<>(msgs.size());
for (message o : msgs) {
- final ProducerRecord<String, String> data = new ProducerRecord<String, String>(topic, o.getKey(), o.toString());
+ final ProducerRecord<String, String> data = new ProducerRecord<>(topic, o.getKey(), o.toString());
try {