nus-yam/ex-repair huggingface dataset:
Program: 138957
Project: 138957
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>();
  dErrors.addAll(writer.check());
  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"));
  }
  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();
}

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>();
  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"));
  }
  dErrors.addAll(writer.check());
  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: 138958
Project: 138958
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);
    }
  }
  versionFile=DqFileUtils.getFile(basePath.toFile(),VERSION_FILE_NAME);
  definitionFile=DqFileUtils.getFile(basePath.toFile(),DEFINITION_FILE_NAME);
  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 (basePath != null) {
    versionFile=DqFileUtils.getFile(basePath.toFile(),VERSION_FILE_NAME);
    definitionFile=DqFileUtils.getFile(basePath.toFile(),DEFINITION_FILE_NAME);
  }
  return inValidRecords.toArray(new ItemRecord[inValidRecords.size()]);
}
Program: 138960
Project: 138960
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  IIndicatorNode indicatorNode=((IIndicatorNode)e.item.getData(INDICATORITEM));
  if (indicatorNode == null) {
    purposeLabel.setText(PURPOSE + ((TreeItem)e.item).getText());
    descriptionLabel.setText(DESCRIPTION + ((TreeItem)e.item).getText());
    return;
  }
  Indicator indicator=indicatorNode.getIndicatorInstance();
  IndicatorDefinition indicatorDefinition=indicator.getIndicatorDefinition();
  purposeLabel.setText(PURPOSE + MetadataHelper.getPurpose(indicatorDefinition));
  String description=DESCRIPTION + MetadataHelper.getDescription(indicatorDefinition);
  description=splitLongString(description);
  descriptionLabel.setText(description);
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  if (null == e.item) {
    return;
  }
  IIndicatorNode indicatorNode=((IIndicatorNode)e.item.getData(INDICATORITEM));
  if (indicatorNode == null) {
    purposeLabel.setText(PURPOSE + ((TreeItem)e.item).getText());
    descriptionLabel.setText(DESCRIPTION + ((TreeItem)e.item).getText());
    return;
  }
  Indicator indicator=indicatorNode.getIndicatorInstance();
  IndicatorDefinition indicatorDefinition=indicator.getIndicatorDefinition();
  purposeLabel.setText(PURPOSE + MetadataHelper.getPurpose(indicatorDefinition));
  String description=DESCRIPTION + MetadataHelper.getDescription(indicatorDefinition);
  description=splitLongString(description);
  descriptionLabel.setText(description);
}
Program: 138962
Project: 138962
Buggy source:
/** 
 * DOC bZhou Comment method "findValidMigrationTasks".
 * @return
 */
