nus-yam/ex-repair huggingface dataset:
Program: 139461
Project: 139461
Buggy source:
@Override public void refresh(AbstractAnalysisMetadataPage masterPage){
  this.masterPage=(ColumnsComparisonMasterDetailsPage)masterPage;
  this.summaryComp.dispose();
  this.analyzedColumnSetsComp.dispose();
  this.analysisResultsComp.dispose();
  createFormContent(getManagedForm());
}

Fixed version (ground truth):
@Override public void refresh(AbstractAnalysisMetadataPage masterPage){
  this.masterPage=(ColumnsComparisonMasterDetailsPage)masterPage;
  if (summaryComp != null && !summaryComp.isDisposed()) {
    summaryComp.dispose();
  }
  if (analyzedColumnSetsComp != null && !analyzedColumnSetsComp.isDisposed()) {
    analyzedColumnSetsComp.dispose();
  }
  if (analysisResultsComp != null && !analysisResultsComp.isDisposed()) {
    analysisResultsComp.dispose();
  }
  createFormContent(getManagedForm());
}
Program: 139462
Project: 139462
Buggy source:
@Override public void refresh(){
}

Fixed version (ground truth):
@Override public void refresh(){
  switchToResultPage();
}
Program: 139463
Project: 139463
Buggy source:
@Override public void refresh(AbstractAnalysisMetadataPage masterPage){
  this.masterPage=(TableMasterDetailsPage)masterPage;
  this.summaryComp.dispose();
  this.resultComp.dispose();
  createFormContent(getManagedForm());
}

Fixed version (ground truth):
@Override public void refresh(AbstractAnalysisMetadataPage masterPage){
  this.masterPage=(TableMasterDetailsPage)masterPage;
  if (summaryComp != null && !summaryComp.isDisposed()) {
    summaryComp.dispose();
  }
  if (resultComp != null && !resultComp.isDisposed()) {
    resultComp.dispose();
  }
  createFormContent(getManagedForm());
}
Program: 139464
Project: 139464
Buggy source:
public void showResults(){
  for (  ModelMatcher patternMatcher : this.modelMatchers) {
    if (patternMatcher.getScore() > 0) {
      System.out.print(patternMatcher.getModel() + "String_Node_Str" + patternMatcher.getScore()+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void showResults(){
  for (  ModelMatcher patternMatcher : this.modelMatchers) {
    if (patternMatcher.getScore() > 0) {
      if (logger.isInfoEnabled()) {
        logger.info(patternMatcher.getModel() + "String_Node_Str" + patternMatcher.getScore()+ "String_Node_Str");
      }
    }
  }
}
Program: 139466
Project: 139466
Buggy source:
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (element instanceof IFolder) {
    IFolder folder=(IFolder)element;
    return !folder.getName().endsWith(SVN_FOLDER_NAME);
  }
  return isShowFile;
}

Fixed version (ground truth):
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (element instanceof IFolder) {
    IFolder folder=(IFolder)element;
    return !folder.getName().endsWith(SVN_FOLDER_NAME);
  }
  if (element instanceof IFile && isShowFile) {
    IFile file=(IFile)element;
    return !file.getFileExtension().equals(FactoriesUtil.PROPERTIES_EXTENSION);
  }
  return isShowFile;
}
Program: 139467
Project: 139467
Buggy source:
@Override public void run(){
  if (files != null && files.length > 0) {
    for (    IFile file : files) {
      ModelElement oldObject=getOldEObject(file);
      if (oldObject != null) {
        ModelElement newObject=(ModelElement)EMFSharedResources.getInstance().copyEObject(oldObject);
        IFile newFile=getNewFile(file);
        newObject.setName("String_Node_Str" + newObject.getName());
        if (oldObject instanceof TdReport) {
          List<Analysis> anaLs=ReportHelper.getAnalyses((TdReport)oldObject);
          for (          Analysis analysis : anaLs) {
            DependenciesHandler.getInstance().setDependencyOn((TdReport)newObject,analysis);
            ((TdReport)newObject).addAnalysis(analysis);
          }
        }
        AElementPersistance elementPersistance=ElementWriterFactory.getInstance().create(newFile.getFileExtension());
        elementPersistance.save(newObject,newFile);
      }
    }
  }
}

Fixed version (ground truth):
@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);
      }
    }
  }
}
Program: 139468
Project: 139468
Buggy source:
private String getFunction(){
  Expression instantiatedExpression=dbmsLanguage.getInstantiatedExpression(indicator);
  final String body=instantiatedExpression.getBody();
  Pattern p=Pattern.compile(REGEX,Pattern.CASE_INSENSITIVE);
  Matcher matcher=p.matcher(body);
  matcher.find();
  String group=matcher.group(1);
  return group;
}

Fixed version (ground truth):
private String getFunction(){
  Expression instantiatedExpression=dbmsLanguage.getInstantiatedExpression(indicator);
  final String body=instantiatedExpression.getBody();
  Pattern p=Pattern.compile(REGEX,Pattern.CASE_INSENSITIVE);
  Matcher matcher=p.matcher(body);
  matcher.find();
  String group=matcher.group(2);
  group=group == null ? matcher.group(1) : group;
  return group;
}
Program: 139469
Project: 139469
Buggy source:
/** 
 * Method "getInstantiatedClause".
 * @return the where clause from the instantiated query
 */
protected String getInstantiatedClause(){
  String function=getFunction();
  String clause=entity.isLabelNull() || function == null ? columnName + dbmsLanguage.isNull() : function + dbmsLanguage.equal() + "String_Node_Str"+ entity.getKey()+ "String_Node_Str";
  return clause;
}

Fixed version (ground truth):
/** 
 * Method "getInstantiatedClause".
 * @return the where clause from the instantiated query
 */
protected String getInstantiatedClause(){
  String function=getFunction();
  TdColumn column=(TdColumn)indicator.getAnalyzedElement();
  int javaType=column.getJavaType();
  Object value=null;
  if (Java2SqlType.isNumbericInSQL(javaType) && dbmsLanguage instanceof DB2DbmsLanguage) {
    value=entity.getKey();
  }
 else {
    value="String_Node_Str" + entity.getKey() + "String_Node_Str";
  }
  String clause=entity.isLabelNull() || function == null ? columnName + dbmsLanguage.isNull() : function + dbmsLanguage.equal() + value;
  return clause;
}
Program: 139471
Project: 139471
Buggy source:
public ColumnSetKey(ColumnSet columnSetOwner){
  Package parent=EObjectHelper.getParent(columnSetOwner);
  if (parent != null) {
    this.catalogName=parent.getName();
  }
 else {
    this.catalogName="String_Node_Str";
  }
  this.columnSetName=columnSetOwner.getName();
}

