Program: 125939
Project: 125939
Buggy source:
/** 
 * DOC wchen Comment method "deployFile".
 * @param file
 * @param mavenUri snaopshot mvn uri
 * @param monitorWrap
 */
private void deployFile(File file,String snapshotMavenUri,IProgressMonitor... monitorWrap){
  try {
    listToUpdate=true;
    if (file.isDirectory()) {
      List<File> jarFiles=FilesUtils.getJarFilesFromFolder(file,null);
      Map<String,String> sourceAndMavenUri=new HashMap<String,String>();
      if (!jarFiles.isEmpty()) {
        for (        File jarFile : jarFiles) {
          String jarName=jarFile.getName();
          String defaultMavenUri=MavenUrlHelper.generateMvnUrlForJarName(jarName);
          if (snapshotMavenUri == null) {
            String urisFromIndex=LibrariesIndexManager.getInstance().getMavenLibIndex().getJarsToRelativePath().get(jarName);
            if (urisFromIndex != null) {
              final String[] mvnUris=urisFromIndex.split(MavenUrlHelper.MVN_INDEX_SPLITER);
              for (              String uri : mvnUris) {
                sourceAndMavenUri.put(uri,jarFile.getAbsolutePath());
              }
            }
            sourceAndMavenUri.put(defaultMavenUri,jarFile.getAbsolutePath());
          }
 else {
            sourceAndMavenUri.put(snapshotMavenUri,jarFile.getAbsolutePath());
          }
        }
        deployer.deployToLocalMaven(sourceAndMavenUri);
      }
    }
 else {
      Map<String,String> sourceAndMavenUri=new HashMap<String,String>();
      String defaultMavenUri=MavenUrlHelper.generateMvnUrlForJarName(file.getName());
      if (snapshotMavenUri == null) {
        String urisFromIndex=LibrariesIndexManager.getInstance().getMavenLibIndex().getJarsToRelativePath().get(file.getName());
        if (urisFromIndex != null) {
          final String[] mvnUris=urisFromIndex.split(MavenUrlHelper.MVN_INDEX_SPLITER);
          for (          String uri : mvnUris) {
            sourceAndMavenUri.put(uri,file.getAbsolutePath());
          }
        }
        sourceAndMavenUri.put(defaultMavenUri,file.getAbsolutePath());
      }
 else {
        sourceAndMavenUri.put(snapshotMavenUri,file.getAbsolutePath());
      }
      deployer.deployToLocalMaven(sourceAndMavenUri);
    }
  }
 catch (  IOException e) {
    CommonExceptionHandler.process(e);
  }
catch (  Exception e) {
    CommonExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
/** 
 * DOC wchen Comment method "deployFile".
 * @param file
 * @param mavenUri snaopshot mvn uri
 * @param monitorWrap
 */
private void deployFile(File file,String snapshotMavenUri,boolean updateRemoteJar,IProgressMonitor... monitorWrap){
  try {
    listToUpdate=true;
    if (file.isDirectory()) {
      List<File> jarFiles=FilesUtils.getJarFilesFromFolder(file,null);
      Map<String,String> sourceAndMavenUri=new HashMap<String,String>();
      if (!jarFiles.isEmpty()) {
        for (        File jarFile : jarFiles) {
          String jarName=jarFile.getName();
          String defaultMavenUri=MavenUrlHelper.generateMvnUrlForJarName(jarName);
          if (snapshotMavenUri == null) {
            String urisFromIndex=LibrariesIndexManager.getInstance().getMavenLibIndex().getJarsToRelativePath().get(jarName);
            if (urisFromIndex != null) {
              final String[] mvnUris=urisFromIndex.split(MavenUrlHelper.MVN_INDEX_SPLITER);
              for (              String uri : mvnUris) {
                sourceAndMavenUri.put(uri,jarFile.getAbsolutePath());
              }
            }
            sourceAndMavenUri.put(defaultMavenUri,jarFile.getAbsolutePath());
          }
 else {
            sourceAndMavenUri.put(snapshotMavenUri,jarFile.getAbsolutePath());
          }
        }
        deployer.deployToLocalMaven(sourceAndMavenUri);
      }
    }
 else {
      Map<String,String> sourceAndMavenUri=new HashMap<String,String>();
      String defaultMavenUri=MavenUrlHelper.generateMvnUrlForJarName(file.getName());
      if (snapshotMavenUri == null) {
        String urisFromIndex=LibrariesIndexManager.getInstance().getMavenLibIndex().getJarsToRelativePath().get(file.getName());
        if (urisFromIndex != null) {
          final String[] mvnUris=urisFromIndex.split(MavenUrlHelper.MVN_INDEX_SPLITER);
          for (          String uri : mvnUris) {
            sourceAndMavenUri.put(uri,file.getAbsolutePath());
          }
        }
        sourceAndMavenUri.put(defaultMavenUri,file.getAbsolutePath());
      }
 else {
        sourceAndMavenUri.put(snapshotMavenUri,file.getAbsolutePath());
      }
      deployer.deployToLocalMaven(sourceAndMavenUri,updateRemoteJar);
    }
  }
 catch (  IOException e) {
    CommonExceptionHandler.process(e);
  }
catch (  Exception e) {
    CommonExceptionHandler.process(e);
  }
}