Program: 125552
Project: 125552
Buggy source:
/** 
 * DOC nrousseau Comment method "resolveJar".
 * @param jarNeeded
 * @param jarFile
 * @param manager
 * @param customNexusServer
 * @param uri
 * @return
 * @throws Exception
 * @throws IOException
 */
public File resolveJar(TalendLibsServerManager manager,final NexusServerBean customNexusServer,String uri) throws Exception, IOException {
  File resolvedFile=null;
  if (!isLocalJarSameAsNexus(manager,customNexusServer,uri)) {
    resolvedFile=manager.getMavenResolver().resolve(uri);
  }
  if (resolvedFile != null) {
    final Map<String,ELibraryInstallStatus> statusMap=ModuleStatusProvider.getStatusMap();
    statusMap.put(uri,ELibraryInstallStatus.INSTALLED);
    mavenJarInstalled.put(uri,resolvedFile.getAbsolutePath());
  }
  updateLastResolveDate(uri);
  if (resolvedFile != null) {
    try {
      String pomPath=resolvedFile.getParent();
      String name=resolvedFile.getName();
      int indexOf=name.lastIndexOf("String_Node_Str");
      if (indexOf != -1) {
        pomPath=pomPath + "String_Node_Str" + name.substring(0,indexOf)+ "String_Node_Str"+ MavenConstants.PACKAGING_POM;
      }
 else {
        pomPath=pomPath + name + "String_Node_Str"+ MavenConstants.PACKAGING_POM;
      }
      File pomFile=new File(pomPath);
      if (!pomFile.exists()) {
        MavenArtifact parseMvnUrl=MavenUrlHelper.parseMvnUrl(uri);
        File generatedPom=new File(PomUtil.generatePom(parseMvnUrl));
        FilesUtils.copyFile(generatedPom,pomFile);
      }
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
  }
  return resolvedFile;
}

Fixed version (ground truth):
/** 
 * DOC nrousseau Comment method "resolveJar".
 * @param jarNeeded
 * @param jarFile
 * @param manager
 * @param customNexusServer
 * @param uri
 * @return
 * @throws Exception
 * @throws IOException
 */
public File resolveJar(TalendLibsServerManager manager,final NexusServerBean customNexusServer,String uri) throws Exception, IOException {
  File resolvedFile=null;
  if (!isLocalJarSameAsNexus(manager,customNexusServer,uri)) {
    resolvedFile=manager.getMavenResolver().resolve(uri);
  }
  if (resolvedFile != null) {
    final Map<String,ELibraryInstallStatus> statusMap=ModuleStatusProvider.getStatusMap();
    statusMap.put(uri,ELibraryInstallStatus.INSTALLED);
    ModuleStatusProvider.getDeployStatusMap().put(uri,ELibraryInstallStatus.DEPLOYED);
    mavenJarInstalled.put(uri,resolvedFile.getAbsolutePath());
  }
  updateLastResolveDate(uri);
  if (resolvedFile != null) {
    try {
      String pomPath=resolvedFile.getParent();
      String name=resolvedFile.getName();
      int indexOf=name.lastIndexOf("String_Node_Str");
      if (indexOf != -1) {
        pomPath=pomPath + "String_Node_Str" + name.substring(0,indexOf)+ "String_Node_Str"+ MavenConstants.PACKAGING_POM;
      }
 else {
        pomPath=pomPath + name + "String_Node_Str"+ MavenConstants.PACKAGING_POM;
      }
      File pomFile=new File(pomPath);
      if (!pomFile.exists()) {
        MavenArtifact parseMvnUrl=MavenUrlHelper.parseMvnUrl(uri);
        File generatedPom=new File(PomUtil.generatePom(parseMvnUrl));
        FilesUtils.copyFile(generatedPom,pomFile);
      }
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
  }
  return resolvedFile;
}