private CompletableFuture<SourcePosition> getCachedSourcePosition(Location location, Function<FileType, CompletableFuture<SourcePosition>> producer) {
    if (location == null) return completedFuture(null);
    SourcePosition res = null;
    try {
      res = mySourcePositionCache.get(location);
    }
    catch (IllegalArgumentException ignored) { // Invalid method id
    }
    if (checkCacheEntry(res, location)) return completedFuture(res);

    FileType fileType = ReadAction.compute(() -> {
      String sourceName = DebuggerUtilsEx.getSourceName(location, (String)null);
      return sourceName != null ? FileTypeManager.getInstance().getFileTypeByFileName(sourceName) : null;
    });
    return producer.apply(fileType)
      .thenApply(p -> {
        try {
          mySourcePositionCache.put(location, p);
        }
        catch (IllegalArgumentException ignored) { // Invalid method id
        }
        return p;
      });
  }
private CompletableFuture<SourcePosition> getCachedSourcePosition(Location location, Function<FileType, CompletableFuture<SourcePosition>> producer)