mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-18 12:31:26 +07:00
[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
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0de99ed319
commit
8a84b67cb8
@@ -0,0 +1,14 @@
|
||||
// "Replace with lambda" "true"
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
interface Bar {}
|
||||
interface Foo {
|
||||
@Nullable
|
||||
String foo(Bar bar);
|
||||
}
|
||||
|
||||
class X {
|
||||
Foo test() {
|
||||
return bar -> null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// "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;}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user