public static List<IMigrationTask> findWorksapceTasks(){
  List<IMigrationTask> validTasks=findValidTasks();
  Iterator<IMigrationTask> it=validTasks.iterator();
  while (it.hasNext()) {
    IMigrationTask task=it.next();
    if (task.getMigrationTaskType() == MigrationTaskType.DATABASE) {
      it.remove();
    }
  }
  return validTasks;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "findValidMigrationTasks".
 * @return
 */
public static List<IMigrationTask> findWorksapceTasks(){
  List<IMigrationTask> validTasks=getValidTasks();
  Iterator<IMigrationTask> it=validTasks.iterator();
  while (it.hasNext()) {
    IMigrationTask task=it.next();
    if (task.getMigrationTaskType() == MigrationTaskType.DATABASE) {
      it.remove();
    }
  }
  return validTasks;
}
Program: 138963
Project: 138963
Buggy source:
/** 
 * 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) {
    if (task.getMigrationTaskType() == type) {
      validTasks.add(task);
    }
  }
  if (specifiedVersion != null) {
    ProductVersion currentVersion=CorePlugin.getDefault().getProductVersion();
    return findValidTasks(specifiedVersion,currentVersion,validTasks);
  }
  return validTasks;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "findWorkspaceTaskByType".
 * @param type
 * @param specifiedVersion
 * @return
 */
public static List<IMigrationTask> findWorkspaceTaskByType(MigrationTaskType type,ProductVersion specifiedVersion){
  List<IMigrationTask> validTasks=new ArrayList<IMigrationTask>();
  for (  IMigrationTask task : allTasks) {
    if (task.getMigrationTaskType() == type) {
      validTasks.add(task);
    }
  }
  ProductVersion currentVersion=CorePlugin.getDefault().getProductVersion();
  return getValidTasks(specifiedVersion,currentVersion,validTasks);
}
Program: 138964
Project: 138964
Buggy source:
/** 
 * make the value range to decrease DOC zshen Comment method "increamVernier".
 */
public static void decreaseVernier(){
  if (startNum >= XQueryExpressionUtil.ROWS_PER_PAGE) {
    endNum-=XQueryExpressionUtil.ROWS_PER_PAGE;
    startNum-=XQueryExpressionUtil.ROWS_PER_PAGE;
  }
}

Fixed version (ground truth):
/** 
 * make the value range to decrease DOC zshen Comment method "increamVernier".
 */
public static void decreaseVernier(){
  if (startNum >= XQueryExpressionUtil.ROWS_PER_PAGE) {
    startNum-=XQueryExpressionUtil.ROWS_PER_PAGE;
  }
}
Program: 138965
Project: 138965
Buggy source:
/** 
 * DOC zshen Comment method "toParseXquery". get the key parameter for tableNode、startNum.....
 * @param xqueryStr
 */
public static void toParseXquery(String xqueryStr){
  int beginIndex=0;
  int endIndex=0;
  beginIndex=xqueryStr.indexOf("String_Node_Str") + 2;
  endIndex=xqueryStr.indexOf("String_Node_Str",beginIndex);
  tableNode=xqueryStr.substring(beginIndex,endIndex);
  beginIndex=xqueryStr.indexOf("String_Node_Str",endIndex) + 1;
  endIndex=xqueryStr.indexOf("String_Node_Str",beginIndex);
  startNum=Integer.parseInt(xqueryStr.substring(beginIndex,endIndex));
  beginIndex=endIndex + 1;
  endIndex=xqueryStr.indexOf("String_Node_Str",beginIndex);
  endNum=Integer.parseInt(xqueryStr.substring(beginIndex,endIndex));
  beginIndex=xqueryStr.indexOf("String_Node_Str",endIndex) + 6;
  endIndex=xqueryStr.indexOf("String_Node_Str",beginIndex);
  columnNodeNameArraystr=xqueryStr.substring(beginIndex,endIndex);
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "toParseXquery". get the key parameter for tableNode、startNum.....
 * @param xqueryStr
 */
public static void toParseXquery(String xqueryStr){
  int beginIndex=0;
  int endIndex=0;
  beginIndex=xqueryStr.indexOf("String_Node_Str") + 2;
  endIndex=xqueryStr.indexOf("String_Node_Str",beginIndex);
  tableNode=xqueryStr.substring(beginIndex,endIndex);
  beginIndex=xqueryStr.indexOf("String_Node_Str",endIndex) + 1;
  endIndex=xqueryStr.indexOf("String_Node_Str",beginIndex);
  startNum=Integer.parseInt(xqueryStr.substring(beginIndex,endIndex));
  beginIndex=xqueryStr.indexOf("String_Node_Str",endIndex) + 6;
  endIndex=xqueryStr.indexOf("String_Node_Str",beginIndex);
  columnNodeNameArraystr=xqueryStr.substring(beginIndex,endIndex);
}
Program: 138966
Project: 138966
Buggy source:
/** 
 * make the value range to increase DOC zshen Comment method "increamVernier".
 */
public static void increaseVernier(){
  endNum+=XQueryExpressionUtil.ROWS_PER_PAGE;
  startNum+=XQueryExpressionUtil.ROWS_PER_PAGE;
}

Fixed version (ground truth):
/** 
 * make the value range to increase DOC zshen Comment method "increamVernier".
 */
public static void increaseVernier(){
  startNum+=XQueryExpressionUtil.ROWS_PER_PAGE;
}
Program: 138967
Project: 138967
Buggy source:
/** 
 * DOC zshen Comment method "getExpression".
 * @return return the xquery statment which use current key parameter.
 */
public static String getExpression(){
  if (tableNode == null) {
    return null;
  }
  expression.delete(0,expression.length());
  expression.append("String_Node_Str");
  expression.append(tableNode);
  expression.append("String_Node_Str");
  expression.append(tableNode);
  expression.append("String_Node_Str");
  expression.append(startNum);
  expression.append("String_Node_Str");
  expression.append(endNum);
  expression.append("String_Node_Str");
  expression.append(tableNode);
  expression.append("String_Node_Str");
  expression.append(columnNodeNameArraystr == null ? "String_Node_Str" + tableNode : columnNodeNameArraystr);
  expression.append("String_Node_Str");
  return expression.toString();
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "getExpression".
 * @return return the xquery statment which use current key parameter.
 */
public static String getExpression(){
  if (tableNode == null) {
    return null;
  }
  expression.delete(0,expression.length());
  expression.append("String_Node_Str");
  expression.append(tableNode);
  expression.append("String_Node_Str");
  expression.append(tableNode);
  expression.append("String_Node_Str");
  expression.append(startNum);
  expression.append("String_Node_Str");
  expression.append(ROWS_PER_PAGE);
  expression.append("String_Node_Str");
  expression.append(tableNode);
  expression.append("String_Node_Str");
  expression.append(columnNodeNameArraystr == null ? "String_Node_Str" + tableNode : columnNodeNameArraystr);
  expression.append("String_Node_Str");
  return expression.toString();
}
Program: 138968
Project: 138968
Buggy source:
/** 
 * 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;
}

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) {
    if (task.getMigrationTaskType() == type) {
      validTasks.add(task);
    }
  }
  if (specifiedVersion != null) {
    ProductVersion currentVersion=CorePlugin.getDefault().getProductVersion();
    return findValidTasks(specifiedVersion,currentVersion,validTasks);
  }
  return validTasks;
}
Program: 138969
Project: 138969
Buggy source:
public DQRespositoryView(){
  super();
  DQStructureManager manager=DQStructureManager.getInstance();
  if (manager.isNeedCreateStructure()) {
    manager.createDQStructure();
  }
  if (manager.isNeedMigration()) {
    MigrationTaskManager.doMigrationTask(MigrationTaskManager.findNonDBValidTasks());
  }
}

Fixed version (ground truth):
public DQRespositoryView(){
  super();
  DQStructureManager manager=DQStructureManager.getInstance();
  if (manager.isNeedCreateStructure()) {
    manager.createDQStructure();
  }
  if (manager.isNeedMigration()) {
    MigrationTaskManager.doMigrationTask(MigrationTaskManager.findWorksapceTasks());
  }
}
Program: 138970
Project: 138970
Buggy source:
/** 
 * DOC bZhou Comment method "registerSection".
 * @param composite
 */
public void registerSection(ExpandableComposite composite){
  expandCompositeList.add(composite);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "registerSection".
 * @param composite
 */
public void registerSection(ExpandableComposite composite){
  expandCompositeList.add(composite);
  currentEditor.getToolBar().getEditorBarWrap().addExpandableComposite(composite);
}
Program: 138971
Project: 138971
Buggy source:
/** 
 * DOC mzhao Get all indicators (depend on the folder which is SYSTEM or USER DEFINE).
 * @param IndicatorFodler
 * @return
 */
public Collection<IndicatorDefinition> getAllIndicators(IFolder IndicatorFodler){
  try {
    searchAllIndicators(IndicatorFodler);
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  return idsMap.values();
}

Fixed version (ground truth):
/** 
 * DOC mzhao Get all indicators (depend on the folder which is SYSTEM or USER DEFINE).
 * @param indicatorFodler
 * @return
 */
public Collection<IndicatorDefinition> getAllIndicators(IFolder indicatorFodler){
  try {
    searchAllIndicators(indicatorFodler);
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  return idsMap.values();
}
Program: 138972
Project: 138972
Buggy source:
/** 
 * 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;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isAnalysis". Decide it's an analysis or not.
 * @param element
 * @return
 */
public static boolean isAnalysis(EObject element){
  return ANALYSIS.doSwitch(element) != null;
}
Program: 138973
Project: 138973
Buggy source:
/** 
 * 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;
}

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

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isSoftware". Decide it's a software system or not.
 * @param element
 * @return
 */
public static boolean isSoftware(EObject element){
  return SOFTWARE.doSwitch(element) != null;
}
Program: 138975
Project: 138975
Buggy source:
/** 
 * 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;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isPattern". Decide it's a pattern or not.
 * @param element
 * @return
 */
public static boolean isPattern(EObject element){
  return PATTERN.doSwitch(element) != null;
}
Program: 138976
Project: 138976
Buggy source:
/** 
 * 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;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isID". Decide it's an indicator defintion or not.
 * @param element
 * @return
 */
public static boolean isID(EObject element){
  return INDICATOR_DEFINITION.doSwitch(element) != null;
}
Program: 138977
Project: 138977
Buggy source:
/** 
 * 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;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isDataProvider". Decide it's a data provider or not.
 * @param element
 * @return
 */
public static boolean isDataProvider(EObject element){
  return SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(element) != null;
}
Program: 138978
Project: 138978
Buggy source:
/** 
 * 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;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isDQRule". Decide it's a dq rule or not.
 * @param element
 * @return
 */
public static boolean isDQRule(EObject element){
  return DQ_RULE.doSwitch(element) != null;
}
Program: 138979
Project: 138979
Buggy source:
private Resource getResourceFromFile(){
  EMFUtil util=new EMFUtil();
  Resource definitionsFile=null;
  IPath definitionPath=ResourceManager.getLibrariesFolder().getFullPath().append(FILENAME);
  URI uri=URI.createPlatformResourceURI(definitionPath.toString(),false);
  try {
    definitionsFile=util.getResourceSet().getResource(uri,true);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + uri);
    }
  }
 catch (  RuntimeException e) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + e.getMessage(),e);
    }
  }
  if (definitionsFile == null) {
    needCopy=true;
    uri=URI.createPlatformPluginURI(PLUGIN_PATH,false);
    try {
      definitionsFile=util.getResourceSet().getResource(uri,true);
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + uri);
      }
    }
 catch (    RuntimeException e) {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + e.getMessage(),e);
      }
    }
  }
  if (definitionsFile == null) {
    definitionsFile=util.getResourceSet().getResource(URI.createFileURI("String_Node_Str" + File.separator + PLUGIN_PATH),true);
  }
  if (definitionsFile == null) {
    log.error("String_Node_Str" + PLUGIN_PATH + "String_Node_Str"+ uri);
    return null;
  }
  return definitionsFile;
}

