ContractInfo (@NotNull PsiMethod method) { if (PsiUtil.isAnnotationMethod(method) || method instanceof LightRecordMethod) { return ContractInfo.PURE; } return CachedValuesManager.getCachedValue(method, () -> { final PsiAnnotation contractAnno = findContractAnnotation(method); ContractInfo info = ContractInfo.EMPTY; if (contractAnno != null) { List<StandardMethodContract> contracts = parseContracts(method, contractAnno); boolean pure = Boolean.TRUE.equals(AnnotationUtil.getBooleanAttributeValue(contractAnno, "pure")); MutationSignature mutationSignature = MutationSignature.UNKNOWN; if (pure) { mutationSignature = MutationSignature.PURE; } else { String mutationText = AnnotationUtil.getStringAttributeValue(contractAnno, MutationSignature.ATTR_MUTATES); if (mutationText != null) { try { mutationSignature = MutationSignature.parse(mutationText); } catch (IllegalArgumentException ignored) { } } } boolean explicit = !AnnotationUtil.isInferredAnnotation(contractAnno); info = new ContractInfo(contracts, pure, explicit, mutationSignature); } return CachedValueProvider.Result.create(info, method, PsiModificationTracker.MODIFICATION_COUNT); }); }