mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-12 18:36:52 +07:00
Fixes IDEA-362351 An Incorrect Error warning "Non-static methods cannot be referenced from a static context" Fixes IDEA-173183 Wrong error message for method reference Improves IDEA-208532 Incorrect Inspect code error in lambda expression method reference GitOrigin-RevId: 8f7a17688eaa1aba72bbccd45395967656108668
20 lines
843 B
Java
20 lines
843 B
Java
import java.util.LinkedHashMap;
|
|
import java.util.Map;
|
|
import java.util.function.Supplier;
|
|
import java.util.stream.Collectors;
|
|
|
|
class Test {
|
|
void m() {
|
|
// IDEA-337371 -- error reporting still should be improved
|
|
var o = new MapDropdownChoice<String, Integer>(
|
|
() -> {
|
|
Map<String, Integer> choices = Map.of("id1", 1);
|
|
return choices.entrySet().stream()
|
|
.collect(Collectors.toMap(<error descr="Non-static method cannot be referenced from a static context">Map.Entry::getKey</error>, <error descr="Non-static method cannot be referenced from a static context">Map.Entry::getValue</error>,
|
|
(e1, e2) -> e1, LinkedHashMap::new));
|
|
});
|
|
}
|
|
static class MapDropdownChoice<K, V> {
|
|
public MapDropdownChoice(Supplier<? extends Map<K, ? extends V>> choiceMap) {}
|
|
}
|
|
} |