static @NotNull ContractInfo getContractInfo(@NotNull PsiMethod method) {
    if (PsiUtil.isAnnotationMethod(method) || method instanceof LightRecordMethod) {
      return ContractInfo.PURE;
    }
    return CachedValuesManager.getCachedValue(method, () -> {
      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);
      }

      PsiFile file = method.getContainingFile();
      if (file != null
          && file.getVirtualFile() != null
          && ProjectFileIndex.getInstance(method.getProject()).isInLibrary(file.getVirtualFile())) {
        // there is no need to recompute info on changes in the project code
        return Result.create(info, JavaLibraryModificationTracker.getInstance(method.getProject()));
      }

      return Result.create(info, method, PsiModificationTracker.MODIFICATION_COUNT);
    });
  }
static @NotNull ContractInfo getContractInfo(@NotNull PsiMethod method)