mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
disable stream conversion if qualifier is used inside method call args (IDEA-137186)
(cherry picked from commit 24dfdad535f2c33e4d1f4d004a28b0ca45012c1b)
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
// "Replace with forEach" "false"
|
||||
import java.util.*;
|
||||
|
||||
class A {
|
||||
public static void main(String[] args) {
|
||||
List<String> names = Arrays.asList("Bob", "Alice", "Bob", "Carol");
|
||||
Set<String> uniqNames = new HashSet<>(names.size());
|
||||
for (String name : na<caret>mes){
|
||||
uniqNames.add(makeNameUnique(name, uniqNames));
|
||||
}
|
||||
uniqNames.forEach(System.out::println);
|
||||
}
|
||||
|
||||
private static String makeNameUnique(final String name, final Set<String> uniqNames) {
|
||||
if (uniqNames.contains(name)) {
|
||||
return name + "1";
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user