Program: 126143
Project: 126143
Buggy source:
/** 
 * deploy needed modules with snapshot version
 */
@Override public void deployModules(Collection<ModuleNeeded> modules,IProgressMonitor monitorWrap){
  boolean modified=false;
  LibrariesIndex index=LibrariesIndexManager.getInstance().getStudioLibIndex();
  EMap<String,String> jarsToRelativePath=index.getJarsToRelativePath();
  List<File> filesToDeploy=new ArrayList<File>();
  for (  ModuleNeeded module : modules) {
    String moduleLocation=module.getModuleLocaion();
    EMap<String,String> jarsToMavenUri=LibrariesIndexManager.getInstance().getMavenLibIndex().getJarsToRelativePath();
    String mavenUri=jarsToMavenUri.get(module.getModuleName());
    if (checkJarInstalledInMaven(mavenUri)) {
      continue;
    }
    if (module.getMavenUriSnapshot() != null && !module.getMavenUriSnapshot().isEmpty()) {
      if (checkJarInstalledInMaven(module.getMavenUriSnapshot())) {
        continue;
      }
    }
    boolean found=false;
    if (moduleLocation != null && moduleLocation.startsWith("String_Node_Str")) {
      if (jarsToRelativePath.containsKey(module.getModuleName())) {
        String relativePath=jarsToRelativePath.get(module.getModuleName());
        if (!relativePath.equals(moduleLocation)) {
          if (!urlWarned.contains(moduleLocation)) {
            System.out.println(module.getModuleName() + "String_Node_Str" + relativePath+ "String_Node_Str"+ moduleLocation);
            urlWarned.add(moduleLocation);
          }
          moduleLocation=relativePath;
        }
      }
      if (checkJarInstalledFromPlatform(moduleLocation)) {
        jarsToRelativePath.put(module.getModuleName(),moduleLocation);
        modified=true;
        found=true;
        filesToDeploy.add(new File(studioJarInstalled.get(moduleLocation)));
      }
    }
    if (!found) {
      EMap<String,String> jarsToRelative=LibrariesIndexManager.getInstance().getStudioLibIndex().getJarsToRelativePath();
      String relativePath=jarsToRelative.get(module.getModuleName());
      if (relativePath != null && checkJarInstalledFromPlatform(relativePath)) {
        found=true;
        filesToDeploy.add(new File(studioJarInstalled.get(relativePath)));
      }
    }
    if (!found) {
      ExceptionHandler.log("String_Node_Str" + module.getModuleName());
    }
  }
  Map<String,String> customUriToAdd=new HashMap<String,String>();
  for (  File file : filesToDeploy) {
    deployFile(file,customUriToAdd,monitorWrap);
  }
  if (!customUriToAdd.isEmpty()) {
    deployMavenIndex(customUriToAdd,monitorWrap);
  }
  if (modified) {
    LibrariesIndexManager.getInstance().saveStudioIndexResource();
  }
}

Fixed version (ground truth):
/** 
 * deploy needed modules with snapshot version
 */
@Override public void deployModules(Collection<ModuleNeeded> modules,IProgressMonitor monitorWrap){
  boolean modified=false;
  LibrariesIndex index=LibrariesIndexManager.getInstance().getStudioLibIndex();
  EMap<String,String> jarsToRelativePath=index.getJarsToRelativePath();
  Map<String,String> customUriToAdd=new HashMap<String,String>();
  for (  ModuleNeeded module : modules) {
    File fileToDeploy=null;
    String moduleLocation=module.getModuleLocaion();
    String mavenUri=module.getMavenUriSnapshot();
    if (mavenUri == null || "String_Node_Str".equals(mavenUri)) {
      EMap<String,String> jarsToMavenUri=LibrariesIndexManager.getInstance().getMavenLibIndex().getJarsToRelativePath();
      mavenUri=jarsToMavenUri.get(module.getModuleName());
    }
    if (checkJarInstalledInMaven(mavenUri)) {
      continue;
    }
    boolean found=false;
    if (moduleLocation != null && moduleLocation.startsWith("String_Node_Str")) {
      if (jarsToRelativePath.containsKey(module.getModuleName())) {
        String relativePath=jarsToRelativePath.get(module.getModuleName());
        if (!relativePath.equals(moduleLocation)) {
          if (!urlWarned.contains(moduleLocation)) {
            System.out.println(module.getModuleName() + "String_Node_Str" + relativePath+ "String_Node_Str"+ moduleLocation);
            urlWarned.add(moduleLocation);
          }
          moduleLocation=relativePath;
        }
      }
      if (checkJarInstalledFromPlatform(moduleLocation)) {
        jarsToRelativePath.put(module.getModuleName(),moduleLocation);
        modified=true;
        found=true;
        fileToDeploy=new File(studioJarInstalled.get(moduleLocation));
      }
    }
    if (!found) {
      EMap<String,String> jarsToRelative=LibrariesIndexManager.getInstance().getStudioLibIndex().getJarsToRelativePath();
      String relativePath=jarsToRelative.get(module.getModuleName());
      if (relativePath != null && checkJarInstalledFromPlatform(relativePath)) {
        found=true;
        fileToDeploy=new File(studioJarInstalled.get(relativePath));
      }
    }
    if (!found) {
      ExceptionHandler.log("String_Node_Str" + module.getModuleName());
    }
    if (fileToDeploy != null) {
      deployFile(fileToDeploy,mavenUri,customUriToAdd,monitorWrap);
    }
  }
  if (!customUriToAdd.isEmpty()) {
    deployMavenIndex(customUriToAdd,monitorWrap);
  }
  if (modified) {
    LibrariesIndexManager.getInstance().saveStudioIndexResource();
  }
}