Fixed version (ground truth):
public ColumnSetKey(ColumnSet columnSetOwner){
  Package parent=EObjectHelper.getParent(columnSetOwner);
  if (parent != null) {
    this.catalogName=parent.getName();
  }
 else {
    this.catalogName="String_Node_Str";
  }
  this.columnSetName=columnSetOwner.getName();
  this.columnSetOwner=columnSetOwner;
}
Program: 139472
Project: 139472
Buggy source:
public PackageKey(Package pckg){
  schemaName=SwitchHelpers.SCHEMA_SWITCH.doSwitch(pckg) == null ? "String_Node_Str" : SwitchHelpers.SCHEMA_SWITCH.doSwitch(pckg).getName();
  catalogName=SwitchHelpers.CATALOG_SWITCH.doSwitch(pckg) == null ? "String_Node_Str" : SwitchHelpers.CATALOG_SWITCH.doSwitch(pckg).getName();
}

Fixed version (ground truth):
public PackageKey(Package pckg){
  schemaName=SwitchHelpers.SCHEMA_SWITCH.doSwitch(pckg) == null ? "String_Node_Str" : SwitchHelpers.SCHEMA_SWITCH.doSwitch(pckg).getName();
  catalogName=SwitchHelpers.CATALOG_SWITCH.doSwitch(pckg) == null ? "String_Node_Str" : SwitchHelpers.CATALOG_SWITCH.doSwitch(pckg).getName();
  this.pakg=pckg;
}
Program: 139473
Project: 139473
Buggy source:
/** 
 * DOC yyi Comment method "checkIndicatorFields".
 * @return
 */
protected ReturnCode checkIndicatorFields(){
  String min=lowerText.getText().trim();
  String max=higherText.getText().trim();
  ReturnCode rc=new ReturnCode(true);
  String statusLabelText="String_Node_Str";
  if (isRangeForDate) {
    if ((!CheckValueUtils.isDateValue(min) && !CheckValueUtils.isEmpty(min)) || (!CheckValueUtils.isDateValue(max) && !CheckValueUtils.isEmpty(max))) {
      rc.setOk(false);
      statusLabelText+=MSG_ONLY_DATE + System.getProperty("String_Node_Str");
    }
  }
 else {
    if ((!CheckValueUtils.isNumberValue(min) && !CheckValueUtils.isEmpty(min)) || (!CheckValueUtils.isNumberValue(max) && !CheckValueUtils.isEmpty(max))) {
      rc.setOk(false);
      statusLabelText+=MSG_ONLY_NUMBER + System.getProperty("String_Node_Str");
    }
  }
  if (CheckValueUtils.isAoverB(min,max)) {
    rc.setOk(false);
    statusLabelText+=UIMessages.MSG_LOWER_LESS_HIGHER + System.getProperty("String_Node_Str");
  }
  rc.setMessage(statusLabelText);
  return rc;
}

Fixed version (ground truth):
/** 
 * DOC yyi Comment method "checkIndicatorFields".
 * @return
 */
protected ReturnCode checkIndicatorFields(){
  String min=null != lowerText ? lowerText.getText().trim() : "String_Node_Str";
  String max=null != higherText ? higherText.getText().trim() : "String_Node_Str";
  ReturnCode rc=new ReturnCode(true);
  String statusLabelText="String_Node_Str";
  if (isRangeForDate) {
    if ((!CheckValueUtils.isDateValue(min) && !CheckValueUtils.isEmpty(min)) || (!CheckValueUtils.isDateValue(max) && !CheckValueUtils.isEmpty(max))) {
      rc.setOk(false);
      statusLabelText+=MSG_ONLY_DATE + System.getProperty("String_Node_Str");
    }
  }
 else {
    if ((!CheckValueUtils.isNumberValue(min) && !CheckValueUtils.isEmpty(min)) || (!CheckValueUtils.isNumberValue(max) && !CheckValueUtils.isEmpty(max))) {
      rc.setOk(false);
      statusLabelText+=MSG_ONLY_NUMBER + System.getProperty("String_Node_Str");
    }
  }
  if (CheckValueUtils.isAoverB(min,max)) {
    rc.setOk(false);
    statusLabelText+=UIMessages.MSG_LOWER_LESS_HIGHER + System.getProperty("String_Node_Str");
  }
  rc.setMessage(statusLabelText);
  return rc;
}
Program: 139474
Project: 139474
Buggy source:
/** 
 * DOC yyi Comment method "checkIndicatorInPrecentFields".
 * @return
 */
protected ReturnCode checkIndicatorInPrecentFields(){
  String pmin=pLowerText.getText();
  String pmax=pHigherText.getText();
  ReturnCode rc=new ReturnCode(true);
  String statusLabelText="String_Node_Str";
  if ((!CheckValueUtils.isEmpty(pmin) && !CheckValueUtils.isRealNumberValue(pmin)) || (!CheckValueUtils.isEmpty(pmax) && !CheckValueUtils.isRealNumberValue(pmax))) {
    rc.setOk(false);
    statusLabelText+=MSG_ONLY_REAL_NUMBER + System.getProperty("String_Node_Str");
  }
  if (CheckValueUtils.isOutRange(MIN,MAX,pmin) || CheckValueUtils.isOutRange(MIN,MAX,pmax)) {
    rc.setOk(false);
    statusLabelText+=UIMessages.MSG_INDICATOR_VALUE_OUT_OF_RANGE + System.getProperty("String_Node_Str");
  }
  if (CheckValueUtils.isAoverB(pmin,pmax)) {
    rc.setOk(false);
    statusLabelText+=UIMessages.MSG_LOWER_LESS_HIGHER + System.getProperty("String_Node_Str");
  }
  rc.setMessage(statusLabelText);
  return rc;
}

Fixed version (ground truth):
/** 
 * DOC yyi Comment method "checkIndicatorInPrecentFields".
 * @return
 */
