protected void readClasspathEntry(T rootModel,
                                    final Collection<? super String> unknownLibraries,
                                    Collection<? super String> unknownJdks,
                                    Set<? super String> refsToModules,
                                    final String testPattern,
                                    Element element, int index,
                                    @Nullable EclipseModuleManager eclipseModuleManager,
                                    final ExpandMacroToPathMap macroMap,
                                    final Set<? super String> libs) throws ConversionException {
    String kind = element.getAttributeValue(EclipseXml.KIND_ATTR);
    if (kind == null) {
      throw new ConversionException("Missing classpathentry/@kind");
    }

    String path = element.getAttributeValue(EclipseXml.PATH_ATTR);
    if (path == null) {
      throw new ConversionException("Missing classpathentry/@path");
    }

    final boolean exported = EclipseXml.TRUE_VALUE.equals(element.getAttributeValue(EclipseXml.EXPORTED_ATTR));

    if (kind.equals(EclipseXml.SRC_KIND)) {
      if (path.startsWith("/")) {
        final String moduleName = path.substring(1);
        refsToModules.add(moduleName);
        addInvalidModuleEntry(rootModel, exported, moduleName);
      }
      else {
        String srcUrl = pathToUrl(getPathRelativeToRoot(path));
        boolean isTestFolder;
        try {
          isTestFolder = !StringUtil.isEmpty(testPattern) && path.matches(testPattern);
        }
        catch (PatternSyntaxException e) {
          isTestFolder = false;
        }
        String linked = expandLinkedResourcesPath(myRootPath, macroMap, path);
        if (linked == null) {
          addSourceFolderToCurrentContentRoot(rootModel, srcUrl, isTestFolder);
        }
        else {
          srcUrl = prepareValidUrlInsideJar(pathToUrl(linked));
          if (eclipseModuleManager != null) {
            eclipseModuleManager.registerEclipseLinkedSrcVarPath(srcUrl, path);
          }
          addSourceFolder(rootModel, srcUrl, isTestFolder);
        }

        if (eclipseModuleManager != null) {
          eclipseModuleManager.setExpectedModuleSourcePlace(rearrange(rootModel));
          eclipseModuleManager.registerSrcPlace(srcUrl, index);
        }
      }
    }
    else if (kind.equals(EclipseXml.OUTPUT_KIND)) {
      String output = getPathRelativeToRoot(path);
      String linked = expandLinkedResourcesPath(myRootPath, macroMap, path);
      if (linked != null) {
        output = linked;
        if (eclipseModuleManager != null) {
          eclipseModuleManager.registerEclipseLinkedVarPath(pathToUrl(output), path);
        }
      }
      setupOutput(rootModel, output);
    }
    else if (kind.equals(EclipseXml.LIB_KIND)) {
      String linked = expandLinkedResourcesPath(myRootPath, macroMap, path);
      String url;
      if (linked != null) {
        url = prepareValidUrlInsideJar(pathToUrl(linked));
        if (eclipseModuleManager != null) {
          eclipseModuleManager.registerEclipseLinkedVarPath(url, path);
        }
      }
      else {
        url = expandEclipsePath2Url(rootModel, path);
      }

      if (eclipseModuleManager != null) {
        eclipseModuleManager.registerEclipseLibUrl(url);
      }

      final String sourcePath = element.getAttributeValue(EclipseXml.SOURCEPATH_ATTR);
      String srcUrl = null;
      if (sourcePath != null) {
        final String linkedSrc = expandLinkedResourcesPath(myRootPath, macroMap, sourcePath);
        if (linkedSrc != null) {
          srcUrl = prepareValidUrlInsideJar(pathToUrl(linkedSrc));
          if (eclipseModuleManager != null) {
            eclipseModuleManager.registerEclipseLinkedSrcVarPath(srcUrl, sourcePath);
          }
        }
        else {
          srcUrl = expandEclipsePath2Url(rootModel, sourcePath);
        }
      }

      String nativeRoot = getNativeLibraryRoot(element);
      if (nativeRoot != null) {
        nativeRoot = expandEclipsePath2Url(rootModel, nativeRoot);
      }

      addModuleLibrary(rootModel, element, exported, getPresentableName(path, libs), url, srcUrl, nativeRoot, macroMap);
    }
    else if (kind.equals(EclipseXml.VAR_KIND)) {
      int slash = path.indexOf("/");
      if (slash == 0) {
        throw new ConversionException("Incorrect 'classpathentry/var@path' format");
      }

      final String libName = getPresentableName(path, libs);

      String url = eclipseVariabledPath2Url(macroMap, path, 0);
      if (eclipseModuleManager != null) {
        eclipseModuleManager.registerEclipseVariablePath(url, path);
      }
      final String srcPathAttr = element.getAttributeValue(EclipseXml.SOURCEPATH_ATTR);
      String srcUrl = null;
      if (srcPathAttr != null) {
        srcUrl = eclipseVariabledPath2Url(macroMap, srcPathAttr, srcVarStart(srcPathAttr));
        if (eclipseModuleManager != null) {
          eclipseModuleManager.registerEclipseSrcVariablePath(srcUrl, srcPathAttr);
        }
      }
      String nativeRoot = getNativeLibraryRoot(element);
      if (nativeRoot != null) {
        nativeRoot = expandEclipsePath2Url(rootModel, nativeRoot);
      }
      addModuleLibrary(rootModel, element, exported, libName, url, srcUrl, nativeRoot, macroMap);
    }
    else if (kind.equals(EclipseXml.CON_KIND)) {
      if (path.equals(EclipseXml.ECLIPSE_PLATFORM)) {
        readRequiredBundles(rootModel, refsToModules);
        addNamedLibrary(rootModel, unknownLibraries, exported, IdeaXml.ECLIPSE_LIBRARY, true);
      }
      else if (path.startsWith(EclipseXml.JRE_CONTAINER)) {

        final String jdkName = getLastPathComponent(path);
        setUpModuleJdk(rootModel, unknownJdks, eclipseModuleManager, jdkName);
      }
      else if (path.startsWith(EclipseXml.USER_LIBRARY)) {
        addNamedLibrary(rootModel, unknownLibraries, exported, getPresentableName(path), false);
      }
      else if (path.startsWith(EclipseXml.JUNIT_CONTAINER)) {
        final String junitName = IdeaXml.JUNIT + getPresentableName(path);
        addJUnitDefaultLib(rootModel, junitName, macroMap);
      }
      else {
        Set<String> registeredCons = getDefinedCons();
        if (registeredCons.contains(path)) {
          if (eclipseModuleManager != null) {
            eclipseModuleManager.registerCon(path);
            eclipseModuleManager.registerSrcPlace(path, index);
          }
        }
        else {
          if (eclipseModuleManager != null) {
            eclipseModuleManager.registerUnknownCons(path);
          }
          addNamedLibrary(rootModel, new ArrayList<>(), exported, path, true);
        }
      }
    }
    else {
      throw new ConversionException("Unknown classpathentry/@kind: " + kind);
    }
  }
protected void readClasspathEntry(T rootModel,
                                    final Collection<? super String> unknownLibraries,
                                    Collection<? super String> unknownJdks,
                                    Set<? super String> refsToModules,
                                    final String testPattern,
                                    Element element, int index,
                                    @Nullable EclipseModuleManager eclipseModuleManager,
                                    final ExpandMacroToPathMap macroMap,
                                    final Set<? super String> libs)