void (PsiType migrationType, PsiMethod method) { final PsiCodeBlock block = method.getBody(); if (block != null) { block.accept(new JavaRecursiveElementWalkingVisitor() { @Override public void visitReturnStatement(@NotNull PsiReturnStatement statement) { final PsiExpression value = statement.getReturnValue(); if (value != null) { final PsiType type = getTypeEvaluator().evaluateType(value); if (type != null && !type.equals(migrationType)) { if (PsiTypes.voidType().equals(migrationType)) { convertExpression(value, migrationType, type, true); } else { migrateExpressionType(value, migrationType, statement, TypeConversionUtil.isAssignable(migrationType, type), true); } } } } @Override public void visitClass(@NotNull PsiClass aClass) {} @Override public void visitLambdaExpression(@NotNull PsiLambdaExpression expression) {} }); } }