nus-yam/ex-repair huggingface dataset:
Program: 139004
Project: 139004
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(){
  List<String> dErrors=new ArrayList<String>();
  IPath dirPath=new Path(dirTxt.getText());
  if (!dirPath.toFile().exists()) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  if (repositoryTree.getTree().getItems().length == 0) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  if (repositoryTree.getCheckedElements().length == 0) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  IPath versionPath=dirPath.append(EResourceConstant.LIBRARIES.getPath()).append("String_Node_Str");
  if (!versionPath.toFile().exists()) {
    dErrors.add("String_Node_Str");
  }
  ItemRecord[] elements=getElements();
  for (  ItemRecord record : elements) {
    for (    File depFile : record.getDependencyFiles()) {
      if (!repositoryTree.getChecked(depFile)) {
        dErrors.add("String_Node_Str" + record.getElement().getName() + "String_Node_Str"+ depFile.getName());
      }
    }
  }
  if (!dErrors.isEmpty()) {
    setErrorMessage(dErrors.get(0));
  }
 else {
    setErrorMessage(null);
  }
  updatePageStatus();
}

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(){
  List<String> dErrors=new ArrayList<String>();
  IPath dirPath=new Path(dirTxt.getText());
  if (!dirPath.toFile().exists()) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  if (repositoryTree.getTree().getItems().length == 0) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  if (repositoryTree.getCheckedElements().length == 0) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  IPath versionPath=dirPath.append(EResourceConstant.LIBRARIES.getPath()).append("String_Node_Str");
  if (!versionPath.toFile().exists()) {
    dErrors.add("String_Node_Str");
  }
  ItemRecord[] elements=getElements();
  for (  ItemRecord record : elements) {
    for (    File depFile : record.getDependencyMap().keySet()) {
      ModelElement element=record.getDependencyMap().get(depFile);
      ItemRecord findRecord=ItemRecord.findRecord(depFile);
      if (findRecord == null || !repositoryTree.getChecked(findRecord)) {
        dErrors.add("String_Node_Str" + record.getElement().getName() + "String_Node_Str"+ element.getName());
      }
    }
  }
  if (!dErrors.isEmpty()) {
    setErrorMessage(dErrors.get(0));
  }
 else {
    setErrorMessage(null);
  }
  updatePageStatus();
}
Program: 139005
Project: 139005
Buggy source:
/** 
 * DOC bZhou Comment method "getElements".
 * @return
 */
