Program: 138541
Project: 138541
Buggy source:
@Override protected boolean doExecute() throws Exception {
  boolean result=true;
  Map<File,File> folderMap=initStructure();
  for (  File folder : folderMap.keySet()) {
    try {
      tansferFile(folder,folderMap);
    }
 catch (    Exception e) {
      log.error(e,e);
    }
  }
  File srcMdmXsdFolder=getWorkspacePath().append(ExchangeFileNameToReferenceTask.MDM_CONNECTION + IPath.SEPARATOR + "String_Node_Str").toFile();
  File tarMdmXsdFolder=getWorkspacePath().append(ERepositoryObjectType.getFolderName(ERepositoryObjectType.METADATA_MDMCONNECTION) + IPath.SEPARATOR + "String_Node_Str").toFile();
  FilesUtils.copyFolder(srcMdmXsdFolder,tarMdmXsdFolder,true,null,null,true,null);
  File mdmConnectionFolder=new File(ResourceManager.getMDMConnectionFolder().getRawLocationURI());
  final String[] metadataFileExtentionNames={"String_Node_Str"};
  UpdateMDMConnectionXSDPathTask.doUpdate(true,true,mdmConnectionFolder,metadataFileExtentionNames);
  ArrayList<File> fileList=new ArrayList<File>();
  FilesUtils.getAllFilesFromFolder(mdmConnectionFolder,fileList,new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      if (name.endsWith("String_Node_Str")) {
        return true;
      }
      return false;
    }
  }
);
  for (  File file : fileList) {
    TypedReturnCode<Connection> findProvider=PrvResourceFileHelper.getInstance().findProvider(WorkspaceUtils.fileToIFile(file));
    Connection connection=findProvider.getObject();
    connection.eResource().unload();
    EObjectHelper.resolveObject(connection);
  }
  File tdqMetadataFile=getWorkspacePath().append(OLD_MEATADATA_FOLDER_NAME).toFile();
  if (tdqMetadataFile.exists()) {
    FileUtils.deleteDirectory(tdqMetadataFile);
  }
  File fileAnalysis=getWorkspacePath().append(EResourceConstant.ANALYSIS.getPath()).toFile();
  File fileRule=getWorkspacePath().append(EResourceConstant.RULES.getPath()).toFile();
  try {
    String[] anaFileExtentionNames={FactoriesUtil.ANA};
    String[] rulesFileEctentionNames={FactoriesUtil.DQRULE};
    result&=FilesUtils.migrateFolder(fileAnalysis,anaFileExtentionNames,this.getReplaceStringMap(),log) && FilesUtils.migrateFolder(fileRule,rulesFileEctentionNames,this.getReplaceStringMap(),log);
    AnaResourceFileHelper.getInstance().clear();
    AnaResourceFileHelper.getInstance().getAllAnalysis();
    ResourceService.refreshStructure();
  }
 catch (  Exception e) {
    result=false;
    log.error(e,e);
  }
  return result;
}

Fixed version (ground truth):
@Override protected boolean doExecute() throws Exception {
  boolean result=true;
  Map<File,File> folderMap=initStructure();
  for (  File folder : folderMap.keySet()) {
    try {
      tansferFile(folder,folderMap);
    }
 catch (    Exception e) {
      log.error(e,e);
    }
  }
  File srcMdmXsdFolder=getWorkspacePath().append(ExchangeFileNameToReferenceTask.MDM_CONNECTION + IPath.SEPARATOR + "String_Node_Str").toFile();
  File tarMdmXsdFolder=getWorkspacePath().append(ERepositoryObjectType.getFolderName(ERepositoryObjectType.METADATA_MDMCONNECTION) + IPath.SEPARATOR + "String_Node_Str").toFile();
  FilesUtils.copyFolder(srcMdmXsdFolder,tarMdmXsdFolder,true,null,null,true,null);
  File mdmConnectionFolder=new File(ResourceManager.getMDMConnectionFolder().getRawLocationURI());
  final String[] metadataFileExtentionNames={"String_Node_Str"};
  UpdateMDMConnectionXSDPathTask.doUpdate(true,true,mdmConnectionFolder,metadataFileExtentionNames);
  ArrayList<File> fileList=new ArrayList<File>();
  FilesUtils.getAllFilesFromFolder(mdmConnectionFolder,fileList,new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      if (name.endsWith("String_Node_Str")) {
        return true;
      }
      return false;
    }
  }
);
  for (  File file : fileList) {
    TypedReturnCode<Connection> findProvider=PrvResourceFileHelper.getInstance().findProvider(WorkspaceUtils.fileToIFile(file));
    Connection connection=findProvider.getObject();
    connection.eResource().unload();
    EObjectHelper.resolveObject(connection);
  }
  File tdqMetadataFile=getWorkspacePath().append(OLD_MEATADATA_FOLDER_NAME).toFile();
  if (tdqMetadataFile.exists()) {
    FileUtils.deleteDirectory(tdqMetadataFile);
  }
  File fileAnalysis=getWorkspacePath().append(EResourceConstant.ANALYSIS.getPath()).toFile();
  File fileRule=getWorkspacePath().append(EResourceConstant.RULES.getPath()).toFile();
  try {
    String[] anaFileExtentionNames={FactoriesUtil.ANA};
    String[] rulesFileEctentionNames={FactoriesUtil.DQRULE};
    result&=FilesUtils.migrateFolder(fileAnalysis,anaFileExtentionNames,this.getReplaceStringMap(),log) && FilesUtils.migrateFolder(fileRule,rulesFileEctentionNames,this.getReplaceStringMap(),log);
  }
 catch (  Exception e) {
    result=false;
    log.error(e,e);
  }
  return result;
}