Program: 137935
Project: 137935
Buggy source:
public void moveFolderRepNode(IRepositoryNode sourceNode,IRepositoryNode targetNode) throws PersistenceException {
  if (sourceNode instanceof JrxmlTempSubFolderNode) {
    MessageUI.openWarning(DefaultMessagesImpl.getString("String_Node_Str"));
    return;
  }
  if (sourceNode instanceof SourceFileSubFolderNode) {
    SourceFileSubFolderNode folderNode=(SourceFileSubFolderNode)sourceNode;
    ReturnCode rc=WorkspaceResourceHelper.checkSourceFileSubFolderNodeOpening(folderNode);
    if (rc.isOk()) {
      WorkspaceResourceHelper.showSourceFilesOpeningWarnMessages(rc.getMessage());
      return;
    }
  }
  if (!canMoveNode(sourceNode,targetNode)) {
    return;
  }
  boolean isReportSubFolderRepNode=sourceNode instanceof ReportSubFolderRepNode;
  Map<IFolder,IFolder> reportGenDocInfoMap=new HashMap<IFolder,IFolder>();
  IFolder folder=null;
  File tarFile=null;
  if (isReportSubFolderRepNode) {
    String tempFolderName=StringUtilities.getRandomString(8);
    folder=RepositoryNodeHelper.getIFolder(sourceNode);
    File srcFile=WorkspaceUtils.ifolderToFile(folder);
    tarFile=WorkspaceUtils.ifolderToFile(folder.getParent().getFolder(new Path(tempFolderName)));
    if (!tarFile.exists()) {
      tarFile.mkdirs();
    }
    if (srcFile.exists() && tarFile.exists()) {
      FilesUtils.copyDirectory(srcFile,tarFile);
    }
    IFolder sourceFolder=RepositoryNodeHelper.getIFolder(sourceNode);
    IFolder targetFolder=RepositoryNodeHelper.getIFolder(targetNode);
    List<ReportRepNode> reportRepNodeList=new ArrayList<ReportRepNode>();
    getAllReportRepNode((ReportSubFolderRepNode)sourceNode,reportRepNodeList);
    if (!reportRepNodeList.isEmpty()) {
      buildReportGenDocInfoMap(reportRepNodeList,sourceFolder,targetFolder,reportGenDocInfoMap);
    }
  }
  RepositoryNodeBuilder instance=RepositoryNodeBuilder.getInstance();
  FolderHelper folderHelper=instance.getFolderHelper();
  IPath sourcePath=WorkbenchUtils.getPath((RepositoryNode)sourceNode);
  IPath targetPath=WorkbenchUtils.getPath((RepositoryNode)targetNode);
  ERepositoryObjectType objectType=targetNode.getContentType();
  IPath nodeFullPath=this.getNodeFullPath(objectType);
  IPath makeRelativeTo=nodeFullPath.makeRelativeTo(ResourceManager.getRootProject().getFullPath());
  computePath(folderHelper,sourcePath,targetPath,makeRelativeTo,objectType,sourceNode,targetNode);
  if (isReportSubFolderRepNode) {
    if (tarFile != null) {
      File file1=new File(tarFile.getAbsolutePath() + IPath.SEPARATOR + sourceNode.getLabel());
      File file2=WorkspaceUtils.ifolderToFile(RepositoryNodeHelper.getIFolder(targetNode).getFolder(new Path(sourceNode.getLabel())));
      ReportUtils.moveHiddenFolders(file1,file2);
      FilesUtils.deleteFile(tarFile,Boolean.TRUE);
    }
    if (!reportGenDocInfoMap.isEmpty()) {
      for (      IFolder outputFolder : reportGenDocInfoMap.keySet()) {
        ReportUtils.updateReportListFile(outputFolder,reportGenDocInfoMap.get(outputFolder));
      }
    }
  }
}

Fixed version (ground truth):
public void moveFolderRepNode(IRepositoryNode sourceNode,IRepositoryNode targetNode) throws PersistenceException {
  if (sourceNode instanceof JrxmlTempSubFolderNode) {
    MessageUI.openWarning(DefaultMessagesImpl.getString("String_Node_Str"));
    return;
  }
  if (sourceNode instanceof SourceFileSubFolderNode) {
    SourceFileSubFolderNode folderNode=(SourceFileSubFolderNode)sourceNode;
    ReturnCode rc=WorkspaceResourceHelper.checkSourceFileSubFolderNodeOpening(folderNode);
    if (rc.isOk()) {
      WorkspaceResourceHelper.showSourceFilesOpeningWarnMessages(rc.getMessage());
      return;
    }
  }
  if (!canMoveNode(sourceNode,targetNode)) {
    return;
  }
  boolean isReportSubFolderRepNode=sourceNode instanceof ReportSubFolderRepNode;
  Map<IFolder,IFolder> reportGenDocInfoMap=new HashMap<IFolder,IFolder>();
  IFolder folder=null;
  File tarFile=null;
  if (isReportSubFolderRepNode) {
    String tempFolderName=StringUtilities.getRandomString(8);
    folder=RepositoryNodeHelper.getIFolder(sourceNode);
    File srcFile=WorkspaceUtils.ifolderToFile(folder);
    tarFile=WorkspaceUtils.ifolderToFile(folder.getParent().getFolder(new Path(tempFolderName)));
    if (!tarFile.exists()) {
      tarFile.mkdirs();
    }
    if (srcFile.exists() && tarFile.exists()) {
      FilesUtils.copyDirectory(srcFile,tarFile);
    }
    IFolder sourceFolder=RepositoryNodeHelper.getIFolder(sourceNode);
    IFolder targetFolder=RepositoryNodeHelper.getIFolder(targetNode);
    List<ReportRepNode> reportRepNodeList=new ArrayList<ReportRepNode>();
    getAllReportRepNode((ReportSubFolderRepNode)sourceNode,reportRepNodeList);
    if (!reportRepNodeList.isEmpty()) {
      buildReportGenDocInfoMap(reportRepNodeList,sourceFolder,targetFolder,reportGenDocInfoMap);
    }
  }
  RepositoryNodeBuilder instance=RepositoryNodeBuilder.getInstance();
  FolderHelper folderHelper=instance.getFolderHelper();
  IPath sourcePath=WorkbenchUtils.getPath(sourceNode);
  IPath targetPath=WorkbenchUtils.getPath(targetNode);
  ERepositoryObjectType objectType=targetNode.getContentType();
  IPath nodeFullPath=this.getNodeFullPath(objectType);
  IPath makeRelativeTo=nodeFullPath.makeRelativeTo(ResourceManager.getRootProject().getFullPath());
  computePath(folderHelper,sourcePath,targetPath,makeRelativeTo,objectType,sourceNode,targetNode);
  if (isReportSubFolderRepNode) {
    if (tarFile != null) {
      File file1=new File(tarFile.getAbsolutePath() + IPath.SEPARATOR + sourceNode.getLabel());
      File file2=WorkspaceUtils.ifolderToFile(RepositoryNodeHelper.getIFolder(targetNode).getFolder(new Path(sourceNode.getLabel())));
      ReportUtils.moveHiddenFolders(file1,file2);
      FilesUtils.deleteFile(tarFile,Boolean.TRUE);
    }
    if (!reportGenDocInfoMap.isEmpty()) {
      for (      IFolder outputFolder : reportGenDocInfoMap.keySet()) {
        ReportUtils.updateReportListFile(outputFolder,reportGenDocInfoMap.get(outputFolder));
      }
    }
  }
}