mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 14:25:04 +07:00
new inference: raw inner class method qualifier fixed (IDEA-121909)
(cherry picked from commit 012fcf6e95030e673f24307cb3527e0ea82f5c72)
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
class StreamMain {
|
||||
public static void main(final String... args) {
|
||||
x(Collections.<Integer, String>emptyMap().entrySet().stream().
|
||||
filter(entry -> 0 == entry.getKey() % 2).
|
||||
findFirst().
|
||||
map(Map.Entry::getValue).
|
||||
orElse("Bob!"), true);
|
||||
}
|
||||
|
||||
public static void x(final String s, final boolean b) {
|
||||
System.out.println(s);
|
||||
}
|
||||
}
|
||||
|
||||
class StreamMainSimplified {
|
||||
public static void main(Optional<Map.Entry<Integer, String>> first) {
|
||||
String s = first.map(Map.Entry::getValue).orElse("Bob!");
|
||||
String s1 = first.map((e) -> e.getValue()).orElse("Bob!");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user