boolean (@NotNull UReturnExpression node) { RefMethodImpl refMethod = null; if (refFrom instanceof RefMethodImpl && UastUtils.getParentOfType(node, UMethod.class, false, UClass.class, ULambdaExpression.class) == decl) { refMethod = (RefMethodImpl)refFrom; } else if (refFrom instanceof RefFunctionalExpression) { UElement target = node.getJumpTarget(); if (target instanceof UMethod) { refMethod = ObjectUtils.tryCast(refManager.getReference(target.getSourcePsi()), RefMethodImpl.class); } else if (decl instanceof ULambdaExpression lambdaExpression) { PsiMethod lambdaMethod = LambdaUtil.getFunctionalInterfaceMethod(lambdaExpression.getFunctionalInterfaceType()); refMethod = ObjectUtils.tryCast(refManager.getReference(lambdaMethod), RefMethodImpl.class); } } if (refMethod != null) { refMethod.initializeIfNeeded(); refMethod.updateReturnValueTemplate(node.getReturnExpression()); } return false; }