mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 07:20:53 +07:00
15 lines
452 B
Java
15 lines
452 B
Java
// "Replace iteration with bulk 'Map.putAll()' call" "true-preview"
|
|
import java.util.*;
|
|
|
|
class Main {
|
|
void test(Map<String, Integer> map) {
|
|
Map<String, Integer> result = new HashMap<>();
|
|
result.put("answer", 42);
|
|
Iterator<Map.Entry<String, Integer>> iterator = map.entrySet().iterator();
|
|
while (iterator.hasNext()) {
|
|
Map.Entry<String, Integer> e = iterator.next();
|
|
result<caret>.put(e.getKey(), e.getValue());
|
|
}
|
|
}
|
|
}
|