Program: 126149
Project: 126149
Buggy source:
private void deployLibForComponentProviders(IComponentsService service,Set<String> libsWithoutUri,Map<String,String> libsToRelativePath,Map<String,String> libsToMavenUri){
  Set<String> needToDeploy=new HashSet<String>();
  Map<String,File> componentsFolders=service.getComponentsFactory().getComponentsProvidersFolder();
  Set<String> contributeIdSet=componentsFolders.keySet();
  for (  String contributeID : contributeIdSet) {
    try {
      File file=new File(componentsFolders.get(contributeID).toURI());
      if ("String_Node_Str".contains(contributeID) || "String_Node_Str".contains(contributeID)) {
        if (file.isDirectory()) {
          List<File> jarFiles=FilesUtils.getJarFilesFromFolder(file,null);
          if (jarFiles.size() > 0) {
            for (            File jarFile : jarFiles) {
              String name=jarFile.getName();
              if (!libsWithoutUri.contains(name)) {
                continue;
              }
              needToDeploy.add(jarFile.getAbsolutePath());
            }
          }
        }
 else {
          if (!libsWithoutUri.contains(file.getName())) {
            continue;
          }
          needToDeploy.add(file.getAbsolutePath());
        }
      }
 else {
        List<File> jarFiles=FilesUtils.getJarFilesFromFolder(file,null);
        if (jarFiles.size() > 0) {
          for (          File jarFile : jarFiles) {
            String name=jarFile.getName();
            if (!libsWithoutUri.contains(name)) {
              continue;
            }
            String path=libsToRelativePath.get(name);
            int lengthBasePath=new Path(file.getParentFile().getAbsolutePath()).toPortableString().length();
            String relativePath=new Path(jarFile.getAbsolutePath()).toPortableString().substring(lengthBasePath);
            String moduleLocation="String_Node_Str" + contributeID + relativePath;
            if (path != null) {
              if (path.equals(moduleLocation)) {
                continue;
              }
 else {
                CommonExceptionHandler.warn(name + "String_Node_Str" + path+ "String_Node_Str"+ moduleLocation);
                continue;
              }
            }
            libsToRelativePath.put(name,moduleLocation);
          }
        }
      }
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
      continue;
    }
  }
  Map<String,String> sourceAndMavenUri=new HashMap<String,String>();
  Map<String,String> customUriToAdd=new HashMap<String,String>();
  Map<String,String> libsToMavenUriAll=new HashMap<String,String>();
  libsToMavenUriAll.putAll(libsToMavenUri);
  libsToMavenUriAll.putAll(LibrariesIndexManager.getInstance().getMavenLibIndex().getJarsToRelativePath().map());
  if (!needToDeploy.isEmpty()) {
    for (    String file : needToDeploy) {
      String jarName=new File(file).getName();
      String mavenUri=libsToMavenUriAll.get(jarName);
      if (mavenUri == null) {
        mavenUri=MavenUrlHelper.generateMvnUrlForJarName(jarName);
        customUriToAdd.put(jarName,mavenUri);
      }
      sourceAndMavenUri.put(file,mavenUri);
    }
    try {
      deployer.deployToLocalMaven(sourceAndMavenUri);
      if (!customUriToAdd.isEmpty()) {
        deployMavenIndex(customUriToAdd);
      }
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
private void deployLibForComponentProviders(IComponentsService service,Set<String> libsWithoutUri,Map<String,String> libsToRelativePath,Map<String,String> libsToMavenUri){
  Set<String> needToDeploy=new HashSet<String>();
  Map<String,File> componentsFolders=service.getComponentsFactory().getComponentsProvidersFolder();
  Set<String> contributeIdSet=componentsFolders.keySet();
  for (  String contributeID : contributeIdSet) {
    try {
      File file=new File(componentsFolders.get(contributeID).toURI());
      if ("String_Node_Str".contains(contributeID) || "String_Node_Str".contains(contributeID)) {
        if (file.isDirectory()) {
          List<File> jarFiles=FilesUtils.getJarFilesFromFolder(file,null);
          if (jarFiles.size() > 0) {
            for (            File jarFile : jarFiles) {
              String name=jarFile.getName();
              if (!libsWithoutUri.contains(name)) {
                continue;
              }
              needToDeploy.add(jarFile.getAbsolutePath());
            }
          }
        }
 else {
          if (!libsWithoutUri.contains(file.getName())) {
            continue;
          }
          needToDeploy.add(file.getAbsolutePath());
        }
      }
 else {
        List<File> jarFiles=FilesUtils.getJarFilesFromFolder(file,null);
        if (jarFiles.size() > 0) {
          for (          File jarFile : jarFiles) {
            String name=jarFile.getName();
            if (!libsWithoutUri.contains(name)) {
              continue;
            }
            String path=libsToRelativePath.get(name);
            int lengthBasePath=new Path(file.getParentFile().getAbsolutePath()).toPortableString().length();
            String relativePath=new Path(jarFile.getAbsolutePath()).toPortableString().substring(lengthBasePath);
            String moduleLocation="String_Node_Str" + contributeID + relativePath;
            if (path != null) {
              if (path.equals(moduleLocation)) {
                continue;
              }
 else {
                CommonExceptionHandler.warn(name + "String_Node_Str" + path+ "String_Node_Str"+ moduleLocation);
                continue;
              }
            }
            libsToRelativePath.put(name,moduleLocation);
          }
        }
      }
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
      continue;
    }
  }
  Map<String,String> sourceAndMavenUri=new HashMap<String,String>();
  Map<String,String> customUriToAdd=new HashMap<String,String>();
  Map<String,String> libsToMavenUriAll=new HashMap<String,String>();
  libsToMavenUriAll.putAll(libsToMavenUri);
  libsToMavenUriAll.putAll(LibrariesIndexManager.getInstance().getMavenLibIndex().getJarsToRelativePath().map());
  if (!needToDeploy.isEmpty()) {
    for (    String file : needToDeploy) {
      String jarName=new File(file).getName();
      String mavenUri=libsToMavenUriAll.get(jarName);
      if (mavenUri == null) {
        mavenUri=MavenUrlHelper.generateMvnUrlForJarName(jarName);
        customUriToAdd.put(jarName,mavenUri);
      }
      sourceAndMavenUri.put(mavenUri,file);
    }
    try {
      deployer.deployToLocalMaven(sourceAndMavenUri);
      if (!customUriToAdd.isEmpty()) {
        deployMavenIndex(customUriToAdd);
      }
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
  }
}