Sonar major issues 67/63467/1
authorSumapriya Sarvepalli <ss00493505@techmahindra.com>
Wed, 29 Aug 2018 12:31:56 +0000 (18:01 +0530)
committerSumapriya Sarvepalli <ss00493505@techmahindra.com>
Wed, 29 Aug 2018 12:31:56 +0000 (18:01 +0530)
 Replace with the diamond operator
Sonar Link:
https://sonar.onap.org/project/issues?assignees=sumapriya&id=org.onap.dmaap.messagerouter.msgrtr%3Amsgrtr&open=AV4-Vab632hFUzlqc5oV&resolved=false&severities=MAJOR
Location:
src/main/java/com/att/dmf/mr/backends/memory/MemoryQueue.java
Line No:L46 L105 L172

Change-Id: Ifce2d0206e1a0898aa238a86259de7b41b2c8a23
Issue-ID: DMAAP-672
Signed-off-by: Sumapriya Sarvepalli <ss00493505@techmahindra.com>
src/main/java/com/att/dmf/mr/backends/memory/MemoryQueue.java

index 0629972..8ab4619 100644 (file)
@@ -43,7 +43,7 @@ public class MemoryQueue {
         * constructor storing hashMap objects in Queue and Offsets object
         */
        public MemoryQueue() {
-               fQueue = new HashMap<String, LogBuffer>();
+               fQueue = new HashMap<>();
                fOffsets = new HashMap<String, HashMap<String, Integer>>();
        }
 
@@ -102,7 +102,7 @@ public class MemoryQueue {
 
                HashMap<String, Integer> offsetMap = fOffsets.get(consumerName);
                if (offsetMap == null) {
-                       offsetMap = new HashMap<String, Integer>();
+                       offsetMap = new HashMap<>();
                        fOffsets.put(consumerName, offsetMap);
                }
                Integer offset = offsetMap.get(topic);
@@ -169,7 +169,7 @@ public class MemoryQueue {
                public LogBuffer(int maxSize) {
                        fBaseOffset = 0;
                        fMaxSize = maxSize;
-                       fList = new ArrayList<String>();
+                       fList = new ArrayList<>();
                }
 
                /**