boolean (@NotNull CFGBuilder builder, @NotNull PsiMethodCallExpression call) { if (!call.getArgumentList().isEmpty()) return false; if (!ExpressionUtil.isEffectivelyUnqualified(call.getMethodExpression())) return false; PsiMethod method = call.resolveMethod(); if (method == null || PsiUtil.canBeOverridden(method) || (call.isPhysical() && !method.isPhysical())) return false; PsiClass aClass = method.getContainingClass(); if (aClass == null || !PsiTreeUtil.isAncestor(aClass, call, true)) return false; if (PsiTypes.voidType().equals(method.getReturnType())) return false; if (PsiTreeUtil.isAncestor(method, call, true)) return false; PsiReturnStatement statement = tryCast(ControlFlowUtils.getOnlyStatementInBlock(method.getBody()), PsiReturnStatement.class); if (statement == null) return false; PsiExpression returnValue = PsiUtil.skipParenthesizedExprDown(statement.getReturnValue()); if (returnValue == null) return false; if (returnValue instanceof PsiLiteralExpression) return false; if (!isSimple(returnValue)) return false; NullabilityAnnotationInfo info = NullableNotNullManager.getInstance(method.getProject()).findEffectiveNullabilityInfo(method); boolean nonNull = info != null && info.getNullability() == Nullability.NOT_NULL && !info.isInferred(); builder.pushExpression(returnValue, nonNull ? NullabilityProblemKind.assumeNotNull : NullabilityProblemKind.noProblem) .boxUnbox(returnValue, call.getType()) .resultOf(call); return true; }