protected ReturnCode checkIndicatorInPrecentFields(){
  String pmin=null != pLowerText ? pLowerText.getText().trim() : "String_Node_Str";
  String pmax=null != pHigherText ? pHigherText.getText().trim() : "String_Node_Str";
  ReturnCode rc=new ReturnCode(true);
  String statusLabelText="String_Node_Str";
  if ((!CheckValueUtils.isEmpty(pmin) && !CheckValueUtils.isRealNumberValue(pmin)) || (!CheckValueUtils.isEmpty(pmax) && !CheckValueUtils.isRealNumberValue(pmax))) {
    rc.setOk(false);
    statusLabelText+=MSG_ONLY_REAL_NUMBER + System.getProperty("String_Node_Str");
  }
  if (CheckValueUtils.isOutRange(MIN,MAX,pmin) || CheckValueUtils.isOutRange(MIN,MAX,pmax)) {
    rc.setOk(false);
    statusLabelText+=UIMessages.MSG_INDICATOR_VALUE_OUT_OF_RANGE + System.getProperty("String_Node_Str");
  }
  if (CheckValueUtils.isAoverB(pmin,pmax)) {
    rc.setOk(false);
    statusLabelText+=UIMessages.MSG_LOWER_LESS_HIGHER + System.getProperty("String_Node_Str");
  }
  rc.setMessage(statusLabelText);
  return rc;
}
Program: 139477
Project: 139477
Buggy source:
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (element instanceof IFolder) {
    IFolder folder=(IFolder)element;
    if ("String_Node_Str".equals(folder.getName()) || "String_Node_Str".equals(folder.getName())) {
      return true;
    }
 else {
      return defaultValidFolder.getFullPath().isPrefixOf(folder.getFullPath());
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (element instanceof IFolder) {
    IFolder folder=(IFolder)element;
    if ("String_Node_Str".equals(folder.getName()) || "String_Node_Str".equals(folder.getName())) {
      return true;
    }
 else {
      return defaultValidFolder.getFullPath().isPrefixOf(folder.getFullPath()) && !folder.getName().endsWith(SVN_FOLDER_NAME);
    }
  }
  return false;
}
Program: 139479
Project: 139479
Buggy source:
public Image getImage(Object element){
  if (element instanceof IFolderNode) {
    return ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
  }
 else   if (element instanceof TdDataProvider) {
    return ImageLib.getImage(ImageLib.TD_DATAPROVIDER);
  }
 else   if (element instanceof TdColumn) {
    if (ColumnHelper.isPrimaryKey((TdColumn)element)) {
      return ImageLib.getImage(ImageLib.PK_COLUMN);
    }
  }
 else   if (element instanceof IEcosComponent) {
    return ImageLib.getImage(ImageLib.EXCHANGE);
  }
 else   if (element instanceof IEcosCategory) {
    return ImageLib.getImage(ImageLib.EXCHANGE);
  }
 else   if (element instanceof IndicatorDefinition) {
    return ImageLib.getImage(ImageLib.IND_DEFINITION);
  }
  return super.getImage(element);
}

Fixed version (ground truth):
public Image getImage(Object element){
  if (element instanceof IFolderNode) {
    return ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
  }
 else   if (element instanceof TdDataProvider) {
    return ImageLib.getImage(ImageLib.TD_DATAPROVIDER);
  }
 else   if (element instanceof TdColumn) {
    if (ColumnHelper.isPrimaryKey((TdColumn)element)) {
      return ImageLib.getImage(ImageLib.PK_COLUMN);
    }
  }
 else   if (element instanceof IEcosComponent) {
    return ImageLib.getImage(ImageLib.EXCHANGE);
  }
 else   if (element instanceof IEcosCategory) {
    return ImageLib.getImage(ImageLib.EXCHANGE);
  }
 else   if (element instanceof IndicatorDefinition) {
    return ImageLib.getImage(ImageLib.IND_DEFINITION);
  }
 else   if (element instanceof TdView) {
    return ImageLib.getImage(ImageLib.VIEW);
  }
  return super.getImage(element);
}
Program: 139480
Project: 139480
Buggy source:
/** 
 * {@inheritDoc}
 * @see org.eclipse.jface.viewers.ContentViewer#handleDispose(org.eclipse.swt.events.DisposeEvent)
 */
@Override protected void handleDispose(DisposeEvent event){
  super.handleDispose(event);
  if (exportMenu != null)   exportMenu.dispose();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see org.eclipse.jface.viewers.ContentViewer#handleDispose(org.eclipse.swt.events.DisposeEvent)
 */
@Override protected void handleDispose(DisposeEvent event){
  super.handleDispose(event);
  exportMenu.dispose();
}
Program: 139482
Project: 139482
Buggy source:
private void createTableViewerMenu(final TableViewer columnsElementViewer,final List<Column> columnList,final Button[] buttons){
  Table table=columnsElementViewer.getTable();
  Menu menu=new Menu(table);
  MenuItem menuItem=new MenuItem(menu,SWT.PUSH);
  menuItem.setImage(ImageLib.getImage(ImageLib.DELETE_ACTION));
  menuItem.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  menuItem.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      columnList.remove(((IStructuredSelection)columnsElementViewer.getSelection()).getFirstElement());
      columnsElementViewer.setInput(columnList);
      enabledButtons(buttons,false);
    }
  }
);
  MenuItem showMenuItem=new MenuItem(menu,SWT.CASCADE);
  showMenuItem.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  showMenuItem.setImage(ImageLib.getImage(ImageLib.EXPLORE_IMAGE));
  showMenuItem.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      showSelectedElements(columnsElementViewer);
    }
  }
);
  table.setMenu(menu);
}

