nus-yam/ex-repair huggingface dataset:
Program: 139059
Project: 139059
Buggy source:
/** 
 * DOC sgandon Comment method "dirTextModified".
 */
protected void dirTextModified(){
  File file=new File(dirTxt.getText());
  if (file.exists()) {
    repositoryTree.setInput(file);
    repositoryTree.expandAll();
    TreeItem[] topItems=repositoryTree.getTree().getItems();
    for (    TreeItem treeItem : topItems) {
      repositoryTree.setSubtreeChecked(treeItem.getData(),true);
    }
    repositoryTree.getTree().setEnabled(false);
    repositoryTree.refresh();
  }
 else {
    repositoryTree.setInput(null);
  }
  checkforErrors();
  updatePageStatus();
}

Fixed version (ground truth):
/** 
 * DOC sgandon Comment method "dirTextModified".
 */
protected void dirTextModified(){
  File file=new File(dirTxt.getText());
  if (file.exists()) {
    repositoryTree.setInput(file);
    repositoryTree.expandAll();
    TreeItem[] topItems=repositoryTree.getTree().getItems();
    for (    TreeItem treeItem : topItems) {
      repositoryTree.setSubtreeChecked(treeItem.getData(),true);
    }
    repositoryTree.getTree().setEnabled(true);
    repositoryTree.refresh();
  }
 else {
    repositoryTree.setInput(null);
  }
  checkforErrors();
  updatePageStatus();
}
Program: 139060
Project: 139060
Buggy source:
public void finish(ItemRecord[] records) throws IOException {
  if (PluginChecker.isTDCPLoaded()) {
    IPath projResPath=ResourceManager.getRootProject().getLocation().append("String_Node_Str");
    IPath projDesPath=new Path(destination).append(ResourceManager.getRootProjectName()).append("String_Node_Str");
    File projFile=projResPath.toFile();
    if (projFile.exists()) {
      copyFile(projFile,projDesPath.toFile());
    }
  }
}

Fixed version (ground truth):
public void finish(ItemRecord[] records) throws IOException {
  if (PluginChecker.isTDCPLoaded()) {
    IFile projFile=ResourceManager.getRootProject().getFile("String_Node_Str");
    copyFileToDest(projFile);
  }
  IFile versionFile=WorkspaceVersionHelper.getVersionFile();
  copyFileToDest(versionFile);
}
Program: 139061
Project: 139061
Buggy source:
public ItemRecord[] populate(ItemRecord[] elements,boolean checkExisted){
  List<ItemRecord> inValidRecords=new ArrayList<ItemRecord>();
  if (elements instanceof ItemRecord[]) {
    ItemRecord[] recoreds=(ItemRecord[])elements;
    for (    ItemRecord record : recoreds) {
      checkDependency(record);
      if (checkExisted) {
        checkExisted(record);
      }
      if (!record.isValid()) {
        inValidRecords.add(record);
      }
    }
  }
  return inValidRecords.toArray(new ItemRecord[inValidRecords.size()]);
}

Fixed version (ground truth):
public ItemRecord[] populate(ItemRecord[] elements,boolean checkExisted){
  List<ItemRecord> inValidRecords=new ArrayList<ItemRecord>();
  for (  ItemRecord record : elements) {
    checkDependency(record);
    if (checkExisted) {
      checkExisted(record);
    }
    if (!record.isValid()) {
      inValidRecords.add(record);
    }
  }
  if (elements.length != 0) {
    ItemRecord anyRecord=elements[0];
    String path=anyRecord.getFile().getAbsolutePath();
    String subStr=StringUtils.substringBeforeLast(path,anyRecord.getProjectName());
    String versionPath=subStr + anyRecord.getProjectName() + "String_Node_Str";
    versionFile=new File(versionPath);
  }
  return inValidRecords.toArray(new ItemRecord[inValidRecords.size()]);
}
Program: 139062
Project: 139062
Buggy source:
public void finish(ItemRecord[] records) throws IOException {
  for (  ItemRecord record : records) {
    record.clear();
  }
  IFile defintionFile=ResourceManager.getLibrariesFolder().getFile("String_Node_Str");
  if (!defintionFile.exists()) {
    DefinitionHandler.getInstance();
  }
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      CorePlugin.getDefault().refreshWorkSpace();
      CorePlugin.getDefault().refreshDQView();
    }
  }
);
}

Fixed version (ground truth):
public void finish(ItemRecord[] records) throws IOException {
  for (  ItemRecord record : records) {
    record.clear();
  }
  IFile defintionFile=ResourceManager.getLibrariesFolder().getFile("String_Node_Str");
  if (!defintionFile.exists()) {
    DefinitionHandler.getInstance();
  }
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (versionFile != null) {
        ProductVersion version=WorkspaceVersionHelper.getVesion(versionFile);
        List<IMigrationTask> migrationTasks=MigrationTaskManager.findWorkspaceTaskByType(MigrationTaskType.FILE,version);
        MigrationTaskManager.doMigrationTask(migrationTasks);
      }
      CorePlugin.getDefault().refreshWorkSpace();
      CorePlugin.getDefault().refreshDQView();
    }
  }
);
}
Program: 139063
Project: 139063
Buggy source:
public void run(){
  CorePlugin.getDefault().refreshWorkSpace();
  CorePlugin.getDefault().refreshDQView();
}

