Nullability (PsiMethodImpl method, MethodData data) { PsiType type = method.getReturnType(); NullabilityAnnotationInfo info = NullableNotNullManager.getInstance(method.getProject()).findExplicitNullability(method); if (info != null) return info.getNullability(); if (type == null || type instanceof PsiPrimitiveType) return Nullability.UNKNOWN; MethodReturnInferenceResult result = data.getMethodReturn(); if (result == null) return Nullability.UNKNOWN; try { Nullability nullability = RecursionManager.doPreventingRecursion( method, true, () -> result.getNullability(method, data.methodBody(method))); return nullability == null ? Nullability.UNKNOWN : nullability; } catch (CannotRestoreExpressionException e) { throw ContractInferenceIndexKt.handleInconsistency(method, data, e); } }