Fixed version (ground truth):
private void createTableViewerMenu(final TableViewer columnsElementViewer,final List<Column> columnList,final Button[] buttons){
  Table table=columnsElementViewer.getTable();
  Menu menu=new Menu(table);
  MenuItem menuItem=new MenuItem(menu,SWT.PUSH);
  menuItem.setImage(ImageLib.getImage(ImageLib.DELETE_ACTION));
  menuItem.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  menuItem.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      if (columnList.remove(((IStructuredSelection)columnsElementViewer.getSelection()).getFirstElement())) {
        columnsElementViewer.setInput(columnList);
        enabledButtons(buttons,false);
        masterPage.setDirty(true);
      }
    }
  }
);
  MenuItem showMenuItem=new MenuItem(menu,SWT.CASCADE);
  showMenuItem.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  showMenuItem.setImage(ImageLib.getImage(ImageLib.EXPLORE_IMAGE));
  showMenuItem.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      showSelectedElements(columnsElementViewer);
    }
  }
);
  table.setMenu(menu);
}
Program: 139483
Project: 139483
Buggy source:
public boolean execute(){
  IFile definitionFile=ResourceManager.getLibrariesFolder().getFile(talendDefinitionFileName);
  if (definitionFile.exists()) {
    try {
      definitionFile.delete(true,null);
    }
 catch (    CoreException e) {
      log.error(e.getMessage(),e);
      return false;
    }
  }
  DefinitionHandler.getInstance();
  if (definitionFile != null) {
    File file=new File(definitionFile.getLocationURI());
    try {
      String content=FileUtils.readFileToString(file);
      content=StringUtils.replace(content,oldSoundexQuery,newSoundexQuery);
      FileUtils.writeStringToFile(file,content);
    }
 catch (    IOException e) {
      log.error(e.getMessage(),e);
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean execute(){
  IFile definitionFile=ResourceManager.getLibrariesFolder().getFile(talendDefinitionFileName);
  if (definitionFile.exists()) {
    try {
      definitionFile.delete(true,null);
    }
 catch (    CoreException e) {
      log.error(e.getMessage(),e);
      return false;
    }
  }
  DefinitionHandler.getInstance();
  if (definitionFile != null) {
    File file=new File(definitionFile.getLocationURI());
    try {
      String content=FileUtils.readFileToString(file);
      content=StringUtils.replace(content,oldSoundexQuery,newSoundexQuery);
      content=StringUtils.replace(content,oldPSoundexQuery,newPSoundexQuery);
      FileUtils.writeStringToFile(file,content);
    }
 catch (    IOException e) {
      log.error(e.getMessage(),e);
      return false;
    }
  }
  return true;
}
Program: 139484
Project: 139484
Buggy source:
@Override protected void handleRemoveElement(RemoveModelElement removeElement){
  TdColumn removeColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(removeElement.getLeftElement());
  if (removeColumn == null) {
    return;
  }
  popRemoveElementConfirm();
  ColumnSet columnSet=(ColumnSet)selectedObj;
  ColumnSetHelper.removeColumn(removeColumn,columnSet);
  if (ColumnHelper.isPrimaryKey(removeColumn)) {
    removeColumn.getUniqueKey().clear();
  }
}

Fixed version (ground truth):
@Override protected void handleRemoveElement(RemoveModelElement removeElement){
  TdColumn removeColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(removeElement.getLeftElement());
  if (removeColumn == null) {
    return;
  }
  popRemoveElementConfirm();
  ColumnSet columnSet=(ColumnSet)selectedObj;
  ColumnSetHelper.removeColumn(removeColumn,columnSet);
  if (ColumnHelper.isPrimaryKey(removeColumn)) {
    EList<UniqueKey> uniqueKeys=removeColumn.getUniqueKey();
    if (!uniqueKeys.isEmpty()) {
      UniqueKey pk=uniqueKeys.get(0);
      if (columnSet.getOwnedElement().contains(pk)) {
        columnSet.getOwnedElement().remove(pk);
      }
      uniqueKeys.clear();
    }
  }
}
Program: 139485
Project: 139485
Buggy source:
protected void handleDiffPackageElement(DiffElement difElement){
  AddModelElement addElement=addModelSwitch.doSwitch(difElement);
  if (addElement != null) {
    handleAddElement(addElement);
    return;
  }
  RemoveModelElement removeElement=removeModelSwitch.doSwitch(difElement);
  if (removeElement != null) {
    handleRemoveElement(removeElement);
  }
  RemoveReferenceValue refValue=removeReferenceValue.doSwitch(difElement);
  if (refValue != null) {
    handleRemoveRefElement(refValue);
  }
  if (difElement instanceof UpdateAttribute) {
    handleUpdateElement((UpdateAttribute)difElement);
    return;
  }
}

Fixed version (ground truth):
protected void handleDiffPackageElement(DiffElement difElement){
  AddModelElement addElement=addModelSwitch.doSwitch(difElement);
  if (addElement != null) {
    handleAddElement(addElement);
    return;
  }
  RemoveModelElement removeElement=removeModelSwitch.doSwitch(difElement);
  if (removeElement != null) {
    handleRemoveElement(removeElement);
  }
  RemoveReferenceValue refValue=removeReferenceValue.doSwitch(difElement);
  if (refValue != null) {
  }
  if (difElement instanceof UpdateAttribute) {
    handleUpdateElement((UpdateAttribute)difElement);
    return;
  }
}
Program: 139486
Project: 139486
Buggy source:
@Override protected void handleRemoveElement(RemoveModelElement removeElement){
  TdColumn removeColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(removeElement.getLeftElement());
  if (removeColumn == null) {
    return;
  }
  popRemoveElementConfirm();
  ColumnSetHelper.removeColumn(removeColumn,(ColumnSet)selectedObj);
}

Fixed version (ground truth):
@Override protected void handleRemoveElement(RemoveModelElement removeElement){
  TdColumn removeColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(removeElement.getLeftElement());
  if (removeColumn == null) {
    return;
  }
  popRemoveElementConfirm();
  ColumnSet columnSet=(ColumnSet)selectedObj;
  ColumnSetHelper.removeColumn(removeColumn,columnSet);
  if (ColumnHelper.isPrimaryKey(removeColumn)) {
    removeColumn.getUniqueKey().clear();
  }
}
Program: 139487
Project: 139487
Buggy source:
public void hookLeftPanelContextMenu(){
  contentMergeViewer.hookContextMenu();
}

Fixed version (ground truth):
public void hookLeftPanelContextMenu(boolean compareEachOther){
  contentMergeViewer.hookContextMenu(compareEachOther);
}
Program: 139488
Project: 139488
Buggy source:
@Override protected void createToolItems(ToolBarManager tbm){
  final Action nextDiff=new AbstractCompareAction(ResourceBundle.getBundle(BUNDLE_NAME),"String_Node_Str"){
    @Override public void run(){
      navigate(true);
    }
  }
;
  final ActionContributionItem nextDiffContribution=new ActionContributionItem(nextDiff);
  nextDiffContribution.setVisible(true);
  tbm.appendToGroup("String_Node_Str",nextDiffContribution);
  final Action previousDiff=new AbstractCompareAction(ResourceBundle.getBundle(BUNDLE_NAME),"String_Node_Str"){
    @Override public void run(){
      navigate(false);
    }
  }
;
  final ActionContributionItem previousDiffContribution=new ActionContributionItem(previousDiff);
  previousDiffContribution.setVisible(true);
  tbm.appendToGroup("String_Node_Str",previousDiffContribution);
  IContributionItem[] icItems=tbm.getItems();
  for (  IContributionItem conbItem : icItems) {
    if (conbItem instanceof ActionContributionItem) {
      IAction action=((ActionContributionItem)conbItem).getAction();
      if (action != null && action instanceof ChangePropertyAction) {
        tbm.remove(conbItem);
        conbItem.dispose();
        continue;
      }
      String actionId=action.getActionDefinitionId();
      if (action != null) {
        if (COPY_LEFT_TO_RIGHT_ID.equals(actionId) || COPY_RIGHT_TO_LEFT_ID.equals(actionId)) {
          tbm.remove(conbItem);
          conbItem.dispose();
        }
      }
    }
  }
  tbm.update(true);
}

Fixed version (ground truth):
@Override protected void createToolItems(ToolBarManager tbm){
  final Action nextDiff=new AbstractCompareAction(ResourceBundle.getBundle(BUNDLE_NAME),"String_Node_Str"){
    @Override public void run(){
      navigate(true);
    }
  }
;
  final ActionContributionItem nextDiffContribution=new ActionContributionItem(nextDiff);
  nextDiffContribution.setVisible(true);
  tbm.appendToGroup("String_Node_Str",nextDiffContribution);
  final Action previousDiff=new AbstractCompareAction(ResourceBundle.getBundle(BUNDLE_NAME),"String_Node_Str"){
    @Override public void run(){
      navigate(false);
    }
  }
;
  final ActionContributionItem previousDiffContribution=new ActionContributionItem(previousDiff);
  previousDiffContribution.setVisible(true);
  tbm.appendToGroup("String_Node_Str",previousDiffContribution);
  IContributionItem[] icItems=tbm.getItems();
  for (  IContributionItem conbItem : icItems) {
    if (conbItem instanceof ActionContributionItem) {
      IAction action=((ActionContributionItem)conbItem).getAction();
      if (action != null) {
        String actionId=action.getActionDefinitionId();
        if (action instanceof ChangePropertyAction) {
          tbm.remove(conbItem);
          conbItem.dispose();
        }
        if (COPY_LEFT_TO_RIGHT_ID.equals(actionId)) {
          tbm.remove(conbItem);
          conbItem.dispose();
        }
      }
    }
  }
  tbm.update(true);
}
Program: 139490
Project: 139490
Buggy source:
/** 
 * DOC xqliu CompareModelStructureMergeViewer constructor comment.
 * @param parent
 * @param compareConfiguration
 */
public CompareModelStructureMergeViewer(Composite parent,CompareConfiguration compareConfiguration){
  super(parent,compareConfiguration);
}

Fixed version (ground truth):
/** 
 * DOC xqliu CompareModelStructureMergeViewer constructor comment.
 * @param parent
 * @param compareConfiguration
 */
public CompareModelStructureMergeViewer(Composite parent,CompareConfiguration compareConfiguration){
  super(parent,compareConfiguration);
  final ToolBarManager tbm=CompareViewerPane.getToolBarManager(getControl().getParent());
  IContributionItem[] items=tbm.getItems();
  for (  IContributionItem item : items) {
    if (item instanceof ActionContributionItem) {
      IAction action=((ActionContributionItem)item).getAction();
      if (action instanceof ExportMenu) {
        tbm.remove(item);
        item.dispose();
      }
    }
  }
  tbm.update(true);
}
Program: 139492
Project: 139492
Buggy source:
protected void handleDiffPackageElement(DiffElement difElement){
  AddModelElement addElement=addModelSwitch.doSwitch(difElement);
  if (addElement != null) {
    handleAddElement(addElement);
    return;
  }
  RemoveModelElement removeElement=removeModelSwitch.doSwitch(difElement);
  if (removeElement != null) {
    handleRemoveElement(removeElement);
  }
  RemoveReferenceValue refValue=removeReferenceValue.doSwitch(difElement);
  if (refValue != null) {
  }
  if (difElement instanceof UpdateAttribute) {
    handleUpdateElement((UpdateAttribute)difElement);
    return;
  }
}

Fixed version (ground truth):
protected void handleDiffPackageElement(DiffElement difElement){
  AddModelElement addElement=addModelSwitch.doSwitch(difElement);
  if (addElement != null) {
    handleAddElement(addElement);
    return;
  }
  RemoveModelElement removeElement=removeModelSwitch.doSwitch(difElement);
  if (removeElement != null) {
    handleRemoveElement(removeElement);
  }
  if (difElement instanceof UpdateAttribute) {
    handleUpdateElement((UpdateAttribute)difElement);
    return;
  }
}
Program: 139493
Project: 139493
Buggy source:
private void initSwitchValue(){
  addModelSwitch=new DiffSwitch<AddModelElement>(){
    public AddModelElement caseAddModelElement(    AddModelElement object){
      return object;
    }
  }
;
  updateModelSwitch=new DiffSwitch<UpdateModelElement>(){
    public UpdateModelElement caseUpdateModelElement(    UpdateModelElement object){
      return object;
    }
  }
;
  removeModelSwitch=new DiffSwitch<RemoveModelElement>(){
    public RemoveModelElement caseRemoveModelElement(    RemoveModelElement object){
      return object;
    }
  }
;
  removeReferenceValue=new DiffSwitch<RemoveReferenceValue>(){
    public RemoveReferenceValue caseRemoveReferenceValue(    RemoveReferenceValue object){
      return object;
    }
  }
;
  packageSwitch=new RelationalSwitch<Package>(){
    public Package casePackage(    Package object){
      return object;
    }
  }
;
}

Fixed version (ground truth):
private void initSwitchValue(){
  addModelSwitch=new DiffSwitch<AddModelElement>(){
    public AddModelElement caseAddModelElement(    AddModelElement object){
      return object;
    }
  }
;
  updateModelSwitch=new DiffSwitch<UpdateModelElement>(){
    public UpdateModelElement caseUpdateModelElement(    UpdateModelElement object){
      return object;
    }
  }
;
  removeModelSwitch=new DiffSwitch<RemoveModelElement>(){
    public RemoveModelElement caseRemoveModelElement(    RemoveModelElement object){
      return object;
    }
  }
;
  packageSwitch=new RelationalSwitch<Package>(){
    public Package casePackage(    Package object){
      return object;
    }
  }
;
}
Program: 139495
Project: 139495
Buggy source:
@Override public boolean performFinish(){
  File file=new File(page.getSourceFile());
  final List<String> information=ImportFactory.importToStucture(file,folder,type,page.getSkip(),page.getRename());
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      ImportInfoDialog.openImportInformation(null,DefaultMessagesImpl.getString("String_Node_Str"),(String[])information.toArray(new String[0]));
    }
  }
);
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  File file=new File(page.getSourceFile());
  final List<String> information=ImportFactory.importToStucture(file,folder,type,page.getSkip(),page.getRename());
  if (0 < information.size()) {
    Display.getDefault().asyncExec(new Runnable(){
      public void run(){
        ImportInfoDialog.openImportInformation(null,DefaultMessagesImpl.getString("String_Node_Str"),(String[])information.toArray(new String[0]));
      }
    }
);
  }
  return true;
}
Program: 139496
Project: 139496
Buggy source:
/** 
 * DOC bZhou Comment method "updateVersionInDB".
 * @param url
 * @param driver
 * @param props
 * @return
 */