Fixed version (ground truth):
public void run(){
  if (versionFile != null) {
    ProductVersion version=WorkspaceVersionHelper.getVesion(versionFile);
    List<IMigrationTask> migrationTasks=MigrationTaskManager.findWorkspaceTaskByType(MigrationTaskType.FILE,version);
    MigrationTaskManager.doMigrationTask(migrationTasks);
  }
  CorePlugin.getDefault().refreshWorkSpace();
  CorePlugin.getDefault().refreshDQView();
}
Program: 139064
Project: 139064
Buggy source:
public void write(ItemRecord record,String destination) throws IOException, CoreException {
  IPath itemPath=PropertyHelper.getElementPath(record.getProperty());
  IPath itemDesPath=ResourcesPlugin.getWorkspace().getRoot().getFile(itemPath).getLocation();
  IPath propDesPath=itemDesPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  Map<IPath,IPath> resMap=new HashMap<IPath,IPath>();
  resMap.put(record.getFilePath(),itemDesPath);
  resMap.put(record.getPropertyPath(),propDesPath);
  for (  IPath resPath : resMap.keySet()) {
    File resFile=resPath.toFile();
    File desFile=resMap.get(resPath).toFile();
    if (desFile.exists()) {
      log.warn(desFile.getAbsoluteFile() + "String_Node_Str");
    }
    FilesUtils.copyFile(resFile,desFile);
    String oldProjectLabel=record.getProjectName();
    String curProjectLabel=ResourceManager.getRootProjectName();
    if (!StringUtils.equals(oldProjectLabel,curProjectLabel)) {
      String content=FileUtils.readFileToString(desFile);
      content=StringUtils.replace(content,"String_Node_Str" + oldProjectLabel + "String_Node_Str","String_Node_Str" + curProjectLabel + "String_Node_Str");
      FileUtils.writeStringToFile(desFile,content,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void write(ItemRecord record,String destination) throws IOException, CoreException {
  IPath itemPath=PropertyHelper.getElementPath(record.getProperty());
  IPath itemDesPath=ResourcesPlugin.getWorkspace().getRoot().getFile(itemPath).getLocation();
  IPath propDesPath=itemDesPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  Map<IPath,IPath> resMap=new HashMap<IPath,IPath>();
  resMap.put(record.getFilePath(),itemDesPath);
  resMap.put(record.getPropertyPath(),propDesPath);
  for (  IPath resPath : resMap.keySet()) {
    File resFile=resPath.toFile();
    File desFile=resMap.get(resPath).toFile();
    if (desFile.exists()) {
      log.warn(desFile.getAbsoluteFile() + "String_Node_Str");
    }
    FilesUtils.copyFile(resFile,desFile);
    String oldProjectLabel=record.getProjectName();
    String curProjectLabel=ResourceManager.getRootProjectName();
    if (!StringUtils.equals(oldProjectLabel,curProjectLabel)) {
      String content=FileUtils.readFileToString(desFile,"String_Node_Str");
      content=StringUtils.replace(content,"String_Node_Str" + oldProjectLabel + "String_Node_Str","String_Node_Str" + curProjectLabel + "String_Node_Str");
      FileUtils.writeStringToFile(desFile,content,"String_Node_Str");
    }
  }
}
Program: 139065
Project: 139065
Buggy source:
/** 
 * DOC bZhou Comment method "getProjectName".
 * @return
 */
public String getProjectName(){
  if (projectName == null && property != null) {
    InternalEObject author=(InternalEObject)property.getAuthor();
    if (author != null) {
      Resource projResource=author.eResource();
      if (projResource != null) {
        URI projectUri=projResource.getURI();
        IPath projectPath=new Path(projectUri.toFileString());
        if (projectPath.toFile().exists()) {
          Object projOBJ=EObjectHelper.retrieveEObject(projectPath,PropertiesPackage.eINSTANCE.getProject());
          if (projOBJ != null) {
            Project project=(Project)projOBJ;
            this.projectName=project.getLabel();
          }
        }
      }
    }
  }
  return this.projectName == null ? ReponsitoryContextBridge.PROJECT_DEFAULT_NAME : this.projectName;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getProjectName".
 * @return
 */
public String getProjectName(){
  if (projectName == null && property != null) {
    InternalEObject author=(InternalEObject)property.getAuthor();
    if (author != null) {
      Resource projResource=author.eResource();
      if (projResource != null) {
        URI projectUri=projResource.getURI();
        IPath projectPath=new Path(projectUri.toFileString());
        if (projectPath.toFile().exists()) {
          Object projOBJ=EObjectHelper.retrieveEObject(projectPath,PropertiesPackage.eINSTANCE.getProject());
          if (projOBJ != null) {
            Project project=(Project)projOBJ;
            this.projectName=project.getTechnicalLabel();
          }
        }
      }
    }
  }
  return this.projectName == null ? ReponsitoryContextBridge.PROJECT_DEFAULT_NAME : this.projectName;
}
Program: 139066
Project: 139066
Buggy source:
/** 
 * DOC bZhou Comment method "getProperty".
 * @param propertyFile
 * @return Null if can't find.
 */
public static Property getProperty(IFile propertyFile){
  URI propURI=URI.createPlatformResourceURI(propertyFile.getFullPath().toString(),false);
  Resource resource=EMFSharedResources.getInstance().getResource(propURI,true);
  if (resource.getContents().isEmpty()) {
    resource=new ResourceSetImpl().getResource(propURI,true);
  }
  if (resource.getContents() != null) {
    Object object=EcoreUtil.getObjectByType(resource.getContents(),PropertiesPackage.eINSTANCE.getProperty());
    if (object != null) {
      return (Property)object;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getProperty".
 * @param element
 * @return
 */
public static Property getProperty(ModelElement element){
  IFile propertyFile=PropertyHelper.getPropertyFile(element);
  return propertyFile != null ? getProperty(propertyFile) : null;
}
Program: 139067
Project: 139067
Buggy source:
public ReturnCode serialize(Property property,URI uri){
  ReturnCode rc=new ReturnCode();
  URI propertiesURI=uri.trimFileExtension().appendFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  Resource propertyResource=util.createResource(propertiesURI);
  propertyResource.getContents().add(property);
  propertyResource.getContents().add(property.getItem());
  propertyResource.getContents().add(property.getItem().getState());
  rc.setOk(util.saveResource(propertyResource));
  return rc;
}

Fixed version (ground truth):
public ReturnCode serialize(Property property,URI uri){
  ReturnCode rc=new ReturnCode();
  URI propertiesURI=uri.trimFileExtension().appendFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  Resource propertyResource=property.eResource();
  if (propertyResource == null) {
    propertyResource=util.createResource(propertiesURI);
  }
  propertyResource.getContents().add(property);
  propertyResource.getContents().add(property.getItem());
  propertyResource.getContents().add(property.getItem().getState());
  rc.setOk(util.saveResource(propertyResource));
  return rc;
}
Program: 139068
Project: 139068
Buggy source:
/** 
 * DOC bZhou Comment method "savePerperties".
 * @param element
 */
public void savePerperties(ModelElement element){
  Resource resource=element.eResource();
  String fileName=resource.getURI().lastSegment();
  Property property=initProperty(element);
  TDQItem item=initItem(element,property);
  item.setFilename(fileName);
  URI uri=element.eResource().getURI();
  serialize(property,uri);
  String propertyPath=property.eResource().getURI().toPlatformString(true);
  MetadataHelper.setPropertyPath(propertyPath,element);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "savePerperties".
 * @param element
 */
public void savePerperties(ModelElement element){
  Resource resource=element.eResource();
  String fileName=resource.getURI().lastSegment();
  Property property=PropertyHelper.getProperty(element);
  if (property == null) {
    property=initProperty(element);
  }
  Item item=property.getItem();
  if (item == null) {
    item=initItem(element,property);
  }
  ((TDQItem)item).setFilename(fileName);
  URI uri=element.eResource().getURI();
  serialize(property,uri);
  String propertyPath=property.eResource().getURI().toPlatformString(true);
  MetadataHelper.setPropertyPath(propertyPath,element);
}
Program: 139069
Project: 139069
Buggy source:
private Runnable getRefreshRunnable(final Resource resource){
  return new Runnable(){
    public void run(){
      IFile propertyFile=getPropertyFile(resource);
      if (propertyFile != null) {
        Resource propertyResource=RepResourceFileHelper.getInstance().getFileResource(propertyFile);
        updateProperty(resource,propertyResource);
        updateElement(resource,propertyResource);
      }
    }
  }
;
}

Fixed version (ground truth):
private Runnable getRefreshRunnable(final Resource resource){
  return new Runnable(){
    public void run(){
      IFile propertyFile=PropertyHelper.getPropertyFile(resource);
      if (propertyFile != null) {
        Resource propertyResource=RepResourceFileHelper.getInstance().getFileResource(propertyFile);
        updateProperty(resource,propertyResource);
        updateElement(resource,propertyResource);
      }
    }
  }
;
}
Program: 139070
Project: 139070
Buggy source:
public void run(){
  IFile propertyFile=getPropertyFile(resource);
  if (propertyFile != null) {
    Resource propertyResource=RepResourceFileHelper.getInstance().getFileResource(propertyFile);
    updateProperty(resource,propertyResource);
    updateElement(resource,propertyResource);
  }
}

Fixed version (ground truth):
public void run(){
  IFile propertyFile=PropertyHelper.getPropertyFile(resource);
  if (propertyFile != null) {
    Resource propertyResource=RepResourceFileHelper.getInstance().getFileResource(propertyFile);
    updateProperty(resource,propertyResource);
    updateElement(resource,propertyResource);
  }
}
Program: 139071
Project: 139071
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str",records.length);
  try {
    for (    ItemRecord record : records) {
      if (monitor.isCanceled()) {
        break;
      }
      monitor.subTask("String_Node_Str" + record.getElement().getName());
      if (record.isValid()) {
        log.info("String_Node_Str" + record.getFile().getAbsolutePath());
        writer.write(record,destPath);
      }
 else {
        for (        String error : record.getErrors()) {
          log.error(error);
        }
      }
      monitor.worked(1);
    }
    writer.finish(records);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  monitor.done();
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str",records.length);
  try {
    for (    ItemRecord record : records) {
      if (monitor.isCanceled()) {
        break;
      }
      monitor.subTask("String_Node_Str" + record.getElement().getName());
      if (record.isValid()) {
        log.info("String_Node_Str" + record.getFile().getAbsolutePath());
        writer.write(record);
      }
 else {
        for (        String error : record.getErrors()) {
          log.error(error);
        }
      }
      monitor.worked(1);
    }
    writer.finish(records);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  monitor.done();
}
Program: 139072
Project: 139072
Buggy source:
/** 
 * DOC bZhou ExportWizard constructor comment.
 */
public ExportWizard(EImexType type,String specifiedPath){
  setWindowTitle("String_Node_Str");
  this.exportPage=new ExportWizardPage(specifiedPath);
  this.writer=ExportWriterFactory.create(type);
}

Fixed version (ground truth):
/** 
 * DOC bZhou ExportWizard constructor comment.
 */
public ExportWizard(EImexType type,String specifiedPath){
  setWindowTitle("String_Node_Str");
  this.writer=ExportWriterFactory.create(type);
  this.exportPage=new ExportWizardPage(writer,specifiedPath);
}
Program: 139073
Project: 139073
Buggy source:
@Override public boolean performFinish(){
  final String destPath=exportPage.getFilePath();
  final ItemRecord[] records=exportPage.getElements();
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",records.length);
      try {
        for (        ItemRecord record : records) {
          if (monitor.isCanceled()) {
            break;
          }
          monitor.subTask("String_Node_Str" + record.getElement().getName());
          if (record.isValid()) {
            log.info("String_Node_Str" + record.getFile().getAbsolutePath());
            writer.write(record,destPath);
          }
 else {
            for (            String error : record.getErrors()) {
              log.error(error);
            }
          }
          monitor.worked(1);
        }
        writer.finish(records);
      }
 catch (      Exception e) {
        log.error(e,e);
      }
      monitor.done();
    }
  }
;
  try {
    ProgressUI.popProgressDialog(op);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  final ItemRecord[] records=exportPage.getElements();
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",records.length);
      try {
        for (        ItemRecord record : records) {
          if (monitor.isCanceled()) {
            break;
          }
          monitor.subTask("String_Node_Str" + record.getElement().getName());
          if (record.isValid()) {
            log.info("String_Node_Str" + record.getFile().getAbsolutePath());
            writer.write(record);
          }
 else {
            for (            String error : record.getErrors()) {
              log.error(error);
            }
          }
          monitor.worked(1);
        }
        writer.finish(records);
      }
 catch (      Exception e) {
        log.error(e,e);
      }
      monitor.done();
    }
  }
;
  try {
    ProgressUI.popProgressDialog(op);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return true;
}
Program: 139074
Project: 139074
Buggy source:
public ExportWizardPage(String specifiedPath){
  super(Messages.getString("String_Node_Str"));
  setMessage(Messages.getString("String_Node_Str"));
  this.specifiedPath=specifiedPath;
}

Fixed version (ground truth):
public ExportWizardPage(IImexWriter writer,String specifiedPath){
  super(Messages.getString("String_Node_Str"));
  setMessage(Messages.getString("String_Node_Str"));
  this.writer=writer;
  this.specifiedPath=specifiedPath;
}
Program: 139075
Project: 139075
Buggy source:
public void modifyText(ModifyEvent e){
  checkForErrors();
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  writer.setBasePath(dirTxt.getText());
  checkForErrors();
}
Program: 139077
Project: 139077
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str",records.length);
  try {
    for (    ItemRecord record : records) {
      if (monitor.isCanceled()) {
        break;
      }
      monitor.subTask("String_Node_Str" + record.getElement().getName());
      if (record.isValid()) {
        log.info("String_Node_Str" + record.getFile().getAbsolutePath());
        writer.write(record,null);
      }
      monitor.worked(1);
    }
    writer.finish(records);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  monitor.done();
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str",records.length);
  try {
    for (    ItemRecord record : records) {
      if (monitor.isCanceled()) {
        break;
      }
      monitor.subTask("String_Node_Str" + record.getElement().getName());
      if (record.isValid()) {
        log.info("String_Node_Str" + record.getFile().getAbsolutePath());
        writer.write(record);
      }
      monitor.worked(1);
    }
    writer.finish(records);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  monitor.done();
}
Program: 139078
Project: 139078
Buggy source:
@Override public boolean performFinish(){
  final ItemRecord[] records=importPage.getElements();
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",records.length);
      try {
        for (        ItemRecord record : records) {
          if (monitor.isCanceled()) {
            break;
          }
          monitor.subTask("String_Node_Str" + record.getElement().getName());
          if (record.isValid()) {
            log.info("String_Node_Str" + record.getFile().getAbsolutePath());
            writer.write(record,null);
          }
          monitor.worked(1);
        }
        writer.finish(records);
      }
 catch (      Exception e) {
        log.error(e,e);
      }
      monitor.done();
    }
  }
;
  try {
    ProgressUI.popProgressDialog(op);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  final ItemRecord[] records=importPage.getElements();
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",records.length);
      try {
        for (        ItemRecord record : records) {
          if (monitor.isCanceled()) {
            break;
          }
          monitor.subTask("String_Node_Str" + record.getElement().getName());
          if (record.isValid()) {
            log.info("String_Node_Str" + record.getFile().getAbsolutePath());
            writer.write(record);
          }
          monitor.worked(1);
        }
        writer.finish(records);
      }
 catch (      Exception e) {
        log.error(e,e);
      }
      monitor.done();
    }
  }
;
  try {
    ProgressUI.popProgressDialog(op);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return true;
}
Program: 139079
Project: 139079
Buggy source:
/** 
 * DOC sgandon Comment method "dirTextModified".
 */
protected void dirTextModified(){
  File file=new File(dirTxt.getText());
  if (file.exists()) {
    repositoryTree.setInput(file);
    repositoryTree.expandAll();
    TreeItem[] topItems=repositoryTree.getTree().getItems();
    for (    TreeItem treeItem : topItems) {
      repositoryTree.setSubtreeChecked(treeItem.getData(),true);
    }
    repositoryTree.getTree().setEnabled(true);
    repositoryTree.refresh();
  }
 else {
    repositoryTree.setInput(null);
  }
  checkforErrors();
  updatePageStatus();
}

Fixed version (ground truth):
/** 
 * DOC sgandon Comment method "dirTextModified".
 */
protected void dirTextModified(){
  File file=new File(dirTxt.getText());
  if (file.exists()) {
    repositoryTree.setInput(file);
    repositoryTree.expandAll();
    TreeItem[] topItems=repositoryTree.getTree().getItems();
    for (    TreeItem treeItem : topItems) {
      repositoryTree.setSubtreeChecked(treeItem.getData(),true);
    }
    repositoryTree.refresh();
    writer.setBasePath(dirTxt.getText());
  }
 else {
    repositoryTree.setInput(null);
  }
  checkforErrors();
}
Program: 139080
Project: 139080
Buggy source:
/** 
 * update the page state that is the finish button enable state according to the error message being present or not.
 */
private void updatePageStatus(){
  setPageComplete(getErrorMessage() == null);
}

Fixed version (ground truth):
/** 
 * update the page state that is the finish button enable state according to the error message being present or not.
 */
private void updatePageStatus(){
  boolean valid=getErrorMessage() == null;
  setPageComplete(valid);
  repositoryTree.getTree().setEnabled(valid);
}
Program: 139081
Project: 139081
Buggy source:
/** 
 * check that directory exist and issue an error message if not. <br> check that the folder is a data quality repository or issue an error.<br> check that anything is check in the tree or issue an error.<br>
 */
private void checkforErrors(){
  if (!new File(dirTxt.getText()).exists()) {
    setErrorMessage(Messages.getString("String_Node_Str"));
  }
 else   if (repositoryTree.getTree().getItems().length == 0) {
    setErrorMessage(Messages.getString("String_Node_Str"));
  }
 else   if (repositoryTree.getCheckedElements().length == 0) {
    setErrorMessage(Messages.getString("String_Node_Str"));
  }
 else {
    setErrorMessage(null);
  }
}

Fixed version (ground truth):
/** 
 * check that directory exist and issue an error message if not. <br> check that the folder is a data quality repository or issue an error.<br> check that anything is check in the tree or issue an error.<br>
 */
private void checkforErrors(){
  IPath dirPath=new Path(dirTxt.getText());
  if (!dirPath.toFile().exists()) {
    setErrorMessage(Messages.getString("String_Node_Str"));
  }
 else   if (repositoryTree.getTree().getItems().length == 0) {
    setErrorMessage(Messages.getString("String_Node_Str"));
  }
 else   if (repositoryTree.getCheckedElements().length == 0) {
    setErrorMessage(Messages.getString("String_Node_Str"));
  }
 else {
    IPath versionPath=dirPath.append(EResourceConstant.LIBRARIES.getPath()).append("String_Node_Str");
    if (!versionPath.toFile().exists()) {
      setErrorMessage("String_Node_Str");
    }
 else {
      setErrorMessage(null);
    }
  }
  updatePageStatus();
}
Program: 139082
Project: 139082
Buggy source:
/** 
 * DOC bZhou Comment method "copyFileToDest".
 * @param source
 * @throws IOException
 */
private void copyFileToDest(IFile source) throws IOException {
  IPath desPath=new Path(destination).append(source.getFullPath());
  if (source.exists()) {
    copyFile(source.getLocation().toFile(),desPath.toFile());
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "copyFileToDest".
 * @param source
 * @throws IOException
 */
private void copyFileToDest(IFile source) throws IOException {
  IPath desPath=new Path(basePath).append(source.getFullPath());
  if (source.exists()) {
    copyFile(source.getLocation().toFile(),desPath.toFile());
  }
}
Program: 139083
Project: 139083
Buggy source:
public void write(ItemRecord recored,String destination) throws IOException, CoreException {
  this.destination=destination;
  IPath itemDesPath=new Path(destination).append(recored.getFullPath());
  IPath propDesPath=itemDesPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  File resItemFile=recored.getFile();
  File desItemFile=itemDesPath.toFile();
  copyFile(resItemFile,desItemFile);
  File resPropFile=recored.getPropertyPath().toFile();
  File desPropFile=propDesPath.toFile();
  copyFile(resPropFile,desPropFile);
}

Fixed version (ground truth):
public void write(ItemRecord recored) throws IOException, CoreException {
  IPath itemDesPath=new Path(basePath).append(recored.getFullPath());
  IPath propDesPath=itemDesPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  File resItemFile=recored.getFile();
  File desItemFile=itemDesPath.toFile();
  copyFile(resItemFile,desItemFile);
  File resPropFile=recored.getPropertyPath().toFile();
  File desPropFile=propDesPath.toFile();
  copyFile(resPropFile,desPropFile);
}
Program: 139084
Project: 139084
Buggy source:
public ItemRecord[] populate(ItemRecord[] elements,boolean checkExisted){
  List<ItemRecord> inValidRecords=new ArrayList<ItemRecord>();
  for (  ItemRecord record : elements) {
    checkDependency(record);
    if (checkExisted) {
      checkExisted(record);
    }
    if (!record.isValid()) {
      inValidRecords.add(record);
    }
  }
  if (elements.length != 0) {
    ItemRecord anyRecord=elements[0];
    String path=anyRecord.getFile().getAbsolutePath();
    String subStr=StringUtils.substringBeforeLast(path,anyRecord.getProjectName());
    String versionPath=subStr + anyRecord.getProjectName() + "String_Node_Str";
    versionFile=new File(versionPath);
  }
  return inValidRecords.toArray(new ItemRecord[inValidRecords.size()]);
}

Fixed version (ground truth):
public ItemRecord[] populate(ItemRecord[] elements,boolean checkExisted){
  List<ItemRecord> inValidRecords=new ArrayList<ItemRecord>();
  for (  ItemRecord record : elements) {
    checkDependency(record);
    if (checkExisted) {
      checkExisted(record);
    }
    if (!record.isValid()) {
      inValidRecords.add(record);
    }
  }
  if (elements.length != 0) {
    ItemRecord anyRecord=elements[0];
    retrieveProjectName(anyRecord);
  }
  versionFile=new Path(basePath).append("String_Node_Str").toFile();
  return inValidRecords.toArray(new ItemRecord[inValidRecords.size()]);
}
Program: 139085
Project: 139085
Buggy source:
public void write(ItemRecord record,String destination) throws IOException, CoreException {
  IPath itemPath=PropertyHelper.getElementPath(record.getProperty());
  IPath itemDesPath=ResourcesPlugin.getWorkspace().getRoot().getFile(itemPath).getLocation();
  IPath propDesPath=itemDesPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  Map<IPath,IPath> resMap=new HashMap<IPath,IPath>();
  resMap.put(record.getFilePath(),itemDesPath);
  resMap.put(record.getPropertyPath(),propDesPath);
  for (  IPath resPath : resMap.keySet()) {
    File resFile=resPath.toFile();
    File desFile=resMap.get(resPath).toFile();
    if (desFile.exists()) {
      log.warn(desFile.getAbsoluteFile() + "String_Node_Str");
    }
    FilesUtils.copyFile(resFile,desFile);
    String oldProjectLabel=record.getProjectName();
    String curProjectLabel=ResourceManager.getRootProjectName();
    if (!StringUtils.equals(oldProjectLabel,curProjectLabel)) {
      String content=FileUtils.readFileToString(desFile,"String_Node_Str");
      content=StringUtils.replace(content,"String_Node_Str" + oldProjectLabel + "String_Node_Str","String_Node_Str" + curProjectLabel + "String_Node_Str");
      FileUtils.writeStringToFile(desFile,content,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void write(ItemRecord record) throws IOException, CoreException {
  IPath itemPath=PropertyHelper.getElementPath(record.getProperty());
  IPath itemDesPath=ResourcesPlugin.getWorkspace().getRoot().getFile(itemPath).getLocation();
  IPath propDesPath=itemDesPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  Map<IPath,IPath> resMap=new HashMap<IPath,IPath>();
  resMap.put(record.getFilePath(),itemDesPath);
  resMap.put(record.getPropertyPath(),propDesPath);
  for (  IPath resPath : resMap.keySet()) {
    File resFile=resPath.toFile();
    File desFile=resMap.get(resPath).toFile();
    if (desFile.exists()) {
      log.warn(desFile.getAbsoluteFile() + "String_Node_Str");
    }
    FilesUtils.copyFile(resFile,desFile);
    String curProjectLabel=ResourceManager.getRootProjectName();
    if (!StringUtils.equals(projectName,curProjectLabel)) {
      String content=FileUtils.readFileToString(desFile,"String_Node_Str");
      content=StringUtils.replace(content,"String_Node_Str" + projectName + "String_Node_Str","String_Node_Str" + curProjectLabel + "String_Node_Str");
      FileUtils.writeStringToFile(desFile,content,"String_Node_Str");
    }
  }
}
Program: 139086
Project: 139086
Buggy source:
/** 
 * DOC bZhou Comment method "getElementPath".
 * @param property
 * @return
 */
public static IPath getElementPath(Property property){
  TDQItem item=(TDQItem)property.getItem();
  IPath proPath=getItemWorkspaceBasePath(property);
  proPath=proPath.append(item.getState().getPath());
  proPath=proPath.append(item.getFilename());
  return proPath;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getElementPath".
 * @param property
 * @return
 */
public static IPath getElementPath(Property property){
  TDQItem item=(TDQItem)property.getItem();
  IPath itemPath=getItemWorkspaceBasePath(property);
  String path=item.getState().getPath();
  if (path == null || StringUtils.isEmpty(path)) {
    IPath propPath=new Path(property.eResource().getURI().toFileString());
    IPath mathPath=new Path(itemPath.lastSegment());
    int matchIndex=indexOfPath(propPath,mathPath);
    IPath relativePath=propPath.uptoSegment(matchIndex + 1);
    path=propPath.makeRelativeTo(relativePath).removeLastSegments(1).toString();
  }
  itemPath=itemPath.append(path);
  itemPath=itemPath.append(item.getFilename());
  return itemPath;
}
Program: 139087
Project: 139087
Buggy source:
/** 
 * DOC bZhou Comment method "findMigrationTaskByType".
 * @param type
 * @return
 */
public static List<IMigrationTask> findWorkspaceTaskByType(MigrationTaskType type){
  List<IMigrationTask> wTasks=findTasksByCategory(MigrationTaskCategory.WORKSPACE);
  List<IMigrationTask> validTasks=new ArrayList<IMigrationTask>();
  for (  IMigrationTask task : wTasks) {
    IWorkspaceMigrationTask wTask=(IWorkspaceMigrationTask)task;
    if (wTask.getMigrationTaskType() == type) {
      validTasks.add(task);
    }
  }
  if (type == MigrationTaskType.DATABASE) {
    ProductVersion workspaceVersion=DataBaseVersionHelper.getVersion();
    ProductVersion currentVersion=CorePlugin.getDefault().getProductVersion();
    return findValidTasks(workspaceVersion,currentVersion,validTasks);
  }
  return validTasks;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "findMigrationTaskByType".
 * @param type
 * @return
 */
public static List<IMigrationTask> findWorkspaceTaskByType(MigrationTaskType type,ProductVersion specifiedVersion){
  List<IMigrationTask> wTasks=findTasksByCategory(MigrationTaskCategory.WORKSPACE);
  List<IMigrationTask> validTasks=new ArrayList<IMigrationTask>();
  for (  IMigrationTask task : wTasks) {
    IWorkspaceMigrationTask wTask=(IWorkspaceMigrationTask)task;
    if (wTask.getMigrationTaskType() == type) {
      validTasks.add(task);
    }
  }
  if (specifiedVersion != null) {
    ProductVersion currentVersion=CorePlugin.getDefault().getProductVersion();
    return findValidTasks(specifiedVersion,currentVersion,validTasks);
  }
  return validTasks;
}
Program: 139088
Project: 139088
Buggy source:
/** 
 * DOC bZhou Get version file by IFile.
 * @param versionFile
 * @return
 */
public static ProductVersion getVesion(IFile versionFile){
  try {
    versionFile.refreshLocal(IResource.DEPTH_ONE,new NullProgressMonitor());
    if (versionFile.exists()) {
      Properties pros=new Properties();
      pros.load(versionFile.getContents());
      String version=pros.getProperty(VERSION);
      if (version != null && !"String_Node_Str".equals(version)) {
        return ProductVersion.fromString(version);
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return new ProductVersion(0,0,0);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getVesion".
 * @param versionFile
 * @return
 */
public static ProductVersion getVesion(File versionFile){
  try {
    if (versionFile.exists()) {
      Properties pros=new Properties();
      pros.load(new FileInputStream(versionFile));
      String version=pros.getProperty(VERSION);
      if (version != null && !"String_Node_Str".equals(version)) {
        return ProductVersion.fromString(version);
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return new ProductVersion(0,0,0);
}
Program: 139089
Project: 139089
Buggy source:
public IndicatorThresholdsForm(Composite parent,int style,IndicatorParameters parameters){
  super(parent,style,parameters);
  Indicator currentIndicator=(Indicator)parameters.eContainer();
  IndicatorEnum currentIndicatorType=IndicatorEnum.findIndicatorEnum(currentIndicator.eClass());
  ModelElement analyzedElement=currentIndicator.getAnalyzedElement();
  if (null != analyzedElement) {
    if (SwitchHelpers.NAMED_COLUMN_SET_SWITCH.doSwitch(analyzedElement) != null) {
      isRangeForDate=false;
      isDatetime=false;
    }
 else {
      int sqltype=((TdColumn)analyzedElement).getJavaType();
      isRangeForDate=Java2SqlType.isDateInSQL(sqltype) && currentIndicatorType.isAChildOf(IndicatorEnum.RangeIndicatorEnum);
      if (isRangeForDate) {
        isDatetime=Java2SqlType.isDateTimeSQL(sqltype);
      }
    }
  }
  isOptionForRowCount=currentIndicatorType == IndicatorEnum.RowCountIndicatorEnum;
  setupForm();
}

Fixed version (ground truth):
public IndicatorThresholdsForm(Composite parent,int style,IndicatorParameters parameters){
  super(parent,style,parameters);
  Indicator currentIndicator=(Indicator)parameters.eContainer();
  IndicatorEnum currentIndicatorType=IndicatorEnum.findIndicatorEnum(currentIndicator.eClass());
  ModelElement analyzedElement=currentIndicator.getAnalyzedElement();
  if (null != analyzedElement) {
    if (SwitchHelpers.NAMED_COLUMN_SET_SWITCH.doSwitch(analyzedElement) != null) {
      isRangeForDate=false;
      isDatetime=false;
    }
 else     if (SwitchHelpers.XMLELEMENT_SWITCH.doSwitch(analyzedElement) != null) {
      isRangeForDate=false;
      isDatetime=false;
    }
 else {
      int sqltype=((TdColumn)analyzedElement).getJavaType();
      isRangeForDate=Java2SqlType.isDateInSQL(sqltype) && currentIndicatorType.isAChildOf(IndicatorEnum.RangeIndicatorEnum);
      if (isRangeForDate) {
        isDatetime=Java2SqlType.isDateTimeSQL(sqltype);
      }
    }
  }
  isOptionForRowCount=currentIndicatorType == IndicatorEnum.RowCountIndicatorEnum;
  setupForm();
}
Program: 139090
Project: 139090
Buggy source:
/** 
 * Method "indexOf".
 * @return true if ok
 */
public int indexOf(String str){
  IFolder librariesFolder=ResourceManager.getLibrariesFolder();
  IFile definitionFile=librariesFolder.getFile(TALENDDEFINITIONFILENAME);
  if (definitionFile.exists()) {
    File file=new File(definitionFile.getLocationURI());
    try {
      String content=FileUtils.readFileToString(file,EMFUtil.ENCODING);
      return content.indexOf(str);
    }
 catch (    IOException e) {
      log.error(e.getMessage(),e);
      return -1;
    }
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Method "indexOf".
 * @return the index of the first occurrence of the character in the character sequence represented by this object,or <code>-1</code> if the character does not occur.
 */
public int indexOf(String str){
  IFolder librariesFolder=ResourceManager.getLibrariesFolder();
  IFile definitionFile=librariesFolder.getFile(TALENDDEFINITIONFILENAME);
  if (definitionFile.exists()) {
    File file=new File(definitionFile.getLocationURI());
    try {
      String content=FileUtils.readFileToString(file,EMFUtil.ENCODING);
      return content.indexOf(str);
    }
 catch (    IOException e) {
      log.error(e.getMessage(),e);
      return -1;
    }
  }
  return -1;
}
Program: 139091
Project: 139091
Buggy source:
private void processRowButtonSelect(boolean selection,List<Button> rowButtons){
  for (  Button btn : rowButtons) {
    ModelElementIndicator columnIndicator=(ModelElementIndicator)btn.getData(MODELELEMENTINDICATORFLAG);
    IIndicatorNode node=(IIndicatorNode)btn.getData();
    IndicatorEnum indicEnum=node.getIndicatorEnum();
    if (selection && ModelElementIndicatorRule.match(node,columnIndicator,language)) {
      btn.setSelection(true);
      if (indicEnum != null) {
        columnIndicator.addTempIndicatorEnum(node.getIndicatorEnum());
      }
    }
 else {
      btn.setSelection(false);
      columnIndicator.removeTempIndicatorEnum(node.getIndicatorEnum());
    }
  }
}

Fixed version (ground truth):
private void processRowButtonSelect(boolean selection,List<Button> rowButtons){
  for (  Button btn : rowButtons) {
    if (btn.isEnabled()) {
      ModelElementIndicator columnIndicator=(ModelElementIndicator)btn.getData(MODELELEMENTINDICATORFLAG);
      IIndicatorNode node=(IIndicatorNode)btn.getData();
      IndicatorEnum indicEnum=node.getIndicatorEnum();
      if (selection && ModelElementIndicatorRule.match(node,columnIndicator,language)) {
        btn.setSelection(true);
        if (indicEnum != null) {
          columnIndicator.addTempIndicatorEnum(node.getIndicatorEnum());
        }
      }
 else {
        btn.setSelection(false);
        columnIndicator.removeTempIndicatorEnum(node.getIndicatorEnum());
      }
    }
  }
}
Program: 139092
Project: 139092
Buggy source:
/** 
 * DOC zshen Comment method "moveElement".
 * @param columnsElementViewer
 * @param isDown move the element of the columnList to up or down.
 */
private void moveElement(AnalysisColumnSetTreeViewer columnsElementViewer,boolean isDown){
  Tree currentTree=columnsElementViewer.getTree();
  Object[] selectItem=currentTree.getSelection();
  List<Column> columnList=columnsElementViewer.getColumnSetMultiValueList();
  int index=0;
  boolean moveFlag=false;
  List<Integer> indexArray=new ArrayList<Integer>();
  if (isDown) {
    for (int i=selectItem.length - 1; i >= 0; i--) {
      index=currentTree.indexOf((TreeItem)selectItem[i]);
      if ((index + 1) >= columnList.size()) {
        return;
      }
 else {
        Column moveElement=(Column)((TreeItem)selectItem[i]).getData(AnalysisColumnNominalIntervalTreeViewer.COLUMN_INDICATOR_KEY);
        columnList.remove(moveElement);
        columnList.add((index + 1),moveElement);
        indexArray.add(index + 1);
      }
    }
  }
 else {
    for (int i=0; i < selectItem.length; i++) {
      index=currentTree.indexOf((TreeItem)selectItem[i]);
      if ((index - 1) < 0) {
        return;
      }
 else {
        Column moveElement=(Column)((TreeItem)selectItem[i]).getData(AnalysisColumnNominalIntervalTreeViewer.COLUMN_INDICATOR_KEY);
        columnList.remove(moveElement);
        columnList.add((index - 1),moveElement);
        indexArray.add(index - 1);
      }
    }
  }
  columnsElementViewer.setInput(convertList(columnList).toArray());
  currentTree=columnsElementViewer.getTree();
  for (int i=0; i < indexArray.size(); i++) {
    currentTree.select(currentTree.getItem(indexArray.get(i)));
  }
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "moveElement".
 * @param columnsElementViewer
 * @param step move the element of the columnList to up or down.
 */
private void moveElement(AnalysisColumnSetTreeViewer columnsElementViewer,int step){
  Tree currentTree=columnsElementViewer.getTree();
  Object[] selectItem=currentTree.getSelection();
  List<Column> columnList=columnsElementViewer.getColumnSetMultiValueList();
  int index=0;
  List<Integer> indexArray=new ArrayList<Integer>();
  for (int i=0; i < selectItem.length; i++) {
    index=currentTree.indexOf((TreeItem)selectItem[i]);
    if (index + step > -1 && index + step < columnList.size()) {
      Column moveElement=(Column)((TreeItem)selectItem[i]).getData(AnalysisColumnNominalIntervalTreeViewer.COLUMN_INDICATOR_KEY);
      columnList.remove(moveElement);
      columnList.add((index + step),moveElement);
      indexArray.add(index + step);
    }
 else {
      return;
    }
  }
  columnsElementViewer.setInput(columnList.toArray());
  currentTree=columnsElementViewer.getTree();
  for (int i=0; i < indexArray.size(); i++) {
    currentTree.select(currentTree.getItem(indexArray.get(i)));
  }
}
Program: 139093
Project: 139093
Buggy source:
public void setInput(Object[] objs){
  if (objs != null && objs.length != 0) {
    if (!(objs[0] instanceof TdColumn)) {
      return;
    }
  }
  List<Column> columnList=new ArrayList<Column>();
  for (  Object obj : objs) {
    columnList.add((TdColumn)obj);
  }
  this.setElements(columnList);
}

Fixed version (ground truth):
public void setInput(Object[] objs){
  if (objs != null && objs.length != 0) {
    if (!(objs[0] instanceof TdColumn)) {
      return;
    }
  }
  List<Column> columnList=new ArrayList<Column>();
  for (  Object obj : objs) {
    columnList.add((TdColumn)obj);
  }
  Collections.reverse(columnList);
  this.setElements(columnList);
}
Program: 139095
Project: 139095
Buggy source:
public boolean execute(){
  String oriQuery="String_Node_Str";
  String accessQuery="String_Node_Str";
  TalendDefinitionFileUpdate talendDefinitionFileUpdate=new TalendDefinitionFileUpdate();
  if (-1 == talendDefinitionFileUpdate.indexOf(accessQuery)) {
    talendDefinitionFileUpdate.add(oriQuery,oriQuery + System.getProperty("String_Node_Str") + accessQuery);
    return talendDefinitionFileUpdate.replace(this.getClass().getName());
  }
  return true;
}

Fixed version (ground truth):
public boolean execute(){
  String categorie="String_Node_Str";
  String accessQuery="String_Node_Str";
  TalendDefinitionFileUpdate talendDefinitionFileUpdate=new TalendDefinitionFileUpdate();
  if (-1 == talendDefinitionFileUpdate.indexOf(accessQuery)) {
    talendDefinitionFileUpdate.add(categorie,categorie + System.getProperty("String_Node_Str") + accessQuery);
    return talendDefinitionFileUpdate.replace(this.getClass().getName());
  }
  return true;
}
Program: 139099
Project: 139099
Buggy source:
public void addElements(final List<Column> columns,int index){
  this.addItemElements(columns,index);
}

Fixed version (ground truth):
public void addElements(final List<Column> columns,int index){
  this.addItemElements(columns,index);
  updateBindConnection(masterPage,tree);
}
Program: 139101
Project: 139101
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str",records.length);
  try {
    for (    ItemRecord record : records) {
      if (monitor.isCanceled()) {
        break;
      }
      monitor.subTask("String_Node_Str" + record.getElement().getName());
      if (record.isValid()) {
        log.info("String_Node_Str" + record.getFile().getAbsolutePath());
        writer.initPath(record,destPath);
        writer.write();
      }
 else {
        for (        String error : record.getErrors()) {
          log.error(error);
        }
      }
      monitor.worked(1);
    }
    writer.finish(records);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  monitor.done();
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str",records.length);
  try {
    for (    ItemRecord record : records) {
      if (monitor.isCanceled()) {
        break;
      }
      monitor.subTask("String_Node_Str" + record.getElement().getName());
      if (record.isValid()) {
        log.info("String_Node_Str" + record.getFile().getAbsolutePath());
        writer.write(record,destPath);
      }
 else {
        for (        String error : record.getErrors()) {
          log.error(error);
        }
      }
      monitor.worked(1);
    }
    writer.finish(records);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  monitor.done();
}