Files
Tagir Valeev 8a84b67cb8 [java-inspections] AnonymousCanBeLambdaInspection: suggest conversion if annotation on sub-method duplicates the super-method
In this case, we can assume that annotation-processing code is smart enough to use super-annotation.
Fixes IDEA-158731 "Anonymous Foo can be replaced with lambda" is not suggested when method is annotated

GitOrigin-RevId: de8c6f15e742b4ee4df02ecef5b230752d292114
2025-01-03 11:21:18 +00:00

18 lines
294 B
Java

// "Replace with lambda" "true"
import org.jetbrains.annotations.Nullable;
interface Bar {}
interface Foo {
@Nullable
String foo(Bar bar);
}
class X {
Foo test() {
return new <caret>Foo() {
@Nullable
@Override
public String foo(Bar bar) {return null;}
};
}
}