public ItemRecord[] getElements(){
  List<ItemRecord> itemRecords=new ArrayList<ItemRecord>();
  Object[] checkedElements=repositoryTree.getCheckedElements();
  for (  Object obj : checkedElements) {
    if (obj instanceof File) {
      File file=(File)obj;
      if (file.isFile()) {
        itemRecords.add(new ItemRecord(file));
      }
    }
  }
  return itemRecords.toArray(new ItemRecord[itemRecords.size()]);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getElements".
 * @return
 */
public ItemRecord[] getElements(){
  List<ItemRecord> itemRecords=new ArrayList<ItemRecord>();
  Object[] checkedElements=repositoryTree.getCheckedElements();
  for (  Object obj : checkedElements) {
    if (obj instanceof ItemRecord) {
      ItemRecord record=(ItemRecord)obj;
      if (record.getFile().isFile()) {
        itemRecords.add(record);
      }
    }
  }
  return itemRecords.toArray(new ItemRecord[itemRecords.size()]);
}
Program: 139007
Project: 139007
Buggy source:
/** 
 * DOC bZhou Comment method "isAnalysis".
 * @param element
 * @return
 */
public static boolean isAnalysis(ModelElement element){
  return ANALYSIS.doSwitch(element) != null;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isAnalysis". Decide it's an analysis or not.
 * @param element
 * @return
 */
public static boolean isAnalysis(ModelElement element){
  return ANALYSIS.doSwitch(element) != null;
}
Program: 139008
Project: 139008
Buggy source:
/** 
 * DOC bZhou Comment method "isID".
 * @param element
 * @return
 */
public static boolean isID(ModelElement element){
  return INDICATOR_DEFINITION.doSwitch(element) != null;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isID". Decide it's an indicator defintion or not.
 * @param element
 * @return
 */
public static boolean isID(ModelElement element){
  return INDICATOR_DEFINITION.doSwitch(element) != null;
}
Program: 139009
Project: 139009
Buggy source:
/** 
 * DOC bZhou Comment method "isReport".
 * @param element
 * @return
 */
public static boolean isReport(ModelElement element){
  return REPORT.doSwitch(element) != null;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isReport". Decide it's a report or not.
 * @param element
 * @return
 */
public static boolean isReport(ModelElement element){
  return REPORT.doSwitch(element) != null;
}
Program: 139010
Project: 139010
Buggy source:
/** 
 * DOC bZhou Comment method "isDataProvider".
 * @param element
 * @return
 */
public static boolean isDataProvider(ModelElement element){
  return SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(element) != null;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isDataProvider". Decide it's a data provider or not.
 * @param element
 * @return
 */
public static boolean isDataProvider(ModelElement element){
  return SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(element) != null;
}
Program: 139011
Project: 139011
Buggy source:
/** 
 * DOC bZhou Comment method "isPattern".
 * @param element
 * @return
 */
public static boolean isPattern(ModelElement element){
  return PATTERN.doSwitch(element) != null;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isPattern". Decide it's a pattern or not.
 * @param element
 * @return
 */
public static boolean isPattern(ModelElement element){
  return PATTERN.doSwitch(element) != null;
}
Program: 139012
Project: 139012
Buggy source:
/** 
 * DOC bZhou Comment method "isDQRule".
 * @param element
 * @return
 */
public static boolean isDQRule(ModelElement element){
  return DQ_RULE.doSwitch(element) != null;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isDQRule". Decide it's a dq rule or not.
 * @param element
 * @return
 */
public static boolean isDQRule(ModelElement element){
  return DQ_RULE.doSwitch(element) != null;
}
Program: 139013
Project: 139013
Buggy source:
public ReturnCode save(IndicatorDefinition indicator){
  UDIndicatorWriter writer=ElementWriterFactory.getInstance().createUDIndicatorWriter();
  ReturnCode saved=writer.save(indicator);
  return saved;
}

Fixed version (ground truth):
public ReturnCode save(IndicatorDefinition indicator){
  IndicatorDefinitionWriter writer=ElementWriterFactory.getInstance().createIndicatorDefinitionWriter();
  ReturnCode saved=writer.save(indicator);
  return saved;
}
Program: 139014
Project: 139014
Buggy source:
@Override protected boolean checkFile(IFile file){
  return file != null && FactoriesUtil.UDI.equalsIgnoreCase(file.getFileExtension());
}

Fixed version (ground truth):
@Override protected boolean checkFile(IFile file){
  return file != null && FactoriesUtil.DEFINITION.equalsIgnoreCase(file.getFileExtension());
}
Program: 139015
Project: 139015
Buggy source:
/** 
 * DOC bZhou Comment method "create".
 * @param element
 * @return
 */
public AElementPersistance create(ModelElement element){
  if (element instanceof Analysis) {
    return createAnalysisWrite();
  }
 else   if (element instanceof Report) {
    return createReportWriter();
  }
 else   if (element instanceof DataProvider) {
    return createDataProviderWriter();
  }
 else   if (element instanceof Pattern) {
    return createPatternWriter();
  }
 else   if (element instanceof IndicatorDefinition) {
    return createUDIndicatorWriter();
  }
 else   if (element instanceof Rule) {
    return createdRuleWriter();
  }
 else   if (element instanceof SoftwareSystem) {
    return createSoftwareSystemWriter();
  }
 else   if (element instanceof IndicatorDefinition) {
    return createSYSIndicatorWriter();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "create".
 * @param element
 * @return
 */
public AElementPersistance create(ModelElement element){
  if (ModelElementIdentifier.isAnalysis(element)) {
    return createAnalysisWrite();
  }
 else   if (ModelElementIdentifier.isReport(element)) {
    return createReportWriter();
  }
 else   if (ModelElementIdentifier.isDataProvider(element)) {
    return createDataProviderWriter();
  }
 else   if (ModelElementIdentifier.isPattern(element)) {
    return createPatternWriter();
  }
 else   if (ModelElementIdentifier.isID(element)) {
    if (ModelElementIdentifier.isDQRule(element)) {
      return createdRuleWriter();
    }
    return createIndicatorDefinitionWriter();
  }
 else   if (ModelElementIdentifier.isSoftware(element)) {
    return createSoftwareSystemWriter();
  }
  return null;
}
Program: 139016
Project: 139016
Buggy source:
/** 
 * DOC xqliu Comment method "createAndStoreUDI".
 * @param parameters
 * @param selectionFolder
 */
private static void createAndStoreUDI(UDIParameters parameters,IFolder selectionFolder){
  IndicatorDefinition id=UDIHelper.createUDI(parameters.name,parameters.auther,parameters.description,parameters.purpose,parameters.status,parameters.category);
  for (  String key : parameters.regex.keySet()) {
    TdExpression expression=BooleanExpressionHelper.createTdExpression(key,parameters.regex.get(key));
    id.getSqlGenericExpression().add(expression);
  }
  boolean validStatus=UDIHelper.isUDIValid(id);
  TaggedValueHelper.setValidStatus(validStatus,id);
  String fname=DqRepositoryViewService.createFilename(parameters.name,FactoriesUtil.UDI);
  try {
    String[] folderNames=parameters.relativePath.split("String_Node_Str");
    for (    String folderName : folderNames) {
      IFolder folder=selectionFolder.getFolder(folderName);
      if (!folder.exists()) {
        folder.create(false,true,null);
      }
      selectionFolder=folder;
    }
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  IFile pfile=selectionFolder.getFile(fname);
  ElementWriterFactory.getInstance().createUDIndicatorWriter().save(id,pfile);
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "createAndStoreUDI".
 * @param parameters
 * @param selectionFolder
 */
private static void createAndStoreUDI(UDIParameters parameters,IFolder selectionFolder){
  IndicatorDefinition id=UDIHelper.createUDI(parameters.name,parameters.auther,parameters.description,parameters.purpose,parameters.status,parameters.category);
  for (  String key : parameters.regex.keySet()) {
    TdExpression expression=BooleanExpressionHelper.createTdExpression(key,parameters.regex.get(key));
    id.getSqlGenericExpression().add(expression);
  }
  boolean validStatus=UDIHelper.isUDIValid(id);
  TaggedValueHelper.setValidStatus(validStatus,id);
  String fname=DqRepositoryViewService.createFilename(parameters.name,FactoriesUtil.DEFINITION);
  try {
    String[] folderNames=parameters.relativePath.split("String_Node_Str");
    for (    String folderName : folderNames) {
      IFolder folder=selectionFolder.getFolder(folderName);
      if (!folder.exists()) {
        folder.create(false,true,null);
      }
      selectionFolder=folder;
    }
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  IFile pfile=selectionFolder.getFile(fname);
  ElementWriterFactory.getInstance().createIndicatorDefinitionWriter().save(id,pfile);
}
Program: 139017
Project: 139017
Buggy source:
/** 
 * DOC bZhou Comment method "extractFolder".
 * @param oldObject
 * @return
 */
private IFolder extractFolder(ModelElement oldObject){
  Resource resource=oldObject.eResource();
  if (resource != null) {
    IPath path=new Path(resource.getURI().toPlatformString(false));
    IFile oldFile=ResourcesPlugin.getWorkspace().getRoot().getFile(path);
    IFolder parent=(IFolder)oldFile.getParent();
    if (ModelElementIdentifier.isID(oldObject)) {
      parent=ResourceManager.getUDIFolder();
    }
    return parent;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "extractFolder".
 * @param oldObject
 * @return
 */
private IFolder extractFolder(ModelElement oldObject){
  Resource resource=oldObject.eResource();
  if (resource != null) {
    IPath path=new Path(resource.getURI().toPlatformString(false));
    IFile oldFile=ResourcesPlugin.getWorkspace().getRoot().getFile(path);
    IFolder parent=(IFolder)oldFile.getParent();
    if (ModelElementIdentifier.isID(oldObject) && !ModelElementIdentifier.isDQRule(oldObject)) {
      parent=ResourceManager.getUDIFolder();
    }
    return parent;
  }
  return null;
}
Program: 139019
Project: 139019
Buggy source:
public ItemRecord(File file){
  this.file=file;
  try {
    if (file.isFile()) {
      init();
    }
  }
 catch (  Exception e) {
    addError(e.getMessage());
  }
}

Fixed version (ground truth):
public ItemRecord(File file){
  this.file=file;
  try {
    if (file.isFile()) {
      init();
    }
  }
 catch (  Exception e) {
    Log.error(e,e);
  }
}
Program: 139020
Project: 139020
Buggy source:
public void run(){
  try {
    for (    IFile file : selectedFiles) {
      ResourceFileMap resourceFileMap=ModelElementFileFactory.getResourceFileMap(file);
      if (resourceFileMap != null) {
        ModelElement[] elements=new ModelElement[]{resourceFileMap.getModelElement(file)};
        ReturnCode rc=check(file);
        int result=DeleteModelElementConfirmDialog.showDialog(null,elements,rc.getMessage());
        runStatus=rc.isOk() && result == Window.OK;
        if (runStatus) {
          resourceFileMap.delete(file);
        }
      }
    }
    CorePlugin.getDefault().refreshDQView();
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    for (    IFile file : selectedFiles) {
      ResourceFileMap resourceFileMap=ModelElementFileFactory.getResourceFileMap(file);
      if (resourceFileMap != null) {
        ModelElement[] elements=new ModelElement[]{resourceFileMap.getModelElement(file)};
        ReturnCode rc=check(file);
        int result=DeleteModelElementConfirmDialog.showDialog(null,elements,rc.getMessage());
        runStatus=rc.isOk() && result == Window.OK;
        if (runStatus) {
          resourceFileMap.delete(file);
        }
 else {
          break;
        }
      }
    }
    CorePlugin.getDefault().refreshDQView();
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}
Program: 139021
Project: 139021
Buggy source:
/** 
 * DOC bZhou Comment method "update".
 * @param oldObject
 * @param newObject
 * @return
 */
private ModelElement update(ModelElement oldObject,ModelElement newObject){
  newObject.setName("String_Node_Str" + newObject.getName());
  String author=ReponsitoryContextBridge.getAuthor();
  if (!StringUtils.isEmpty(author)) {
    MetadataHelper.setAuthor(newObject,author);
  }
  if (newObject instanceof TdReport) {
    List<Analysis> anaLs=ReportHelper.getAnalyses((TdReport)oldObject);
    for (    Analysis analysis : anaLs) {
      DependenciesHandler.getInstance().setDependencyOn((TdReport)newObject,analysis);
      ((TdReport)newObject).addAnalysis(analysis);
    }
  }
  if (newObject instanceof Analysis) {
    AnalysisHelper.getDataFilter((Analysis)newObject).clear();
    AnalysisHelper.setStringDataFilter((Analysis)newObject,AnalysisHelper.getStringDataFilter((Analysis)oldObject));
  }
  return newObject;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "update".
 * @param oldObject
 * @param newObject
 * @return
 */
private ModelElement update(ModelElement oldObject,ModelElement newObject){
  newObject.setName("String_Node_Str" + newObject.getName());
  String author=ReponsitoryContextBridge.getAuthor();
  if (!StringUtils.isEmpty(author)) {
    MetadataHelper.setAuthor(newObject,author);
  }
  if (ModelElementIdentifier.isReport(newObject)) {
    List<Analysis> anaLs=ReportHelper.getAnalyses((TdReport)oldObject);
    for (    Analysis analysis : anaLs) {
      DependenciesHandler.getInstance().setDependencyOn((TdReport)newObject,analysis);
      ((TdReport)newObject).addAnalysis(analysis);
    }
  }
  if (ModelElementIdentifier.isAnalysis(newObject)) {
    AnalysisHelper.getDataFilter((Analysis)newObject).clear();
    AnalysisHelper.setStringDataFilter((Analysis)newObject,AnalysisHelper.getStringDataFilter((Analysis)oldObject));
  }
  if (ModelElementIdentifier.isID(newObject)) {
    IndicatorDefinition oldID=(IndicatorDefinition)oldObject;
    IndicatorDefinition newID=(IndicatorDefinition)newObject;
    TaggedValueHelper.setValidStatus(true,newID);
    newID.setLabel("String_Node_Str");
    Collection<IndicatorCategory> userDefinedIndicatorCategoryList=DefinitionHandler.getInstance().getUserDefinedIndicatorCategoryList();
    IndicatorCategory category=UDIHelper.getUDICategory(oldID);
    if (userDefinedIndicatorCategoryList.contains(category)) {
      UDIHelper.setUDICategory(newID,category);
    }
 else {
      UDIHelper.setUDICategory(newID,DefinitionHandler.getInstance().getUserDefinedCountIndicatorCategory());
    }
  }
  return newObject;
}
Program: 139022
Project: 139022
Buggy source:
@Override public void run(){
  if (files != null && files.length > 0) {
    for (    IFile file : files) {
      ModelElement oldObject=ModelElementFileFactory.getModelElement(file);
      if (oldObject != null) {
        ModelElement newObject=(ModelElement)EMFSharedResources.getInstance().copyEObject(oldObject);
        newObject=update(oldObject,newObject);
        IFile newFile=getNewFile(file);
        ElementWriterFactory.getInstance().create(newFile.getFileExtension()).save(newObject,newFile);
      }
    }
    CorePlugin.getDefault().refreshDQView();
  }
}

Fixed version (ground truth):
@Override public void run(){
  for (  ModelElement oldObject : elementList) {
    if (oldObject != null) {
      ModelElement newObject=(ModelElement)EMFSharedResources.getInstance().copyEObject(oldObject);
      IFolder folder=extractFolder(oldObject);
      if (folder != null) {
        newObject=update(oldObject,newObject);
        AElementPersistance elementWriter=ElementWriterFactory.getInstance().create(oldObject);
        if (elementWriter != null) {
          TypedReturnCode<IFile> trc=elementWriter.create(newObject,folder);
          selectAndReveal(trc.getObject());
        }
      }
    }
  }
  CorePlugin.getDefault().refreshDQView();
}
Program: 139023
Project: 139023
Buggy source:
public DuplicateCWMResourceAction(IFile[] files){
  super(DefaultMessagesImpl.getString("String_Node_Str"));
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.EDIT_COPY));
  this.files=files;
}

Fixed version (ground truth):
/** 
 * DOC bZhou DuplicateCWMResourceAction constructor comment.
 * @param elements
 */
public DuplicateCWMResourceAction(ModelElement[] elements){
  this();
  for (  ModelElement element : elements) {
    elementList.add(element);
  }
}
Program: 139025
Project: 139025
Buggy source:
private void createTableDetail(Table table){
  createNameCommentDetail(table);
  List<PrimaryKey> primaryKeys=TableHelper.getPrimaryKeys(table);
  newLabelAndText(gContainer,DefaultMessagesImpl.getString("String_Node_Str"),primaryKeys.isEmpty() ? null : String.valueOf(primaryKeys.get(0).getFeature().size()));
  newLabelAndText(gContainer,DefaultMessagesImpl.getString("String_Node_Str"),primaryKeys.isEmpty() ? null : primaryKeys.get(0).getName());
  List<ForeignKey> foreignKeys=TableHelper.getForeignKeys(table);
  newLabelAndText(gContainer,DefaultMessagesImpl.getString("String_Node_Str"),foreignKeys.isEmpty() ? null : foreignKeys.get(0).getName());
  newLabelAndText(gContainer,DefaultMessagesImpl.getString("String_Node_Str"),foreignKeys.isEmpty() ? null : String.valueOf(foreignKeys.get(0).getFeature().size()));
}

Fixed version (ground truth):
private void createTableDetail(Table table){
  createNameCommentDetail(table);
  List<PrimaryKey> primaryKeys=TableHelper.getPrimaryKeys(table);
  newLabelAndText(gContainer,DefaultMessagesImpl.getString("String_Node_Str"),primaryKeys.isEmpty() ? null : String.valueOf(primaryKeys.get(0).getFeature().size()));
  newLabelAndText(gContainer,DefaultMessagesImpl.getString("String_Node_Str"),primaryKeys.isEmpty() ? null : primaryKeys.get(0).getName());
  List<ForeignKey> foreignKeys=TableHelper.getForeignKeys(table);
  newLabelAndText(gContainer,DefaultMessagesImpl.getString("String_Node_Str"),foreignKeys.isEmpty() ? null : String.valueOf(foreignKeys.get(0).getFeature().size()));
  newLabelAndText(gContainer,DefaultMessagesImpl.getString("String_Node_Str"),foreignKeys.isEmpty() ? null : foreignKeys.get(0).getName());
}
Program: 139027
Project: 139027
Buggy source:
@Override protected boolean runAnalysis(Analysis analysis,String sqlStatement){
  boolean ok=true;
  TypedReturnCode<Connection> trc=this.getConnection(analysis);
  if (!trc.isOk()) {
    return traceError("String_Node_Str" + analysis.getName() + "String_Node_Str"+ trc.getMessage());
  }
  Connection connection=trc.getObject();
  try {
    EList<Indicator> indicators=analysis.getResults().getIndicators();
    for (    Indicator indicator : indicators) {
      if (this.catalogOrSchema != null) {
        changeCatalog(this.catalogOrSchema,connection);
      }
      Expression query=dbms().getInstantiatedExpression(indicator);
      if (query == null || !executeQuery(indicator,connection,query)) {
        ok=traceError("String_Node_Str" + indicator.getName() + "String_Node_Str"+ ((query == null) ? "String_Node_Str" : "String_Node_Str" + query.getBody()));
      }
 else {
        indicator.setComputed(true);
      }
    }
    connection.close();
  }
 catch (  SQLException e) {
    log.error(e,e);
    this.errorMessage=e.getMessage();
    ok=false;
  }
 finally {
    ConnectionUtils.closeConnection(connection);
  }
  return ok;
}

Fixed version (ground truth):
@Override protected boolean runAnalysis(Analysis analysis,String sqlStatement){
  boolean ok=true;
  TypedReturnCode<Connection> trc=this.getConnection(analysis);
  if (!trc.isOk()) {
    return traceError("String_Node_Str" + analysis.getName() + "String_Node_Str"+ trc.getMessage());
  }
  Connection connection=trc.getObject();
  try {
    EList<Indicator> indicators=analysis.getResults().getIndicators();
    for (    Indicator indicator : indicators) {
      if (!indicator.prepare()) {
        return traceError("String_Node_Str");
      }
      if (this.catalogOrSchema != null) {
        changeCatalog(this.catalogOrSchema,connection);
      }
      Expression query=dbms().getInstantiatedExpression(indicator);
      if (query == null || !executeQuery(indicator,connection,query)) {
        ok=traceError("String_Node_Str" + indicator.getName() + "String_Node_Str"+ ((query == null) ? "String_Node_Str" : "String_Node_Str" + query.getBody()));
      }
 else {
        indicator.setComputed(true);
      }
    }
    connection.close();
  }
 catch (  SQLException e) {
    log.error(e,e);
    this.errorMessage=e.getMessage();
    ok=false;
  }
 finally {
    ConnectionUtils.closeConnection(connection);
  }
  return ok;
}
Program: 139028
Project: 139028
Buggy source:
/** 
 * DOC scorreia Comment method "executeQuery".
 * @param indicator
 * @param connection
 * @param query
 * @return
 */
private boolean executeQuery(Indicator indicator,Connection connection,Expression query){
  try {
    List<Object[]> myResultSet=executeQuery(catalogOrSchema,connection,query.getBody());
    if (indicator instanceof AllMatchIndicator) {
      AllMatchIndicator matchIndicator=(AllMatchIndicator)indicator;
      EList<Column> columns=matchIndicator.getAnalyzedColumns();
      List<String>[] patternList=new List[columns.size()];
      EList<RegexpMatchingIndicator> indicators=matchIndicator.getCompositeRegexMatchingIndicators();
      for (int i=0; i < columns.size(); i++) {
        for (        RegexpMatchingIndicator rmi : indicators) {
          if (rmi.getAnalyzedElement() == columns.get(i)) {
            if (null == patternList[i]) {
              patternList[i]=new ArrayList<String>();
            }
            String regex=getRegexWithoutQuotes(getPatterns(rmi).get(0));
            patternList[i].add(regex);
          }
        }
      }
      matchIndicator.setPatterns(patternList);
    }
    return indicator.storeSqlResults(myResultSet);
  }
 catch (  SQLException e) {
    log.error(e,e);
    return false;
  }
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "executeQuery".
 * @param indicator
 * @param connection
 * @param query
 * @return
 */
private boolean executeQuery(Indicator indicator,Connection connection,Expression query){
  try {
    List<Object[]> myResultSet=executeQuery(catalogOrSchema,connection,query.getBody());
    return indicator.storeSqlResults(myResultSet);
  }
 catch (  SQLException e) {
    log.error(e,e);
    return false;
  }
}
Program: 139029
Project: 139029
Buggy source:
public void addElements(final ModelElementIndicator[] elements){
  this.addItemElements(elements);
  updateBindConnection(masterPage,tree);
}

Fixed version (ground truth):
public void addElements(final ModelElementIndicator[] elements){
  TdColumn[] columns=new TdColumn[elements.length];
  for (int i=0; i < elements.length; i++) {
    columns[i]=(TdColumn)elements[i].getModelElement();
  }
  List<Column> oriColumns=getColumnSetMultiValueList();
  for (  Column column : columns) {
    if (!oriColumns.contains(column)) {
      oriColumns.add(column);
    }
  }
  setInput(oriColumns.toArray());
  updateBindConnection(masterPage,tree);
}
Program: 139030
Project: 139030
Buggy source:
/** 
 * DOC yyi Comment method "computeCounts".
 * @param objects
 * @return
 */
private boolean computeCounts(List<Object[]> objects){
  boolean ok=true;
  Long matchCount=0L;
  for (  Object[] row : objects) {
    boolean isAMatch=false;
    for (int i=0; i < row.length - 1; i++) {
      if (null != patterns[i]) {
        for (        String regex : patterns[i]) {
          Pattern p=Pattern.compile(regex);
          Matcher m=p.matcher(String.valueOf(row[i]));
          if (!m.find()) {
            isAMatch=false;
            break;
          }
          isAMatch=true;
        }
        if (false == isAMatch)         break;
      }
    }
    if (isAMatch) {
      if (null != row[row.length - 1]) {
        Long val=Long.valueOf(String.valueOf(row[row.length - 1]));
        matchCount+=val;
      }
 else {
        ok=false;
      }
    }
  }
  setMatchingValueCount(matchCount);
  setNotMatchingValueCount(getCount() - matchCount);
  return ok;
}

Fixed version (ground truth):
/** 
 * DOC yyi Comment method "computeCounts".
 * @param objects
 * @return
 */
private boolean computeCounts(List<Object[]> objects){
  boolean ok=true;
  Long matchCount=0L;
  for (  Object[] row : objects) {
    boolean isAMatch=false;
    for (int i=0; i < row.length - 1; i++) {
      if (null != patterns[i]) {
        for (        java.util.regex.Pattern p : patterns[i]) {
          Matcher m=p.matcher(String.valueOf(row[i]));
          if (!m.find()) {
            isAMatch=false;
            break;
          }
          isAMatch=true;
        }
        if (false == isAMatch)         break;
      }
    }
    if (isAMatch) {
      if (null != row[row.length - 1]) {
        Long val=Long.valueOf(String.valueOf(row[row.length - 1]));
        matchCount+=val;
      }
 else {
        ok=false;
      }
    }
  }
  setMatchingValueCount(matchCount);
  setNotMatchingValueCount(getCount() - matchCount);
  return ok;
}
Program: 139032
Project: 139032
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  TreeItem item=(TreeItem)e.item;
  if (DATA_PARAM.equals(item.getData(DATA_PARAM))) {
    tree.setMenu(null);
  }
 else {
    new ColumnModelElementTreeMenuProvider(tree).createTreeMenu();
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  TreeItem item=(TreeItem)e.item;
  if (DATA_PARAM.equals(item.getData(DATA_PARAM))) {
    tree.setMenu(null);
  }
 else {
    new AnalysisColumnColumnMenuProvider(tree).createTreeMenu();
  }
}
Program: 139033
Project: 139033
Buggy source:
private Runnable getRefreshRunnable(final Resource resource){
  return new Runnable(){
    public void run(){
      IFile propFile=PropertyHelper.getPropertyFile(resource);
      if (propFile.exists()) {
        Resource propertyResource=RepResourceFileHelper.getInstance().getFileResource(propFile);
        updateProperty(resource,propertyResource);
        updateElement(resource,propertyResource);
      }
    }
  }
;
}

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

Fixed version (ground truth):
public void run(){
  IFile propFile=PropertyHelper.getPropertyFile(resource);
  if (propFile != null && propFile.exists()) {
    Resource propertyResource=RepResourceFileHelper.getInstance().getFileResource(propFile);
    updateProperty(resource,propertyResource);
    updateElement(resource,propertyResource);
  }
}
Program: 139037
Project: 139037
Buggy source:
/** 
 * Remove the selected elements(eg:TdColumn or Indicator) from tree.
 * @param newTree
 */
private void removeSelectedElements(final Tree newTree){
  TreeItem[] selection=newTree.getSelection();
  for (  TreeItem item : selection) {
    TdColumn tdColumn=(TdColumn)item.getData(COLUMN_INDICATOR_KEY);
    deleteColumnItems(tdColumn);
    removeItemBranch(item);
  }
}

Fixed version (ground truth):
/** 
 * Remove the selected elements(eg:TdColumn or Indicator) from tree.
 * @param newTree
 */
private void removeSelectedElements(final Tree newTree){
  TreeItem[] selection=newTree.getSelection();
  for (  TreeItem item : selection) {
    ModelElementIndicator meIndicator=(ModelElementIndicator)item.getData(MODELELEMENT_INDICATOR_KEY);
    IndicatorUnit indicatorUnit=(IndicatorUnit)item.getData(INDICATOR_UNIT_KEY);
    if (indicatorUnit != null) {
      deleteIndicatorItems(meIndicator,indicatorUnit);
    }
 else {
      TdColumn tdColumn=(TdColumn)item.getData(COLUMN_INDICATOR_KEY);
      deleteColumnItems(tdColumn);
    }
    removeItemBranch(item);
  }
}
Program: 139038
Project: 139038
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  boolean con=false;
  if (e.item instanceof TreeItem) {
    enabledButtons(true);
    TreeItem item=(TreeItem)e.item;
    if (DATA_PARAM.equals(item.getData(DATA_PARAM))) {
      tree.setMenu(null);
      return;
    }
 else     if (item.getData(INDICATOR_UNIT_KEY) != null) {
      IndicatorUnit indicatorUnit=(IndicatorUnit)item.getData(INDICATOR_UNIT_KEY);
      IndicatorEnum type=indicatorUnit.getType();
      con=IndicatorEnum.RegexpMatchingIndicatorEnum.compareTo(type) == 0 || IndicatorEnum.SqlPatternMatchingIndicatorEnum.compareTo(type) == 0;
    }
  }
  createTreeMenu(tree,con);
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  boolean con=false;
  if (e.item instanceof TreeItem) {
    enabledButtons(true);
    TreeItem item=(TreeItem)e.item;
    if (DATA_PARAM.equals(item.getData(DATA_PARAM))) {
      tree.setMenu(null);
      return;
    }
 else {
      new AnalysisColumnSetMenuProvider(tree).createTreeMenu();
    }
  }
}
Program: 139039
Project: 139039
Buggy source:
/** 
 * @param parent
 */
private Tree createTree(Composite parent){
  final Tree newTree=new Tree(parent,SWT.MULTI | SWT.BORDER);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,true).applyTo(newTree);
  newTree.setHeaderVisible(true);
  TreeColumn column1=new TreeColumn(newTree,SWT.CENTER);
  column1.setWidth(190);
  column1.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  TreeColumn column2=new TreeColumn(newTree,SWT.CENTER);
  column2.setWidth(120);
  column2.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  TreeColumn column3=new TreeColumn(newTree,SWT.CENTER);
  column3.setWidth(80);
  column3.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  TreeColumn column4=new TreeColumn(newTree,SWT.CENTER);
  column4.setWidth(80);
  column4.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  parent.layout();
  createTreeMenu(newTree,false);
  AbstractAnalysisActionHandler actionHandler=new AbstractAnalysisActionHandler(parent){
    @Override protected void handleRemove(){
      removeSelectedElements(newTree);
      updateBindConnection(masterPage,tree);
    }
  }
;
  parent.setData(AbstractMetadataFormPage.ACTION_HANDLER,actionHandler);
  addTargetDND(newTree);
  addTreeListener(newTree);
  return newTree;
}

Fixed version (ground truth):
/** 
 * @param parent
 */
private Tree createTree(Composite parent){
  final Tree newTree=new Tree(parent,SWT.MULTI | SWT.BORDER);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,true).applyTo(newTree);
  newTree.setHeaderVisible(true);
  TreeColumn column1=new TreeColumn(newTree,SWT.CENTER);
  column1.setWidth(190);
  column1.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  TreeColumn column2=new TreeColumn(newTree,SWT.CENTER);
  column2.setWidth(120);
  column2.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  TreeColumn column3=new TreeColumn(newTree,SWT.CENTER);
  column3.setWidth(80);
  column3.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  TreeColumn column4=new TreeColumn(newTree,SWT.CENTER);
  column4.setWidth(80);
  column4.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  parent.layout();
  AbstractAnalysisActionHandler actionHandler=new AbstractAnalysisActionHandler(parent){
    @Override protected void handleRemove(){
      removeSelectedElements(newTree);
      updateBindConnection(masterPage,tree);
    }
  }
;
  parent.setData(AbstractMetadataFormPage.ACTION_HANDLER,actionHandler);
  addTargetDND(newTree);
  addTreeListener(newTree);
  return newTree;
}
Program: 139041
Project: 139041
Buggy source:
/** 
 * DOC zshen Comment method "enabledButtons".
 * @param enabled the state of buttons .change the state of buttons.
 */
public void enabledButtons(boolean enabled){
  for (  Button button : buttons) {
    button.setEnabled(enabled);
  }
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "enabledButtons".
 * @param enabled the state of buttons .change the state of buttons.
 */
public void enabledButtons(boolean enabled){
  boolean moveEnabled=enabled;
  TreeItem[] selectItems=getTree().getSelection();
  if (!isSelectedColumn(selectItems)) {
    moveEnabled=false;
  }
  buttons.get("String_Node_Str").setEnabled(enabled);
  buttons.get("String_Node_Str").setEnabled(moveEnabled);
  buttons.get("String_Node_Str").setEnabled(moveEnabled);
}
Program: 139042
Project: 139042
Buggy source:
@Override protected void removeItemBranch(TreeItem item){
  IndicatorUnit unit=(IndicatorUnit)item.getData(INDICATOR_UNIT_KEY);
  super.removeItemBranch(item);
  if (null != unit) {
    masterPage.getAllMatchIndicator().getCompositeRegexMatchingIndicators().remove(unit.getIndicator());
    masterPage.updateIndicatorSection();
  }
}

Fixed version (ground truth):
@Override protected void removeItemBranch(TreeItem item){
  IndicatorUnit unit=(IndicatorUnit)item.getData(INDICATOR_UNIT_KEY);
  ModelElementIndicator meIndicator=(ModelElementIndicator)item.getData(MODELELEMENT_INDICATOR_KEY);
  super.removeItemBranch(item);
  if (null != unit) {
    meIndicator.removeIndicatorUnit(unit);
    masterPage.getAllMatchIndicator().getCompositeRegexMatchingIndicators().remove(unit.getIndicator());
    masterPage.updateIndicatorSection();
  }
}
Program: 139044
Project: 139044
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  TreeItem item=(TreeItem)e.item;
  File sfile=(File)item.getData();
  IFile sIFile=file2IFile(sfile);
  if (sIFile != null) {
    File[] dependencies=computeDependencies(sIFile);
    for (    File file : dependencies) {
      repositoryTree.setChecked(file,item.getChecked());
    }
    repositoryTree.refresh();
  }
  checkForErrors();
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  TreeItem item=(TreeItem)e.item;
  File sfile=(File)item.getData();
  IFile sIFile=ResourceService.file2IFile(sfile);
  if (sIFile != null) {
    File[] dependencies=computeDependencies(sIFile);
    for (    File file : dependencies) {
      repositoryTree.setChecked(file,item.getChecked());
    }
    repositoryTree.refresh();
  }
  checkForErrors();
}
Program: 139046
Project: 139046
Buggy source:
/** 
 * this check that the folder entered in the target export location exist otherwhise set an erro message and disable export.
 */
protected void checkForErrors(){
  errors=new ArrayList<String>();
  if (!new File(dirTxt.getText()).exists()) {
    errors.add(Messages.getString("String_Node_Str"));
  }
  ItemRecord[] elements=getElements();
  for (  ItemRecord record : elements) {
    File file=record.getFile();
    IFile iFile=file2IFile(file);
    File[] dependencies=computeDependencies(iFile);
    for (    File depFile : dependencies) {
      if (!repositoryTree.getChecked(depFile)) {
        errors.add("String_Node_Str" + record.getElement().getName() + "String_Node_Str"+ depFile.getName());
      }
    }
  }
  if (!errors.isEmpty()) {
    setErrorMessage(errors.get(0));
  }
 else {
    setErrorMessage(null);
  }
  updatePageStatus();
}

Fixed version (ground truth):
/** 
 * this check that the folder entered in the target export location exist otherwhise set an erro message and disable export.
 */
protected void checkForErrors(){
  errors=new ArrayList<String>();
  if (!new File(dirTxt.getText()).exists()) {
    errors.add(Messages.getString("String_Node_Str"));
  }
  ItemRecord[] elements=getElements();
  for (  ItemRecord record : elements) {
    File file=record.getFile();
    IFile iFile=ResourceService.file2IFile(file);
    File[] dependencies=computeDependencies(iFile);
    for (    File depFile : dependencies) {
      if (!repositoryTree.getChecked(depFile)) {
        errors.add("String_Node_Str" + record.getElement().getName() + "String_Node_Str"+ depFile.getName());
      }
    }
  }
  if (!errors.isEmpty()) {
    setErrorMessage(errors.get(0));
  }
 else {
    setErrorMessage(null);
  }
  updatePageStatus();
}
Program: 139047
Project: 139047
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  dirTxt.setText(dirTxt.getText());
  populateElement();
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  TreeItem item=(TreeItem)e.item;
  File sfile=(File)item.getData();
  if (sfile.isFile()) {
    ItemRecord record=new ItemRecord(sfile);
    List<File> dependencyFiles=record.getDependencyFiles();
    for (    File file : dependencyFiles) {
      repositoryTree.setChecked(file,item.getChecked());
    }
    repositoryTree.refresh();
    checkforErrors();
  }
}
Program: 139048
Project: 139048
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(){
  boolean valid=getErrorMessage() == null;
  setPageComplete(valid);
  repositoryTree.getTree().setEnabled(valid);
}

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);
}
Program: 139049
Project: 139049
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(){
  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();
}

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(){
  List<String> dErrors=new ArrayList<String>();
  IPath dirPath=new Path(dirTxt.getText());
  if (!dirPath.toFile().exists()) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  if (repositoryTree.getTree().getItems().length == 0) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  if (repositoryTree.getCheckedElements().length == 0) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  IPath versionPath=dirPath.append(EResourceConstant.LIBRARIES.getPath()).append("String_Node_Str");
  if (!versionPath.toFile().exists()) {
    dErrors.add("String_Node_Str");
  }
  ItemRecord[] elements=getElements();
  for (  ItemRecord record : elements) {
    for (    File depFile : record.getDependencyFiles()) {
      if (!repositoryTree.getChecked(depFile)) {
        dErrors.add("String_Node_Str" + record.getElement().getName() + "String_Node_Str"+ depFile.getName());
      }
    }
  }
  if (!dErrors.isEmpty()) {
    setErrorMessage(dErrors.get(0));
  }
 else {
    setErrorMessage(null);
  }
  updatePageStatus();
}
Program: 139051
Project: 139051
Buggy source:
/** 
 * DOC bZhou Comment method "init".
 */
private void init(){
  if (resourceSet == null) {
    resourceSet=new ResourceSetImpl();
  }
  if (element == null && file != null) {
    URI fileURI=URI.createFileURI(file.getAbsolutePath());
    Resource resource=resourceSet.getResource(fileURI,true);
    EList<EObject> contents=resource.getContents();
    if (contents != null && !contents.isEmpty()) {
      EObject object=contents.get(0);
      if (object instanceof ModelElement) {
        element=(ModelElement)object;
      }
    }
  }
  if (property == null && file != null) {
    property=(Property)EObjectHelper.retrieveEObject(getPropertyPath(),PropertiesPackage.eINSTANCE.getProperty());
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "init".
 */
private void init(){
  if (resourceSet == null) {
    resourceSet=new ResourceSetImpl();
  }
  if (element == null && file != null) {
    URI fileURI=URI.createFileURI(file.getAbsolutePath());
    Resource resource=resourceSet.getResource(fileURI,true);
    EList<EObject> contents=resource.getContents();
    if (contents != null && !contents.isEmpty()) {
      EObject object=contents.get(0);
      if (object instanceof ModelElement) {
        element=(ModelElement)object;
      }
    }
  }
  if (property == null && file != null) {
    property=(Property)EObjectHelper.retrieveEObject(getPropertyPath(),PropertiesPackage.eINSTANCE.getProperty());
  }
  computeDependencies();
}
Program: 139052
Project: 139052
Buggy source:
public DQRespositoryView(){
  super();
  DQStructureManager manager=DQStructureManager.getInstance();
  if (manager.isNeedCreateStructure()) {
    manager.createDQStructure();
  }
  if (manager.isNeedMigration()) {
    MigrationTaskManager.doMigrationTask(MigrationTaskManager.findValidTasks());
  }
}

Fixed version (ground truth):
public DQRespositoryView(){
  super();
  DQStructureManager manager=DQStructureManager.getInstance();
  if (manager.isNeedCreateStructure()) {
    manager.createDQStructure();
  }
  if (manager.isNeedMigration()) {
    MigrationTaskManager.doMigrationTask(MigrationTaskManager.findNonDBValidTasks());
  }
}
Program: 139054
Project: 139054
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  TreeItem item=(TreeItem)e.item;
  File sfile=(File)item.getData();
  IFile sIFile=file2IFile(sfile);
  if (sIFile != null) {
    File[] dependencies=computeDependencies(sIFile);
    for (    File file : dependencies) {
      repositoryTree.setChecked(file,item.getChecked());
    }
    repositoryTree.refresh();
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  TreeItem item=(TreeItem)e.item;
  File sfile=(File)item.getData();
  IFile sIFile=file2IFile(sfile);
  if (sIFile != null) {
    File[] dependencies=computeDependencies(sIFile);
    for (    File file : dependencies) {
      repositoryTree.setChecked(file,item.getChecked());
    }
    repositoryTree.refresh();
  }
  checkForErrors();
}
Program: 139055
Project: 139055
Buggy source:
public void modifyText(ModifyEvent e){
  checkForErrors();
  updatePageStatus();
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  checkForErrors();
}
Program: 139057
Project: 139057
Buggy source:
/** 
 * this check that the folder entered in the target export location exist otherwhise set an erro message and disable export.
 */
protected void checkForErrors(){
  if (!new File(dirTxt.getText()).exists()) {
    setErrorMessage(Messages.getString("String_Node_Str"));
  }
 else {
    setErrorMessage(null);
  }
}

Fixed version (ground truth):
/** 
 * this check that the folder entered in the target export location exist otherwhise set an erro message and disable export.
 */
protected void checkForErrors(){
  errors=new ArrayList<String>();
  if (!new File(dirTxt.getText()).exists()) {
    errors.add(Messages.getString("String_Node_Str"));
  }
  ItemRecord[] elements=getElements();
  for (  ItemRecord record : elements) {
    File file=record.getFile();
    IFile iFile=file2IFile(file);
    File[] dependencies=computeDependencies(iFile);
    for (    File depFile : dependencies) {
      if (!repositoryTree.getChecked(depFile)) {
        errors.add("String_Node_Str" + record.getElement().getName() + "String_Node_Str"+ depFile.getName());
      }
    }
  }
  if (!errors.isEmpty()) {
    setErrorMessage(errors.get(0));
  }
 else {
    setErrorMessage(null);
  }
  updatePageStatus();
}
Program: 139058
Project: 139058
Buggy source:
public void createControl(Composite parent){
  Composite top=new Composite(parent,SWT.NONE);
  top.setLayout(new GridLayout());
  top.setLayoutData(new GridData(GridData.FILL_BOTH));
  createSelectComposite(top);
  createRepositoryTree(top);
  addListeners();
  initControlState();
  temporaryDisableTreeSelection();
  setControl(top);
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite top=new Composite(parent,SWT.NONE);
  top.setLayout(new GridLayout());
  top.setLayoutData(new GridData(GridData.FILL_BOTH));
  createSelectComposite(top);
  createRepositoryTree(top);
  addListeners();
  initControlState();
  setControl(top);
}