Fixed version (ground truth):
private Resource getResourceFromFile(){
  EMFUtil util=new EMFUtil();
  Resource definitionsFile=null;
  IPath definitionPath=ResourceManager.getLibrariesFolder().getFullPath().append(FILENAME);
  URI uri=URI.createPlatformResourceURI(definitionPath.toString(),false);
  try {
    definitionsFile=util.getResourceSet().getResource(uri,true);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + uri);
    }
  }
 catch (  RuntimeException e) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + e.getMessage(),e);
    }
  }
  if (definitionsFile == null) {
    uri=URI.createPlatformPluginURI(PLUGIN_PATH,false);
    try {
      definitionsFile=util.getResourceSet().getResource(uri,true);
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + uri);
      }
    }
 catch (    RuntimeException e) {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + e.getMessage(),e);
      }
    }
  }
  if (definitionsFile == null) {
    definitionsFile=util.getResourceSet().getResource(URI.createFileURI("String_Node_Str" + File.separator + PLUGIN_PATH),true);
  }
  if (definitionsFile == null) {
    log.error("String_Node_Str" + PLUGIN_PATH + "String_Node_Str"+ uri);
    return null;
  }
  return definitionsFile;
}
Program: 138980
Project: 138980
Buggy source:
public static DefinitionHandler getInstance(){
  if (instance == null) {
    instance=new DefinitionHandler();
    if (instance.needCopy) {
      instance.copyDefinitionsIntoFolder(ResourceManager.getLibrariesFolder());
    }
  }
  return instance;
}

