leventov commented on a change in pull request #7067: Made IntelliJ Inspection 
"Iteration over keySet() could be replaced with entrySet()" a error & Fixed the 
violations
URL: https://github.com/apache/incubator-druid/pull/7067#discussion_r262236249
 
 

 ##########
 File path: 
benchmarks/src/test/java/org/apache/druid/benchmark/BenchmarkDataGeneratorTest.java
 ##########
 @@ -431,22 +432,8 @@ public void addRow(InputRow row)
     public void printStuff()
     {
       System.out.println();
-      for (String dim : dimensionMap.keySet()) {
-        System.out.println("DIMENSION " + dim + "\n============");
-        Map<Object, Integer> valueMap = dimensionMap.get(dim);
-
-        List<Comparable> valList = new ArrayList<>();
-        for (Object val : valueMap.keySet()) {
-          valList.add((Comparable) val);
-        }
-
-        Collections.sort(valList);
-
-        for (Comparable val : valList) {
-          System.out.println(" VAL: " + val + " CNT: " + valueMap.get(val));
-        }
-        System.out.println();
-      }
+      
+      dimensionMap.forEach((key, valueMap) -> new 
TreeMap<>(valueMap).forEach((val, cnt) -> System.out.println(" VAL: " + val + " 
CNT: " + cnt)));
 
 Review comment:
   This line is longer than 120 cols, should be broken up

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to