private static Map<String, Class<?>> getAntObjects(final GroovyFile groovyFile) {
    final Project project = groovyFile.getProject();

    final Module module = ModuleUtilCore.findModuleForPsiElement(groovyFile);
    Set<VirtualFile> jars = new HashSet<>();
    if (module != null) {
      ContainerUtil.addAll(jars, OrderEnumerator.orderEntries(module).getAllLibrariesAndSdkClassesRoots());
    }

    if (groovyFile.isScript() && GroovyScriptUtil.getScriptType(groovyFile) instanceof GantScriptType) {
      jars.addAll(GantScriptType.additionalScopeFiles(groovyFile));
    }

    List<Path> files = new ArrayList<>();
    for (VirtualFile jar : jars) {
      VirtualFile localFile = VfsUtil.getLocalFile(jar);
      if (localFile.isInLocalFileSystem()) {
        files.add(localFile.toNioPath());
      }
    }

    if (JavaPsiFacade.getInstance(project).findClass(ReflectedProject.ANT_PROJECT_CLASS, groovyFile.getResolveScope()) == null) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Ant library not available in " + groovyFile.getVirtualFile().getPath() + "; files=" + files);
      }
      return Collections.emptyMap();
    }

    AntClassLoader loader;
    synchronized (ourLock) {
      Map<List<Path>, AntClassLoader> map =
        CachedValuesManager.getManager(project).getParameterizedCachedValue(project, KEY, PROVIDER, false, project);
      loader = map.get(files);
      if (loader == null) {
        map.put(files, loader = new AntClassLoader(files));
      }
    }

    return loader.getAntObjects();
  }
private static Map<String, Class<?>> getAntObjects(final GroovyFile groovyFile)