mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-21 22:11:40 +07:00
anonym -> method ref: do not collapse in method ref when qualifier calls performs smth (IDEA-93697)
This commit is contained in:
@@ -176,6 +176,12 @@ public class LambdaCanBeMethReferenceInspection extends BaseJavaLocalInspectionT
|
||||
}
|
||||
super.visitReferenceExpression(expression);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitMethodCallExpression(PsiMethodCallExpression expression) {
|
||||
usedInQualifier.set(true);
|
||||
super.visitMethodCallExpression(expression);
|
||||
}
|
||||
});
|
||||
if (usedInQualifier.get()) return null;
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
// "Replace with method reference" "true"
|
||||
interface Foo<A, B> {
|
||||
B f(A a);
|
||||
}
|
||||
|
||||
interface DeeBee<A> {
|
||||
A run(Void c) throws SQLException;
|
||||
|
||||
<B> DeeBee<B> bind(final Foo<A, DeeBee<B>> f) default {
|
||||
return f.f(null)::run;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Replace with method reference" "true"
|
||||
// "Replace with method reference" "false"
|
||||
interface Foo<A, B> {
|
||||
B f(A a);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user