mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-03 11:47:50 +07:00
IDEA-163463 Stream API migration: type argument before map appears sometimes when it's unnecessary
18 lines
504 B
Java
18 lines
504 B
Java
// "Replace with collect" "true"
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class Main {
|
|
public List<Runnable> test(List<String> list) {
|
|
List<Runnable> result = list.stream().map(s -> new Runnable() {
|
|
@Override
|
|
public void run() {
|
|
String str = s;
|
|
if (str.isEmpty()) str = "none";
|
|
System.out.println(str);
|
|
}
|
|
}).collect(Collectors.toList());
|
|
return result;
|
|
}
|
|
} |