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

GitOrigin-RevId: e8e9f961fac11c42b48722347cbaa9707f2d608d
This commit is contained in:
Anna Kozlova
2019-07-05 21:20:18 +02:00
committed by intellij-monorepo-bot
parent 3d382db75d
commit 0e2f0f2116
2 changed files with 3 additions and 1 deletions

View File

@@ -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());
}