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
10 lines
316 B
Java
10 lines
316 B
Java
// "Replace with findFirst()" "true"
|
|
|
|
import java.util.*;
|
|
|
|
public class Main {
|
|
public Runnable getRunnable(List<String> data) {
|
|
Runnable def = () -> {};
|
|
return data.stream().filter(s -> s.startsWith("xyz")).findFirst().<Runnable>map(s -> s.length() > 2 ? s::trim : System.out::println).orElse(def);
|
|
}
|
|
} |