private static Method toJvmMethod(PsiMethod method) {
    return CachedValuesManager.getCachedValue(method, new CachedValueProvider<>() {
      @Override
      public @NotNull Result<Method> compute() {
        Method reflection = getMethod();
        return Result.create(reflection, method);
      }

      private static Class<?> toJvmType(PsiType type) {
        if (TypeUtils.isJavaLangString(type)) {
          return String.class;
        }
        if (TypeUtils.isJavaLangObject(type)) {
          return Object.class;
        }
        if (TypeUtils.typeEquals(JAVA_LANG_CHAR_SEQUENCE, type)) {
          return CharSequence.class;
        }
        if (PsiTypes.intType().equals(type)) {
          return int.class;
        }
        if (PsiTypes.booleanType().equals(type)) {
          return boolean.class;
        }
        if (PsiTypes.byteType().equals(type)) {
          return byte.class;
        }
        if (PsiTypes.shortType().equals(type)) {
          return short.class;
        }
        if (PsiTypes.charType().equals(type)) {
          return char.class;
        }
        if (PsiTypes.longType().equals(type)) {
          return long.class;
        }
        if (PsiTypes.floatType().equals(type)) {
          return float.class;
        }
        if (PsiTypes.doubleType().equals(type)) {
          return double.class;
        }
        return null;
      }

      private @Nullable Method getMethod() {
        PsiClass aClass = method.getContainingClass();
        Class<?> containingClass;
        if (aClass == null) return null;
        try {
          containingClass = Class.forName(aClass.getQualifiedName());
        }
        catch (ClassNotFoundException ignored) {
          return null;
        }
        PsiParameter[] parameters = method.getParameterList().getParameters();
        Class<?>[] parameterTypes = new Class[parameters.length];
        for (int i = 0; i < parameters.length; i++) {
          PsiParameter parameter = parameters[i];
          PsiType type = parameter.getType();
          Class<?> jvmType = toJvmType(type);
          if (jvmType == null) return null;
          parameterTypes[i] = jvmType;
        }
        return ReflectionUtil.getMethod(containingClass, method.getName(), parameterTypes);
      }
    });
  }
private static Method toJvmMethod(PsiMethod method)