public @Nullable Resource findResource(@NotNull String resourceName) {
    long start = resourceLoading.startTiming();
    try {
      int i;
      if (useCache) {
        boolean allUrlsWereProcessedBeforeAccessingCache = allUrlsWereProcessed;
        i = lastLoaderProcessed.get();
        Loader[] loaders = cache.getLoadersByName(resourceName);
        if (loaders != null) {
          for (Loader loader : loaders) {
            Resource resource = loader.getResource(resourceName);
            if (resource != null) {
              if (loadedClasses != null) {
                loadedClasses.add(new AbstractMap.SimpleImmutableEntry<>(resourceName, loader.getPath()));
              }
              return resource;
            }
          }
        }

        if (allUrlsWereProcessedBeforeAccessingCache) {
          return null;
        }
      }
      else {
        i = 0;
      }

      Loader loader;
      while ((loader = getLoader(i++)) != null) {
        Resource resource = loader.getResource(resourceName);
        if (resource != null) {
          if (loadedClasses != null) {
            loadedClasses.add(new AbstractMap.SimpleImmutableEntry<>(resourceName, loader.getPath()));
          }
          return resource;
        }
      }
    }
    finally {
      resourceLoading.record(start, resourceName);
    }

    return null;
  }
public @Nullable Resource findResource(@NotNull String resourceName)