Fixed version (ground truth):
public static DefinitionHandler getInstance(){
  if (instance == null) {
    instance=new DefinitionHandler();
    if (!getTalendDefinitionFile().exists()) {
      instance.copyDefinitionsIntoFolder(ResourceManager.getLibrariesFolder());
    }
  }
  return instance;
}
Program: 138981
Project: 138981
Buggy source:
@Override public boolean valid(){
  talendDefinitionFile=DefinitionHandler.getTalendDefinitionFile();
  return talendDefinitionFile.exists() && super.valid();
}

Fixed version (ground truth):
@Override public boolean valid(){
  talendDefinitionFile=DefinitionHandler.getTalendDefinitionFile();
  try {
    talendDefinitionFile.getParent().refreshLocal(IResource.DEPTH_ONE,null);
  }
 catch (  CoreException e) {
  }
  return talendDefinitionFile.exists() && super.valid();
}
Program: 138982
Project: 138982
Buggy source:
public void inputChanged(Viewer viewer,Object oldInput,Object newInput){
}

Fixed version (ground truth):
public void inputChanged(Viewer viewer,Object oldInput,Object newInput){
  ItemRecord.clear();
}
Program: 138983
Project: 138983
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];
    retrieveProjectName(anyRecord);
  }
  versionFile=new Path(basePath).append("String_Node_Str").toFile();
  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(VERSION_PATH).toFile();
  return inValidRecords.toArray(new ItemRecord[inValidRecords.size()]);
}
Program: 138984
Project: 138984
Buggy source:
public void finish(ItemRecord[] records) throws IOException {
  ItemRecord.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(new Path(versionFile.getAbsolutePath()));
        List<IMigrationTask> migrationTasks=MigrationTaskManager.findWorkspaceTaskByType(MigrationTaskType.FILE,version);
        MigrationTaskManager.doMigrationTask(migrationTasks);
      }
      CorePlugin.getDefault().refreshWorkSpace();
      CorePlugin.getDefault().refreshDQView();
    }
  }
);
}

