Files
openide/java/java-tests/testData/inspection/nullableProblems/MethodReferenceListOf.java
Tagir Valeev a535ce5071 [java-inspections] Do not report 'Not annotated method is used as an override...' when method ref target is a library method
Initially, it was implemented to simplify annotation propagation. But we don't do this for libraries (as this would require adding external annotation which is not always desired)

Fixes IDEA-292765 Lambda can be method reference inspection doesn't consider nullability of the functional interface

GitOrigin-RevId: d99b253173c607234dea50eebb0da513d52ca5a7
2022-04-25 22:42:12 +00:00

15 lines
242 B
Java

import org.jetbrains.annotations.NotNull;
import java.util.List;
class A {
interface FI<T> {
@NotNull List<T> getX(@NotNull T value);
}
void foo() {
FI<String> f = value -> List.of(value);
FI<String> f2 = List::of;
}
}