public static boolean updateVersionInDB(String url,String driver,Properties props){
  Connection connection=null;
  try {
    connection=ConnectionUtils.createConnection(url,driver,props);
    if (connection != null) {
      Statement stat=connection.createStatement();
      ProductVersion curVersion=WorkspaceVersionHelper.getVesion();
      return stat.execute(DefaultMessagesImpl.getString("String_Node_Str",curVersion.toString()));
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (connection != null) {
      try {
        connection.close();
      }
 catch (      SQLException e) {
        e.printStackTrace();
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "updateVersionInDB".
 * @param url
 * @param driver
 * @param props
 * @return
 */
public static boolean updateVersionInDB(String url,String driver,Properties props){
  Connection connection=null;
  try {
    connection=ConnectionUtils.createConnection(url,driver,props);
    if (connection != null) {
      Statement stat=connection.createStatement();
      ProductVersion curVersion=WorkspaceVersionHelper.getVesion();
      return stat.execute("String_Node_Str" + curVersion + "String_Node_Str");
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (connection != null) {
      try {
        connection.close();
      }
 catch (      SQLException e) {
        e.printStackTrace();
      }
    }
  }
  return false;
}
Program: 139498
Project: 139498
Buggy source:
/** 
 * Method "updateDependencies" updates dependencies between elements in TOP.
 * @param analysesSubFolder
 * @throws CoreException
 */
private void updateDependencies(IFolder analysesSubFolder) throws CoreException {
  for (  IResource resource : analysesSubFolder.members()) {
    if (resource instanceof IFolder) {
      IFolder folder=(IFolder)resource;
      updateDependencies(folder);
    }
    if (resource instanceof IFile) {
      IFile file=(IFile)resource;
      final Analysis analysis=AnaResourceFileHelper.getInstance().findAnalysis(file);
      final List<Pattern> patterns=AnalysisHelper.getPatterns(analysis);
      for (      Pattern pattern : patterns) {
        DependenciesHandler.getInstance().setDependencyOn(analysis,pattern);
        AnaResourceFileHelper.getInstance().save(analysis);
      }
      final List<IndicatorDefinition> userDefinedIndicators=AnalysisHelper.getUserDefinedIndicators(analysis);
      for (      IndicatorDefinition indicatorDefinition : userDefinedIndicators) {
        DependenciesHandler.getInstance().setDependencyOn(analysis,indicatorDefinition);
        AnaResourceFileHelper.getInstance().save(analysis);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Method "updateDependencies" updates dependencies between elements in TOP.
 * @param analysesSubFolder
 * @throws CoreException
 */
private void updateDependencies(IFolder analysesSubFolder) throws CoreException {
  for (  IResource resource : analysesSubFolder.members()) {
    if (resource instanceof IFolder) {
      IFolder folder=(IFolder)resource;
      updateDependencies(folder);
    }
    if (resource instanceof IFile) {
      IFile file=(IFile)resource;
      final Analysis analysis=AnaResourceFileHelper.getInstance().findAnalysis(file);
      if (analysis != null) {
        final List<Pattern> patterns=AnalysisHelper.getPatterns(analysis);
        for (        Pattern pattern : patterns) {
          DependenciesHandler.getInstance().setDependencyOn(analysis,pattern);
          AnaResourceFileHelper.getInstance().save(analysis);
        }
        final List<IndicatorDefinition> userDefinedIndicators=AnalysisHelper.getUserDefinedIndicators(analysis);
        for (        IndicatorDefinition indicatorDefinition : userDefinedIndicators) {
          DependenciesHandler.getInstance().setDependencyOn(analysis,indicatorDefinition);
          AnaResourceFileHelper.getInstance().save(analysis);
        }
      }
    }
  }
}
Program: 139499
Project: 139499
Buggy source:
/** 
 * Method "isPrimaryKey".
 * @param column a column
 * @return true if the given column is a primary key
 */
public static boolean isPrimaryKey(Column column){
  return column != null && getPrimaryKey(column) != null;
}

Fixed version (ground truth):
/** 
 * Method "isPrimaryKey".
 * @param column a column
 * @return true if the given column is a primary key
 */
public static boolean isPrimaryKey(Column column){
  return getPrimaryKey(column) != null;
}
Program: 139500
Project: 139500
Buggy source:
/** 
 * DOC mzhao Comment method "isForeignKey",Feature 8690.
 * @param column
 * @return
 */
public static boolean isForeignKey(Column column){
  return column != null && getForeignKey(column) != null;
}

Fixed version (ground truth):
/** 
 * DOC mzhao Comment method "isForeignKey",Feature 8690.
 * @param column
 * @return
 */
public static boolean isForeignKey(Column column){
  return getForeignKey(column) != null;
}
Program: 139503
Project: 139503
Buggy source:
public boolean execute(){
  Collection<Analysis> allAnalysis=AnaResourceFileHelper.getInstance().getAllAnalysis();
  Collection<WhereRule> allDQRules=DQRuleResourceFileHelper.getInstance().getAllDQRules();
  Collection<Pattern> allPatternes=PatternResourceFileHelper.getInstance().getAllPatternes();
  List<TdDataProvider> allDataProviders=PrvResourceFileHelper.getInstance().getAllDataProviders();
  Collection<TdReport> allReports=RepResourceFileHelper.getInstance().getAllReports();
  Collection<IndicatorDefinition> allUDIs=UDIResourceFileHelper.getInstance().getAllUDIs();
  List<ModelElement> allElement=new ArrayList<ModelElement>();
  allElement.addAll(allAnalysis);
  allElement.addAll(allDQRules);
  allElement.addAll(allDataProviders);
  allElement.addAll(allReports);
  allElement.addAll(allUDIs);
  saveProperties(allElement);
  return true;
}

Fixed version (ground truth):
public boolean execute(){
  Collection<Analysis> allAnalysis=AnaResourceFileHelper.getInstance().getAllAnalysis();
  Collection<WhereRule> allDQRules=DQRuleResourceFileHelper.getInstance().getAllDQRules();
  Collection<Pattern> allPatternes=PatternResourceFileHelper.getInstance().getAllPatternes();
  List<TdDataProvider> allDataProviders=PrvResourceFileHelper.getInstance().getAllDataProviders();
  Collection<TdReport> allReports=RepResourceFileHelper.getInstance().getAllReports();
  Collection<IndicatorDefinition> allUDIs=UDIResourceFileHelper.getInstance().getAllUDIs();
  List<ModelElement> allElement=new ArrayList<ModelElement>();
  allElement.addAll(allAnalysis);
  allElement.addAll(allDQRules);
  allElement.addAll(allPatternes);
  allElement.addAll(allDataProviders);
  allElement.addAll(allReports);
  allElement.addAll(allUDIs);
  saveProperties(allElement);
  return true;
}
Program: 139504
Project: 139504
Buggy source:
private void searchAllAnalysis(IFolder folder) throws CoreException {
  for (  IResource resource : folder.members()) {
    if (resource.getType() == IResource.FOLDER) {
      searchAllAnalysis(folder.getFolder(resource.getName()));
      continue;
    }
    IFile file=(IFile)resource;
    if (FactoriesUtil.ANA.equals(file.getFileExtension())) {
      findAnalysis(file);
    }
  }
}

Fixed version (ground truth):
private void searchAllAnalysis(IFolder folder) throws CoreException {
  for (  IResource resource : folder.members()) {
    if (resource.getType() == IResource.FOLDER) {
      searchAllAnalysis(folder.getFolder(resource.getName()));
      continue;
    }
    IFile file=(IFile)resource;
    if (checkFile(file)) {
      findAnalysis(file);
    }
  }
}
Program: 139505
Project: 139505
Buggy source:
/** 
 * DOC xy Comment method "findPathAnalysis".
 * @param file
 * @return
 */
public Analysis findAnalysis(IFile file){
  Analysis analysisEntity=allAnalysisMap.get(file);
  if (analysisEntity != null) {
    return analysisEntity;
  }
  return readFromFile(file);
}

Fixed version (ground truth):
/** 
 * DOC xy Comment method "findPathAnalysis".
 * @param file
 * @return
 */
public Analysis findAnalysis(IFile file){
  if (checkFile(file)) {
    Analysis analysisEntity=allAnalysisMap.get(file);
    if (analysisEntity == null) {
      analysisEntity=readFromFile(file);
    }
    return analysisEntity;
  }
  return null;
}
Program: 139506
Project: 139506
Buggy source:
private void searchAllWhereRules(IFolder folder) throws CoreException {
  for (  IResource resource : folder.members()) {
    if (resource.getType() == IResource.FOLDER) {
      searchAllWhereRules(folder.getFolder(resource.getName()));
      continue;
    }
    IFile file=(IFile)resource;
    if (FactoriesUtil.DQRULE.equals(file.getFileExtension())) {
      findWhereRule(file);
    }
  }
}

Fixed version (ground truth):
private void searchAllWhereRules(IFolder folder) throws CoreException {
  for (  IResource resource : folder.members()) {
    if (resource.getType() == IResource.FOLDER) {
      searchAllWhereRules(folder.getFolder(resource.getName()));
      continue;
    }
    IFile file=(IFile)resource;
    if (checkFile(file)) {
      findWhereRule(file);
    }
  }
}
Program: 139507
Project: 139507
Buggy source:
/** 
 * DOC xqliu Comment method "findWhereRule".
 * @param file
 * @return
 */
public WhereRule findWhereRule(IFile file){
  WhereRule whereRule=whereRulesMap.get(file);
  if (whereRule != null) {
    return whereRule;
  }
  Resource fileResource=getFileResource(file);
  whereRule=retireDQRule(fileResource);
  if (whereRule != null) {
    whereRulesMap.put(file,whereRule);
  }
  return whereRule;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "findWhereRule".
 * @param file
 * @return
 */
public WhereRule findWhereRule(IFile file){
  if (checkFile(file)) {
    WhereRule whereRule=whereRulesMap.get(file);
    if (whereRule == null) {
      whereRule=retireDQRule(getFileResource(file));
    }
    whereRulesMap.put(file,whereRule);
    return whereRule;
  }
  return null;
}
Program: 139508
Project: 139508
Buggy source:
/** 
 * DOC zqin Comment method "searchAllPatternes".
 * @param folder
 * @throws CoreException
 */
private void searchAllPatternes(IFolder folder) throws CoreException {
  for (  IResource resource : folder.members()) {
    if (resource.getType() == IResource.FOLDER) {
      searchAllPatternes(folder.getFolder(resource.getName()));
      continue;
    }
    IFile file=(IFile)resource;
    if (FactoriesUtil.PATTERN.equals(file.getFileExtension())) {
      findPattern(file);
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC zqin Comment method "searchAllPatternes".
 * @param folder
 * @throws CoreException
 */
private void searchAllPatternes(IFolder folder) throws CoreException {
  for (  IResource resource : folder.members()) {
    if (resource.getType() == IResource.FOLDER) {
      searchAllPatternes(folder.getFolder(resource.getName()));
      continue;
    }
    IFile file=(IFile)resource;
    if (checkFile(file)) {
      findPattern(file);
    }
  }
}
Program: 139509
Project: 139509
Buggy source:
/** 
 * DOC xy Comment method "findPathAnalysis".
 * @param file
 * @return
 */
public Pattern findPattern(IFile file){
  Pattern pattern=patternsMap.get(file);
  if (pattern != null) {
    return pattern;
  }
  Resource fileResource=getFileResource(file);
  pattern=retirePattern(fileResource);
  if (pattern != null) {
    patternsMap.put(file,pattern);
  }
  return pattern;
}

Fixed version (ground truth):
/** 
 * DOC xy Comment method "findPathAnalysis".
 * @param file
 * @return
 */
public Pattern findPattern(IFile file){
  if (checkFile(file)) {
    Pattern pattern=patternsMap.get(file);
    if (pattern == null) {
      pattern=retirePattern(getFileResource(file));
    }
    patternsMap.put(file,pattern);
    return pattern;
  }
  return null;
}
Program: 139510
Project: 139510
Buggy source:
private List<IFile> searchAllDataProvider(IFolder folder,List<IFile> allPRVFiles){
  try {
    for (    IResource resource : folder.members()) {
      if (resource.getType() == IResource.FOLDER) {
        searchAllDataProvider(folder.getFolder(resource.getName()),allPRVFiles);
        continue;
      }
      IFile file=(IFile)resource;
      if (FactoriesUtil.PROV.equals(file.getFileExtension())) {
        allPRVFiles.add(file);
      }
    }
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  return allPRVFiles;
}

Fixed version (ground truth):
private List<IFile> searchAllDataProvider(IFolder folder,List<IFile> allPRVFiles){
  try {
    for (    IResource resource : folder.members()) {
      if (resource.getType() == IResource.FOLDER) {
        searchAllDataProvider(folder.getFolder(resource.getName()),allPRVFiles);
        continue;
      }
      IFile file=(IFile)resource;
      if (checkFile(file)) {
        allPRVFiles.add(file);
      }
    }
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  return allPRVFiles;
}
Program: 139511
Project: 139511
Buggy source:
/** 
 * Method "readFromFile".
 * @param file the file to read
 * @return the Data provider if found.
 */
public TypedReturnCode<TdDataProvider> findProvider(IFile file){
  TypedReturnCode<TdDataProvider> rc=providerMap.get(file);
  if (rc != null) {
    return rc;
  }
  return readFromFile(file);
}

Fixed version (ground truth):
/** 
 * Method "readFromFile".
 * @param file the file to read
 * @return the Data provider if found.
 */
public TypedReturnCode<TdDataProvider> findProvider(IFile file){
  if (checkFile(file)) {
    TypedReturnCode<TdDataProvider> rc=providerMap.get(file);
    if (rc == null) {
      rc=readFromFile(file);
    }
    return rc;
  }
  return null;
}
Program: 139512
Project: 139512
Buggy source:
private void searchAllReports(IFolder folder) throws CoreException {
  for (  IResource resource : folder.members()) {
    if (resource instanceof IFolder) {
      continue;
    }
    if (resource.getType() == IResource.FOLDER) {
      searchAllReports(folder.getFolder(resource.getName()));
    }
    IFile file=(IFile)resource;
    if (FactoriesUtil.REP.equals(file.getFileExtension())) {
      findReport(file);
    }
  }
}

Fixed version (ground truth):
private void searchAllReports(IFolder folder) throws CoreException {
  for (  IResource resource : folder.members()) {
    if (resource instanceof IFolder) {
      continue;
    }
    if (resource.getType() == IResource.FOLDER) {
      searchAllReports(folder.getFolder(resource.getName()));
    }
    IFile file=(IFile)resource;
    if (checkFile(file)) {
      findReport(file);
    }
  }
}
Program: 139513
Project: 139513
Buggy source:
public TdReport findReport(IFile file){
  if (file != null && FactoriesUtil.REP.equals(file.getFileExtension())) {
    TdReport report=allRepMap.get(file);
    if (report != null) {
      return report;
    }
    return readFromFile(file);
  }
  return null;
}

Fixed version (ground truth):
public TdReport findReport(IFile file){
  if (checkFile(file)) {
    TdReport report=allRepMap.get(file);
    if (report == null) {
      report=readFromFile(file);
    }
    return report;
  }
  return null;
}
Program: 139514
Project: 139514
Buggy source:
public IndicatorDefinition findUDI(IFile file){
  IndicatorDefinition id=idsMap.get(file);
  if (id != null) {
    return id;
  }
  Resource fileResource=getFileResource(file);
  id=retireUDI(fileResource);
  if (id != null) {
    idsMap.put(file,id);
  }
  return id;
}

Fixed version (ground truth):
public IndicatorDefinition findUDI(IFile file){
  if (checkFile(file)) {
    IndicatorDefinition id=idsMap.get(file);
    if (id == null) {
      id=retireUDI(getFileResource(file));
    }
    idsMap.put(file,id);
    return id;
  }
  return null;
}
Program: 139515
Project: 139515
Buggy source:
private void searchAllUDIs(IFolder folder) throws CoreException {
  for (  IResource resource : folder.members()) {
    if (resource.getType() == IResource.FOLDER) {
      searchAllUDIs(folder.getFolder(resource.getName()));
      continue;
    }
    IFile file=(IFile)resource;
    if (FactoriesUtil.UDI.equals(file.getFileExtension())) {
      findUDI(file);
    }
  }
}

Fixed version (ground truth):
private void searchAllUDIs(IFolder folder) throws CoreException {
  for (  IResource resource : folder.members()) {
    if (resource.getType() == IResource.FOLDER) {
      searchAllUDIs(folder.getFolder(resource.getName()));
      continue;
    }
    IFile file=(IFile)resource;
    if (checkFile(file)) {
      findUDI(file);
    }
  }
}
Program: 139516
Project: 139516
Buggy source:
/** 
 * {@inheritDoc}
 * @see CompareEditorInput#createOutlineContents(Composite,int)
 */
@Override public Control createOutlineContents(Composite parent,int direction){
  final Splitter splitter=new Splitter(parent,direction);
  final CompareViewerPane pane=new CompareViewerPane(splitter,SWT.NONE);
  structureMergeViewer=new ModelStructureMergeViewer(pane,getCompareConfiguration());
  structureMergeViewer.setLabelProvider(new CompareModelStructureLabelProvider());
  pane.setContent(structureMergeViewer.getTree());
  structureMergeViewer.setInput(inputSnapshot);
  return splitter;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see CompareEditorInput#createOutlineContents(Composite,int)
 */
@Override public Control createOutlineContents(Composite parent,int direction){
  final Splitter splitter=new Splitter(parent,direction);
  final CompareViewerPane pane=new CompareViewerPane(splitter,SWT.NONE);
  structureMergeViewer=new CompareModelStructureMergeViewer(pane,getCompareConfiguration());
  structureMergeViewer.setLabelProvider(new CompareModelStructureLabelProvider());
  pane.setContent(structureMergeViewer.getTree());
  structureMergeViewer.setInput(inputSnapshot);
  return splitter;
}