Fixed version (ground truth):
public void finish(ItemRecord[] records) throws IOException {
  ItemRecord.clear();
  File defFile=new Path(basePath).append(DEFINITION_PATH).toFile();
  if (defFile.exists()) {
    File defintionFile=ResourceManager.getRootProject().getFile(DEFINITION_PATH).getLocation().toFile();
    FilesUtils.copyFile(defFile,defintionFile);
  }
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (versionFile != null) {
        ProductVersion version=WorkspaceVersionHelper.getVesion(new Path(versionFile.getAbsolutePath()));
        List<IMigrationTask> migrationTasks=MigrationTaskManager.findWorkspaceTaskByType(MigrationTaskType.FILE,version);
        MigrationTaskManager.doMigrationTask(migrationTasks);
      }
      CorePlugin.getDefault().refreshWorkSpace();
      CorePlugin.getDefault().refreshDQView();
    }
  }
);
}
Program: 138985
Project: 138985
Buggy source:
/** 
 * DOC bZhou Comment method "create".
 * @param fileExtension
 * @return
 */
public AElementPersistance create(String fileExtension){
  if (FactoriesUtil.ANA.equals(fileExtension)) {
    return createAnalysisWrite();
  }
 else   if (FactoriesUtil.REP.equals(fileExtension)) {
    return createReportWriter();
  }
 else   if (FactoriesUtil.PROV.equals(fileExtension)) {
    return createDataProviderWriter();
  }
 else   if (FactoriesUtil.PATTERN.equals(fileExtension)) {
    return createPatternWriter();
  }
 else   if (FactoriesUtil.UDI.equals(fileExtension)) {
    return createUDIndicatorWriter();
  }
 else   if (FactoriesUtil.DQRULE.equals(fileExtension)) {
    return createdRuleWriter();
  }
 else   if (FactoriesUtil.SOFTWARE_SYSTEM.equals(fileExtension)) {
    return createSoftwareSystemWriter();
  }
 else   if (FactoriesUtil.TALEND_DEFINITION.equals(fileExtension)) {
    return createSYSIndicatorWriter();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * 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;
}
Program: 138986
Project: 138986
Buggy source:
private void copyFileToFolder(InputStream inputStream,String fileName,IFolder folder) throws CoreException {
  if (inputStream == null) {
    return;
  }
  IFile file=folder.getFile(fileName);
  if (file.exists()) {
    return;
  }
  file.create(inputStream,false,null);
}

Fixed version (ground truth):
private void copyFileToFolder(InputStream inputStream,String fileName,IFolder folder) throws CoreException {
  if (inputStream == null) {
    return;
  }
  IFile file=folder.getFile(fileName);
  if (!file.exists()) {
    file.create(inputStream,false,null);
    ModelElement modelElement=ModelElementFileFactory.getModelElement(file);
    if (modelElement != null) {
      AElementPersistance writer=ElementWriterFactory.getInstance().create(file.getFileExtension());
      if (writer != null) {
        writer.save(modelElement);
      }
    }
  }
}
Program: 138987
Project: 138987
Buggy source:
/** 
 * DOC bZhou Comment method "getVesion".
 * @param versionFile
 * @return
 */
public static ProductVersion getVesion(IPath versionPath){
  File versionFile=versionPath == null ? null : versionPath.toFile();
  if (productVersion == null) {
    try {
      if (versionFile != null && versionFile.exists()) {
        Properties pros=new Properties();
        pros.load(new FileInputStream(versionFile));
        String version=pros.getProperty(VERSION);
        if (version != null && !"String_Node_Str".equals(version)) {
          productVersion=ProductVersion.fromString(version);
        }
      }
 else {
        productVersion=new ProductVersion(0,0,0);
      }
    }
 catch (    Exception e) {
      log.error(e,e);
    }
  }
  return productVersion;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getVesion".
 * @param versionFile
 * @return
 */
public static ProductVersion getVesion(IPath versionPath){
  File versionFile=versionPath == null ? null : versionPath.toFile();
  ProductVersion pVersion=null;
  try {
    if (versionFile != null && versionFile.exists()) {
      Properties pros=new Properties();
      pros.load(new FileInputStream(versionFile));
      String version=pros.getProperty(VERSION);
      if (version != null && !"String_Node_Str".equals(version)) {
        pVersion=ProductVersion.fromString(version);
      }
    }
 else {
      pVersion=new ProductVersion(0,0,0);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return pVersion;
}
Program: 138988
Project: 138988
Buggy source:
@Override protected boolean doExecute() throws Exception {
  ModelElement[] allElements=ModelElementFileFactory.getALLElements(false);
  for (  ModelElement element : allElements) {
    String propertyPath=MetadataHelper.getPropertyPath(element);
    if (propertyPath == null) {
      DQRuleWriter writer=ElementWriterFactory.getInstance().createdRuleWriter();
      writer.savePerperties(element);
    }
 else {
      IFile propertyFile=ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(propertyPath));
      if (!propertyFile.exists()) {
        DQRuleWriter writer=ElementWriterFactory.getInstance().createdRuleWriter();
        writer.savePerperties(element);
      }
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean doExecute() throws Exception {
  ModelElement[] allElements=ModelElementFileFactory.getALLElements(false);
  for (  ModelElement element : allElements) {
    AElementPersistance writer=ElementWriterFactory.getInstance().create(element);
    writer.save(element);
  }
  return true;
}
Program: 138989
Project: 138989
Buggy source:
@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();
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  TreeItem item=(TreeItem)e.item;
  ItemRecord record=(ItemRecord)item.getData();
  if (record.getFile().isFile()) {
    for (    File file : record.getDependencyMap().keySet()) {
      repositoryTree.setChecked(ItemRecord.findRecord(file),item.getChecked());
    }
    repositoryTree.refresh();
    checkForErrors();
  }
}
Program: 138990
Project: 138990
Buggy source:
/** 
 * DOC bZhou Comment method "computInput".
 * @return
 */
private Object computInput(){
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  return specifiedPath == null ? ResourceManager.getRootProject().getLocation().toFile() : workspace.getRoot().getFolder(new Path(specifiedPath)).getLocation().toFile();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "computInput".
 * @return
 */
private ItemRecord computInput(){
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  File file=specifiedPath == null ? ResourceManager.getRootProject().getLocation().toFile() : workspace.getRoot().getFolder(new Path(specifiedPath)).getLocation().toFile();
  return new ItemRecord(file);
}
Program: 138991
Project: 138991
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: 138993
Project: 138993
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=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();
}

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) {
    Map<File,ModelElement> dependencyMap=record.getDependencyMap();
    for (    File depFile : dependencyMap.keySet()) {
      if (!repositoryTree.getChecked(ItemRecord.findRecord(depFile))) {
        ModelElement element=dependencyMap.get(depFile);
        String fileName=element != null ? element.getName() : depFile.getName();
        errors.add("String_Node_Str" + record.getElement().getName() + "String_Node_Str"+ fileName);
      }
    }
  }
  if (!errors.isEmpty()) {
    setErrorMessage(errors.get(0));
  }
 else {
    setErrorMessage(null);
  }
  updatePageStatus();
}
Program: 138994
Project: 138994
Buggy source:
public Object[] getChildren(Object parentElement){
  List<File> objects=new ArrayList<File>();
  if (parentElement instanceof File) {
    File[] files=((File)parentElement).listFiles();
    if (files != null) {
      for (      File file : files) {
        if (file.isDirectory() && isValidDirectory(file)) {
          objects.add(file);
        }
        if (file.isFile() && isValidFile(file)) {
          objects.add(file);
        }
      }
    }
  }
  return objects.toArray();
}

Fixed version (ground truth):
public Object[] getChildren(Object parentElement){
  if (parentElement instanceof ItemRecord) {
    ItemRecord record=(ItemRecord)parentElement;
    return record.getChildern();
  }
  return new Object[0];
}
Program: 138995
Project: 138995
Buggy source:
public Object getParent(Object element){
  if (element instanceof File) {
    return ((File)element).getParent();
  }
  return null;
}

Fixed version (ground truth):
public Object getParent(Object element){
  if (element instanceof ItemRecord) {
    return ((ItemRecord)element).getParent();
  }
  return null;
}
Program: 138996
Project: 138996
Buggy source:
public boolean hasChildren(Object element){
  if (element instanceof File) {
    File[] listFiles=((File)element).listFiles();
    return listFiles != null && listFiles.length > 0;
  }
  return false;
}

Fixed version (ground truth):
public boolean hasChildren(Object element){
  if (element instanceof ItemRecord) {
    File[] listFiles=((ItemRecord)element).getFile().listFiles();
    return listFiles != null && listFiles.length > 0;
  }
  return false;
}
Program: 138997
Project: 138997
Buggy source:
@Override public String getText(Object element){
  if (element instanceof File) {
    File file=(File)element;
    String fileExtension=new Path(file.getName()).getFileExtension();
    if (file.isFile() && FactoriesUtil.isEmfFile(fileExtension)) {
      EMFUtil emfUtil=new EMFUtil();
      URI uri=URI.createFileURI(file.getAbsolutePath());
      Resource resource=emfUtil.getResourceSet().getResource(uri,true);
      EList<EObject> contents=resource.getContents();
      if (contents != null && !contents.isEmpty()) {
        EObject eObject=contents.get(0);
        if (eObject instanceof ModelElement) {
          return ((ModelElement)eObject).getName();
        }
      }
    }
    return file.getName();
  }
  return super.getText(element);
}

Fixed version (ground truth):
@Override public String getText(Object element){
  if (element instanceof ItemRecord) {
    ItemRecord recored=(ItemRecord)element;
    File file=recored.getFile();
    String fileExtension=new Path(file.getName()).getFileExtension();
    if (file.isFile() && FactoriesUtil.isEmfFile(fileExtension)) {
      EMFUtil emfUtil=new EMFUtil();
      URI uri=URI.createFileURI(file.getAbsolutePath());
      Resource resource=emfUtil.getResourceSet().getResource(uri,true);
      EList<EObject> contents=resource.getContents();
      if (contents != null && !contents.isEmpty()) {
        EObject eObject=contents.get(0);
        if (eObject instanceof ModelElement) {
          return ((ModelElement)eObject).getName();
        }
      }
    }
    return file.getName();
  }
  return super.getText(element);
}
Program: 138998
Project: 138998
Buggy source:
@Override public Image getImage(Object element){
  Image image=null;
  if (element instanceof File) {
    File file=(File)element;
    String fileName=file.getName();
    if (file.isDirectory()) {
      image=ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
      EResourceConstant constant=resolveResourceConstant(fileName);
      if (constant != null) {
switch (constant) {
case DATA_PROFILING:
          image=ImageLib.getImage(ImageLib.DATA_PROFILING);
        break;
case METADATA:
      image=ImageLib.getImage(ImageLib.METADATA);
    break;
case LIBRARIES:
  image=ImageLib.getImage(ImageLib.LIBRARIES);
break;
case ANALYSIS:
break;
case REPORTS:
break;
case EXCHANGE:
image=ImageLib.getImage(ImageLib.EXCHANGE);
break;
case DB_CONNECTIONS:
case MDM_CONNECTIONS:
image=ImageLib.getImage(ImageLib.CONNECTION);
break;
default :
break;
}
}
}
 else {
if (fileName.endsWith(FactoriesUtil.ANA)) {
image=ImageLib.getImage(ImageLib.ANALYSIS_OBJECT);
}
 else if (fileName.endsWith(FactoriesUtil.REP)) {
image=ImageLib.getImage(ImageLib.REPORT_OBJECT);
}
 else if (fileName.endsWith(FactoriesUtil.PATTERN)) {
image=ImageLib.getImage(ImageLib.PATTERN_REG);
}
 else if (fileName.endsWith(FactoriesUtil.DQRULE)) {
image=ImageLib.getImage(ImageLib.DQ_RULE);
}
 else if (fileName.endsWith(FactoriesUtil.PROV)) {
image=ImageLib.getImage(ImageLib.TD_DATAPROVIDER);
}
 else if (fileName.endsWith(FactoriesUtil.UDI)) {
image=ImageLib.getImage(ImageLib.IND_DEFINITION);
}
}
}
return image != null ? image : super.getImage(element);
}

Fixed version (ground truth):
@Override public Image getImage(Object element){
  Image image=null;
  if (element instanceof ItemRecord) {
    ItemRecord record=(ItemRecord)element;
    File file=record.getFile();
    String fileName=file.getName();
    if (file.isDirectory()) {
      image=ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
      EResourceConstant constant=resolveResourceConstant(fileName);
      if (constant != null) {
switch (constant) {
case DATA_PROFILING:
          image=ImageLib.getImage(ImageLib.DATA_PROFILING);
        break;
case METADATA:
      image=ImageLib.getImage(ImageLib.METADATA);
    break;
case LIBRARIES:
  image=ImageLib.getImage(ImageLib.LIBRARIES);
break;
case ANALYSIS:
break;
case REPORTS:
break;
case EXCHANGE:
image=ImageLib.getImage(ImageLib.EXCHANGE);
break;
case DB_CONNECTIONS:
case MDM_CONNECTIONS:
image=ImageLib.getImage(ImageLib.CONNECTION);
break;
default :
break;
}
}
}
 else {
if (fileName.endsWith(FactoriesUtil.ANA)) {
image=ImageLib.getImage(ImageLib.ANALYSIS_OBJECT);
}
 else if (fileName.endsWith(FactoriesUtil.REP)) {
image=ImageLib.getImage(ImageLib.REPORT_OBJECT);
}
 else if (fileName.endsWith(FactoriesUtil.PATTERN)) {
image=ImageLib.getImage(ImageLib.PATTERN_REG);
}
 else if (fileName.endsWith(FactoriesUtil.DQRULE)) {
image=ImageLib.getImage(ImageLib.DQ_RULE);
}
 else if (fileName.endsWith(FactoriesUtil.PROV)) {
image=ImageLib.getImage(ImageLib.TD_DATAPROVIDER);
}
 else if (fileName.endsWith(FactoriesUtil.UDI)) {
image=ImageLib.getImage(ImageLib.IND_DEFINITION);
}
}
}
return image != null ? image : super.getImage(element);
}
Program: 138999
Project: 138999
Buggy source:
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);
}

Fixed version (ground truth):
public void finish(ItemRecord[] records) throws IOException {
  ItemRecord.clear();
  if (PluginChecker.isTDCPLoaded()) {
    IFile projFile=ResourceManager.getRootProject().getFile("String_Node_Str");
    copyFileToDest(projFile);
  }
  IFile versionFile=WorkspaceVersionHelper.getVersionFile();
  copyFileToDest(versionFile);
}
Program: 139000
Project: 139000
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(){
      if (versionFile != null) {
        ProductVersion version=WorkspaceVersionHelper.getVesion(new Path(versionFile.getAbsolutePath()));
        List<IMigrationTask> migrationTasks=MigrationTaskManager.findWorkspaceTaskByType(MigrationTaskType.FILE,version);
        MigrationTaskManager.doMigrationTask(migrationTasks);
      }
      CorePlugin.getDefault().refreshWorkSpace();
      CorePlugin.getDefault().refreshDQView();
    }
  }
);
}

