mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-04 12:17:12 +07:00
[java-inspections] UseBulkOperation: fix quick-fix producing red code
(IDEA-278469) GitOrigin-RevId: fc0695a4425b6c5ff009616f4e6529bfdd1c8f08
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1922f00a54
commit
91ddf5b7f4
@@ -0,0 +1,10 @@
|
||||
// "Replace iteration with bulk 'Map.putAll' call" "true"
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
class Main extends HashMap<String, Integer> {
|
||||
void test() {
|
||||
Map<String, Integer> result = new HashMap<>();
|
||||
result.putAll(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace iteration with bulk 'Map.putAll' call" "true"
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
class Main extends HashMap<String, Integer> {
|
||||
void test() {
|
||||
Map<String, Integer> result = new HashMap<>();
|
||||
for (Map.Entry<String, Integer> entry : super.entrySet()) {
|
||||
result.pu<caret>t(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user