[java-inspections] UseBulkOperation: preserve the qualifier of PsiSuperExpression if it exists (IJ-CR-15560)

GitOrigin-RevId: 2fcf4eddd6b43963ba93c5a4c1ae413d9be18b10
This commit is contained in:
Andrey.Cherkasov
2021-10-23 04:32:13 +03:00
committed by intellij-monorepo-bot
parent 5f368dfa9d
commit b66b76939f
3 changed files with 42 additions and 5 deletions

View File

@@ -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> {
class Nested {
void test() {
Map<String, Integer> result = new HashMap<>();
result.putAll(Main.this);
}
}
}

View File

@@ -0,0 +1,14 @@
// "Replace iteration with bulk 'Map.putAll' call" "true"
import java.util.HashMap;
import java.util.Map;
class Main extends HashMap<String, Integer> {
class Nested {
void test() {
Map<String, Integer> result = new HashMap<>();
for (Map.Entry<String, Integer> entry : Main.super.entrySet()) {
result.pu<caret>t(entry.getKey(), entry.getValue());
}
}
}
}