Fixed version (ground truth):
public void finish(ItemRecord[] records) throws IOException {
  ItemRecord.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(new Path(versionFile.getAbsolutePath()));
        List<IMigrationTask> migrationTasks=MigrationTaskManager.findWorkspaceTaskByType(MigrationTaskType.FILE,version);
        MigrationTaskManager.doMigrationTask(migrationTasks);
      }
      CorePlugin.getDefault().refreshWorkSpace();
      CorePlugin.getDefault().refreshDQView();
    }
  }
);
}
Program: 139001
Project: 139001
Buggy source:
/** 
 * DOC bZhou Comment method "checkDependency".
 * @param record
 */
private void checkDependency(ItemRecord record){
  List<ModelElement> dependencyElements=new ArrayList<ModelElement>();
  ModelElement element=record.getElement();
  if (element != null) {
    ModelElementHelper.iterateClientDependencies(element,dependencyElements);
    for (    ModelElement melement : dependencyElements) {
      if (melement.eIsProxy()) {
        InternalEObject inObject=(InternalEObject)melement;
        record.addError("String_Node_Str" + element.getName() + "String_Node_Str"+ inObject.eProxyURI().toFileString());
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "checkDependency".
 * @param record
 */
private void checkDependency(ItemRecord record){
  for (  ModelElement melement : record.getDependencyMap().values()) {
    if (melement.eIsProxy()) {
      InternalEObject inObject=(InternalEObject)melement;
      record.addError("String_Node_Str" + record.getElement().getName() + "String_Node_Str"+ inObject.eProxyURI().toFileString());
    }
  }
}
Program: 139002
Project: 139002
Buggy source:
@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();
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  TreeItem item=(TreeItem)e.item;
  ItemRecord record=(ItemRecord)item.getData();
  if (record.getFile().isFile()) {
    for (    File file : record.getDependencyMap().keySet()) {
      ItemRecord findRecord=ItemRecord.findRecord(file);
      if (findRecord != null) {
        repositoryTree.setChecked(findRecord,item.getChecked());
      }
    }
  }
  repositoryTree.refresh();
  checkforErrors();
}
Program: 139003
Project: 139003
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.refresh();
    writer.setBasePath(dirTxt.getText());
  }
 else {
    repositoryTree.setInput(null);
  }
  checkforErrors();
}

Fixed version (ground truth):
/** 
 * DOC sgandon Comment method "dirTextModified".
 */
protected void dirTextModified(){
  File file=new File(dirTxt.getText());
  if (file.exists()) {
    repositoryTree.setInput(new ItemRecord(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();
}