same return value: don't check method lambda's return statements

GitOrigin-RevId: e8e9f961fac11c42b48722347cbaa9707f2d608d
This commit is contained in:
Anna Kozlova
2019-07-05 23:46:57 +03:00
committed by intellij-monorepo-bot
parent 3d382db75d
commit 0e2f0f2116
2 changed files with 3 additions and 1 deletions
@@ -295,7 +295,8 @@ public class RefJavaUtilImpl extends RefJavaUtil {
@Override
public boolean visitReturnExpression(@NotNull UReturnExpression node) {
if (refFrom instanceof RefMethodImpl) {
if (refFrom instanceof RefMethodImpl &&
UastUtils.getParentOfType(node, UMethod.class, false, UClass.class, ULambdaExpression.class) == decl) {
RefMethodImpl refMethod = (RefMethodImpl)refFrom;
refMethod.updateReturnValueTemplate(node.getReturnExpression());
}
@@ -16,5 +16,6 @@ class Test {
public static void main(String[] args) {
System.out.println(new Test().xxx());
new Test().test();
java.util.functionSupplier<String> s = () -> "test";
}
}