Files
openide/java/java-tests/testData/inspection/java8MapApi/beforeReplaceAllEntrySetShadowVar.java
Artemiy Sartakov 63c61a12d1 Java8MapApiInspection: cr fixes (IDEA-CR-44452)
1. VariableNameGenerator instead of codeStyleManager#suggestUniqueVariableName
2. use tracker for inner comments
3. simplified references search using various util methods
4. added option to disable replaceAll suggestion
2019-03-07 13:48:57 +07:00

16 lines
389 B
Java

// "Replace with 'replaceAll' method call" "true"
import java.util.HashMap;
import java.util.Map;
public class Main {
public void test() {
String k = "another var";
String key = "one more";
Map<String, String> map = new HashMap<>();
map.put("foo", "bar");
for<caret> (Map.Entry<String, String> entry : map.entrySet()) {
map.put(entry.getKey(), k);
}
}
}