nus-yam/ex-repair huggingface dataset:
Program: 140322
Project: 140322
Buggy source:
public Object[] getElements(Object inputElement){
  if (inputElement instanceof ColumnSet) {
    EObject eObj=(EObject)inputElement;
    ColumnSet columnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(eObj);
    if (columnSet != null) {
      TdColumn[] columns=EObjectHelper.getColumns(columnSet);
      if (columns.length <= 0) {
        Package parentCatalogOrSchema=ColumnSetHelper.getParentCatalogOrSchema(columnSet);
        if (parentCatalogOrSchema == null) {
          return null;
        }
        TdDataProvider provider=DataProviderHelper.getTdDataProvider(parentCatalogOrSchema);
        if (provider == null) {
          return null;
        }
        try {
          List<TdColumn> columnList=DqRepositoryViewService.getColumns(provider,columnSet,null,true);
          columns=columnList.toArray(new TdColumn[columnList.size()]);
          ColumnSetHelper.addColumns(columnSet,columnList);
        }
 catch (        TalendException e) {
          MessageBoxExceptionHandler.process(e);
        }
        EMFSharedResources.getSharedEmfUtil().saveResource(provider.eResource());
      }
      return sort(columns,ComparatorsFactory.MODELELEMENT_COMPARATOR_ID);
    }
  }
  return null;
}

Fixed version (ground truth):
public Object[] getElements(Object inputElement){
  if (inputElement instanceof ColumnSet) {
    EObject eObj=(EObject)inputElement;
    ColumnSet columnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(eObj);
    if (columnSet != null) {
      TdColumn[] columns=EObjectHelper.getColumns(columnSet);
      if (columns.length <= 0) {
        Package parentCatalogOrSchema=ColumnSetHelper.getParentCatalogOrSchema(columnSet);
        if (parentCatalogOrSchema == null) {
          return null;
        }
        TdDataProvider provider=DataProviderHelper.getTdDataProvider(parentCatalogOrSchema);
        if (provider == null) {
          return null;
        }
        try {
          List<TdColumn> columnList=DqRepositoryViewService.getColumns(provider,columnSet,null,true);
          columns=columnList.toArray(new TdColumn[columnList.size()]);
          ColumnSetHelper.addColumns(columnSet,columnList);
        }
 catch (        TalendException e) {
          MessageBoxExceptionHandler.process(e);
        }
        PrvResourceFileHelper.getInstance().save(provider);
      }
      return sort(columns,ComparatorsFactory.MODELELEMENT_COMPARATOR_ID);
    }
  }
  return null;
}
Program: 140325
Project: 140325
Buggy source:
private ZqlParser getZqlParser(){
  ZqlParser parser=new ZqlParser();
  for (  String fnct : this.dbmsFunctions.keySet()) {
    parser.addCustomFunction(fnct,this.dbmsFunctions.get(fnct));
  }
  return parser;
}

Fixed version (ground truth):
/** 
 * Method "getZqlParser".
 * @return a new parser with predefined functions.
 */
private ZqlParser getZqlParser(){
  ZqlParser parser=new ZqlParser();
  for (  String fnct : this.dbmsFunctions.keySet()) {
    parser.addCustomFunction(fnct,this.dbmsFunctions.get(fnct));
  }
  return parser;
}
Program: 140326
Project: 140326
Buggy source:
public ReloadDatabaseAction(Object selectedNode){
  super("String_Node_Str");
  this.selectedObject=selectedNode;
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.UPDATE_IMAGE));
}

Fixed version (ground truth):
public ReloadDatabaseAction(Object selectedNode,String menuText){
  super(menuText);
  this.selectedObject=selectedNode;
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.UPDATE_IMAGE));
}
Program: 140327
Project: 140327
Buggy source:
public void fillContextMenu(IMenuManager menu){
  Object obj=((TreeSelection)this.getContext().getSelection()).getFirstElement();
  menu.add(new ReloadDatabaseAction(obj));
}

Fixed version (ground truth):
public void fillContextMenu(IMenuManager menu){
  Object obj=((TreeSelection)this.getContext().getSelection()).getFirstElement();
  String menuText=RELOADDATABASE_MENUTEXT;
  if (obj instanceof IFolderNode) {
    IFolderNode folderNode=(IFolderNode)obj;
switch (folderNode.getFolderNodeType()) {
case IFolderNode.TABLEFOLDER_NODE_TYPE:
      menuText=RELOADTABLES_MENUTEXT;
    break;
case IFolderNode.VIEWFOLDER_NODE_TYPE:
  menuText=RELOADVIEWS_MENUTEXT;
break;
case IFolderNode.COLUMNFOLDER_NODE_TYPE:
menuText=RELOADCOLUMNS_MENUTEXT;
break;
default :
}
}
menu.add(new ReloadDatabaseAction(obj,menuText));
}
Program: 140328
Project: 140328
Buggy source:
public String getPerMatch(){
  Double match=Double.parseDouble(getNumMatch());
  return match * 100 / getSum() + "String_Node_Str";
}

Fixed version (ground truth):
public String getPerMatch(){
  Double match=Double.parseDouble(getNumMatch());
  return TextFormatFactory.createStandardPercent(match / getSum());
}
Program: 140329
Project: 140329
Buggy source:
public String getPerNoMatch(){
  Double nomatch=Double.parseDouble(getNumNoMatch());
  return nomatch * 100 / getSum() + "String_Node_Str";
}

Fixed version (ground truth):
public String getPerNoMatch(){
  Double nomatch=Double.parseDouble(getNumNoMatch());
  return TextFormatFactory.createStandardPercent(nomatch / getSum());
}
Program: 140330
Project: 140330
Buggy source:
public void createContent(Composite parent){
  parent.setLayout(new GridLayout(3,true));
  dataFilterText=new Text(parent,SWT.BORDER | SWT.MULTI);
  dataFilterText.setText(stringDataFilter == null ? PluginConstant.EMPTY_STRING : stringDataFilter);
  GridDataFactory.fillDefaults().span(2,3).align(SWT.FILL,SWT.FILL).grab(true,true).applyTo(dataFilterText);
  ((GridData)dataFilterText.getLayoutData()).heightHint=150;
  dataFilterText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      setDirty(true);
      propertyChangeSupport.firePropertyChange(PluginConstant.DATAFILTER_PROPERTY,null,dataFilterText.getText());
    }
  }
);
  Composite buttonsComp=new Composite(parent,SWT.None);
  GridDataFactory.fillDefaults().span(1,1).applyTo(buttonsComp);
  buttonsComp.setLayout(new GridLayout(1,true));
  buttonsComp.setVisible(false);
  Button button=new Button(buttonsComp,SWT.None);
  button.setText("String_Node_Str");
  GridDataFactory.fillDefaults().span(1,1).align(SWT.FILL,SWT.TOP).applyTo(button);
}

Fixed version (ground truth):
public void createContent(Composite parent){
  parent.setLayout(new GridLayout(3,true));
  dataFilterText=new Text(parent,SWT.BORDER | SWT.MULTI);
  dataFilterText.setToolTipText("String_Node_Str" + "String_Node_Str");
  dataFilterText.setText(stringDataFilter == null ? PluginConstant.EMPTY_STRING : stringDataFilter);
  GridDataFactory.fillDefaults().span(2,3).align(SWT.FILL,SWT.FILL).grab(true,true).applyTo(dataFilterText);
  ((GridData)dataFilterText.getLayoutData()).heightHint=150;
  dataFilterText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      setDirty(true);
      propertyChangeSupport.firePropertyChange(PluginConstant.DATAFILTER_PROPERTY,null,dataFilterText.getText());
    }
  }
);
  Composite buttonsComp=new Composite(parent,SWT.None);
  GridDataFactory.fillDefaults().span(1,1).applyTo(buttonsComp);
  buttonsComp.setLayout(new GridLayout(1,true));
  buttonsComp.setVisible(false);
  Button button=new Button(buttonsComp,SWT.None);
  button.setText("String_Node_Str");
  GridDataFactory.fillDefaults().span(1,1).align(SWT.FILL,SWT.TOP).applyTo(button);
}
Program: 140331
Project: 140331
Buggy source:
/** 
 * Method "getRealValue" converts object into double.
 * @param javaType
 * @param object
 * @return
 */
private Double getRealValue(int javaType,String object){
  if (Java2SqlType.isDateInSQL(javaType)) {
    Date date=null;
switch (javaType) {
case Types.TIMESTAMP:
      date=java.sql.Timestamp.valueOf(object);
    break;
case Types.DATE:
  date=java.sql.Date.valueOf(object);
break;
case Types.TIME:
date=java.sql.Time.valueOf(object);
break;
default :
break;
}
return date != null ? Double.valueOf(date.getTime()) : Double.NaN;
}
return Double.valueOf(object);
}

Fixed version (ground truth):
@Override public Double getRealValue(){
  return median;
}
Program: 140332
Project: 140332
Buggy source:
@Override protected void addFieldsListeners(){
  nullBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      parameter.setUseNull(nullBtn.getSelection());
    }
  }
);
  blankBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      parameter.setUseBlank(blankBtn.getSelection());
    }
  }
);
}

Fixed version (ground truth):
@Override protected void addFieldsListeners(){
  nullBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      updateStatus(IStatus.OK,MSG_OK);
      parameter.setUseNull(nullBtn.getSelection());
    }
  }
);
  blankBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      updateStatus(IStatus.OK,MSG_OK);
      parameter.setUseBlank(blankBtn.getSelection());
    }
  }
);
}
Program: 140333
Project: 140333
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  parameter.setUseBlank(blankBtn.getSelection());
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  updateStatus(IStatus.OK,MSG_OK);
  parameter.setUseBlank(blankBtn.getSelection());
}
Program: 140335
Project: 140335
Buggy source:
/** 
 * DOC scorreia Comment method "getDateAggregatedCompletedString".
 * @param indicator
 * @param sqlExpression
 * @param colName
 * @param table
 * @param dataFilterExpression
 * @param dateAggregationType
 * @return
 */
private String getDateAggregatedCompletedString(Expression sqlExpression,String colName,String table,DateGrain dateAggregationType){
  int nbExtractedColumns=0;
  String result="String_Node_Str";
  String aliases="String_Node_Str";
  String alias;
switch (dateAggregationType) {
case DAY:
    alias=getAlias(colName,DateGrain.DAY);
  result=dbms().extractDay(colName) + alias + comma(result);
aliases=alias + comma(aliases);
nbExtractedColumns++;
case WEEK:
alias=getAlias(colName,DateGrain.WEEK);
result=dbms().extractWeek(colName) + alias + comma(result);
aliases=alias + comma(aliases);
nbExtractedColumns++;
case MONTH:
alias=getAlias(colName,DateGrain.MONTH);
result=dbms().extractMonth(colName) + alias + comma(result);
aliases=alias + comma(aliases);
nbExtractedColumns++;
case QUARTER:
alias=getAlias(colName,DateGrain.QUARTER);
result=dbms().extractQuarter(colName) + alias + comma(result);
aliases=alias + comma(aliases);
nbExtractedColumns++;
case YEAR:
alias=getAlias(colName,DateGrain.YEAR);
result=dbms().extractYear(colName) + alias + comma(result);
aliases=alias + comma(aliases);
nbExtractedColumns++;
break;
case NONE:
result=colName;
nbExtractedColumns++;
break;
default :
break;
}
String sql=replaceVariablesLow(sqlExpression.getBody(),result,table,aliases);
return sql;
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getDateAggregatedCompletedString".
 * @param indicator
 * @param sqlExpression
 * @param colName
 * @param table
 * @param dataFilterExpression
 * @param dateAggregationType
 * @return
 */
@SuppressWarnings("String_Node_Str") private String getDateAggregatedCompletedString(Expression sqlExpression,String colName,String table,DateGrain dateAggregationType){
  int nbExtractedColumns=0;
  String result="String_Node_Str";
  String aliases="String_Node_Str";
  String alias;
switch (dateAggregationType) {
case DAY:
    alias=getAlias(colName,DateGrain.DAY);
  result=dbms().extractDay(colName) + alias + comma(result);
aliases=alias + comma(aliases);
nbExtractedColumns++;
case WEEK:
alias=getAlias(colName,DateGrain.WEEK);
result=dbms().extractWeek(colName) + alias + comma(result);
aliases=alias + comma(aliases);
nbExtractedColumns++;
case MONTH:
alias=getAlias(colName,DateGrain.MONTH);
result=dbms().extractMonth(colName) + alias + comma(result);
aliases=alias + comma(aliases);
nbExtractedColumns++;
case QUARTER:
alias=getAlias(colName,DateGrain.QUARTER);
result=dbms().extractQuarter(colName) + alias + comma(result);
aliases=alias + comma(aliases);
nbExtractedColumns++;
case YEAR:
alias=getAlias(colName,DateGrain.YEAR);
result=dbms().extractYear(colName) + alias + comma(result);
aliases=alias + comma(aliases);
nbExtractedColumns++;
break;
case NONE:
result=colName;
nbExtractedColumns++;
break;
default :
break;
}
String sql=replaceVariablesLow(sqlExpression.getBody(),result,table,aliases);
return sql;
}
Program: 140336
Project: 140336
Buggy source:
/** 
 * DOC scorreia Comment method "getCompletedSingleSelect".
 * @param indicator
 * @param sqlExpression
 * @param colName
 * @param table
 * @param whereExpression
 * @param range
 * @return
 * @throws ParseException
 */
private String getCompletedSingleSelect(Indicator indicator,String sqlGenericExpression,String colName,String table,List<String> whereExpression,String range) throws ParseException {
  String completedRange=replaceVariables(range,colName,table);
  String rangeColumn="String_Node_Str" + completedRange + "String_Node_Str";
  String completedSqlString=replaceVariablesLow(sqlGenericExpression,rangeColumn,table,rangeColumn);
  List<String> allWheresForSingleSelect=new ArrayList<String>(whereExpression);
  allWheresForSingleSelect.add(completedRange);
  return addWhereToSqlStringStatement(allWheresForSingleSelect,completedSqlString);
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getCompletedSingleSelect".
 * @param indicator
 * @param sqlExpression
 * @param colName
 * @param table
 * @param whereExpression
 * @param range
 * @return
 * @throws ParseException
 */
private String getCompletedSingleSelect(Indicator indicator,String sqlGenericExpression,String colName,String table,List<String> whereExpression,String range) throws ParseException {
  String completedRange=replaceVariables(range,colName,table);
  String rangeColumn="String_Node_Str" + completedRange + "String_Node_Str";
  String completedSqlString=replaceVariablesLow(sqlGenericExpression,rangeColumn,table,rangeColumn);
  List<String> allWheresForSingleSelect=new ArrayList<String>(whereExpression);
  completedSqlString=addWhereToSqlStringStatement(allWheresForSingleSelect,completedSqlString);
  completedSqlString=replaceCountByZeroCount(completedSqlString,completedRange);
  return completedSqlString;
}
Program: 140337
Project: 140337
Buggy source:
@Override public void run(){
  if (page == null) {
    AnalysisEditor editor=(AnalysisEditor)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (editor != null) {
      page=(ColumnMasterDetailsPage)editor.getMasterPage();
    }
  }
  if (page.isDirty()) {
    try {
      page.saveAnalysis();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  page.refreshChart(page.getManagedForm().getForm());
}

Fixed version (ground truth):
@Override public void run(){
  if (page == null) {
    AnalysisEditor editor=(AnalysisEditor)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (editor != null) {
      page=(ColumnMasterDetailsPage)editor.getMasterPage();
    }
  }
  if (page.isDirty()) {
    try {
      page.saveAnalysis();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  page.refreshChart();
}
Program: 140339
Project: 140339
Buggy source:
@Override protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  if (isRefreshResultPage && columnResultPage != null && newPageIndex == columnResultPage.getIndex()) {
    ((ColumnAnalysisResultPage)columnResultPage).refresh((ColumnMasterDetailsPage)getMasterPage());
    isRefreshResultPage=false;
  }
}

Fixed version (ground truth):
@Override protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  if (getMasterPage().isDirty()) {
    getMasterPage().doSave(null);
  }
  if (isRefreshResultPage && columnResultPage != null && newPageIndex == columnResultPage.getIndex()) {
    ((ColumnAnalysisResultPage)columnResultPage).refresh((ColumnMasterDetailsPage)getMasterPage());
    isRefreshResultPage=false;
  }
}
Program: 140340
Project: 140340
Buggy source:
/** 
 * DOC zqin Comment method "refreshChart".
 * @param form
 */
public void refreshChart(ScrolledForm form){
  if (chartComposite != null) {
    try {
      for (      Control control : chartComposite.getChildren()) {
        control.dispose();
      }
      createPreviewCharts(form,chartComposite,true);
      chartComposite.layout();
      form.reflow(true);
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC zqin Comment method "refreshChart".
 * @param form
 */
public void refreshChart(){
  if (chartComposite != null) {
    try {
      for (      Control control : chartComposite.getChildren()) {
        control.dispose();
      }
      createPreviewCharts(form,chartComposite,true);
      chartComposite.layout();
      getForm().reflow(true);
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
}
Program: 140341
Project: 140341
Buggy source:
/** 
 * Method "setReportType".
 * @param report the report object to update
 * @param reportType the report type to set
 * @param jrxmlFullPath the full path to the jxrxml file (can be null when the type of report is different from theUSER_DEFINED)
 * @return true if everything is set correctly, false otherwise.
 */
public static boolean setReportType(TdReport report,ReportType reportType,String jrxmlFullPath){
  boolean ok=true;
switch (reportType) {
case MAIN:
case EVOLUTION:
    report.setInputJrxml(reportType.getJrxmlFilename());
  report.setReportType(reportType.getLabel());
break;
case USER_MADE:
report.setReportType(reportType.getLabel());
report.setInputJrxml(jrxmlFullPath);
if (StringUtils.isBlank(jrxmlFullPath)) {
log.error("String_Node_Str" + jrxmlFullPath);
ok=false;
}
break;
default :
ok=false;
break;
}
return ok;
}

Fixed version (ground truth):
/** 
 * Method "setReportType".
 * @param report the report object to update
 * @param reportType the report type to set
 * @param jrxmlFullPath the full path to the jxrxml file (can be null when the type of report is different from theUSER_DEFINED)
 * @return true if everything is set correctly, false otherwise.
 */
public static boolean setReportType(TdReport report,ReportType reportType,String jrxmlFullPath){
  boolean ok=true;
switch (reportType) {
case MAIN:
case EVOLUTION:
    report.setInputJrxml(reportType.getJrxmlFilename());
  report.setReportType(reportType.getLabel());
break;
case USER_MADE:
report.setReportType(reportType.getLabel());
report.setInputJrxml(jrxmlFullPath);
if (StringUtils.isBlank(jrxmlFullPath)) {
ok=false;
}
break;
default :
ok=false;
break;
}
return ok;
}
Program: 140342
Project: 140342
Buggy source:
@Override public boolean storeSqlResults(List<Object[]> objects){
  int nbColumns=2;
  if (hasDateGrainParameter()) {
    DateGrain dategrain=getParameters().getDateParameters().getDateAggregationType();
switch (dategrain) {
case DAY:
      nbColumns++;
case WEEK:
    nbColumns++;
case MONTH:
  nbColumns++;
case QUARTER:
nbColumns++;
case YEAR:
break;
default :
break;
}
}
if (objects.isEmpty()) {
log.error("String_Node_Str");
return false;
}
if (!checkResults(objects,nbColumns)) {
return false;
}
HashMap<Object,Long> mapVal2Freq=new HashMap<Object,Long>();
boolean debug=log.isDebugEnabled();
StringBuffer matrix=debug ? new StringBuffer() : null;
for (Object[] value2freq : objects) {
if (value2freq.length != nbColumns) {
log.error("String_Node_Str");
return false;
}
Object value=getValueFields(value2freq);
Long freq=Long.valueOf(String.valueOf(value2freq[nbColumns - 1]));
mapVal2Freq.put(value,freq);
if (debug) {
matrix.append("String_Node_Str").append("String_Node_Str").append(value).append("String_Node_Str").append("String_Node_Str").append(freq);
}
}
if (debug) {
log.debug(matrix);
}
this.setValueToFreq(mapVal2Freq);
return true;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public boolean storeSqlResults(List<Object[]> objects){
  int nbColumns=2;
  if (hasDateGrainParameter()) {
    DateGrain dategrain=getParameters().getDateParameters().getDateAggregationType();
switch (dategrain) {
case DAY:
      nbColumns++;
case WEEK:
    nbColumns++;
case MONTH:
  nbColumns++;
case QUARTER:
nbColumns++;
case YEAR:
break;
default :
break;
}
}
if (objects.isEmpty()) {
if (log.isInfoEnabled()) {
log.info("String_Node_Str" + "String_Node_Str");
}
this.setValueToFreq(new HashMap<Object,Long>());
return true;
}
if (!checkResults(objects,nbColumns)) {
return false;
}
HashMap<Object,Long> mapVal2Freq=new HashMap<Object,Long>();
boolean debug=log.isDebugEnabled();
StringBuffer matrix=debug ? new StringBuffer() : null;
for (Object[] value2freq : objects) {
if (value2freq.length != nbColumns) {
log.error("String_Node_Str");
return false;
}
Object value=getValueFields(value2freq);
Long freq=Long.valueOf(String.valueOf(value2freq[nbColumns - 1]));
mapVal2Freq.put(value,freq);
if (debug) {
matrix.append("String_Node_Str").append("String_Node_Str").append(value).append("String_Node_Str").append("String_Node_Str").append(freq);
}
}
if (debug) {
log.debug(matrix);
}
this.setValueToFreq(mapVal2Freq);
return true;
}
Program: 140346
Project: 140346
Buggy source:
public String toQualifiedName(String catalog,String schema,String table){
  if (is(MSSQL)) {
    schema="String_Node_Str";
  }
  StringBuffer qualName=new StringBuffer();
  if (catalog != null && catalog.length() > 0) {
    qualName.append(catalog);
    qualName.append(DOT);
  }
  if (schema != null && schema.length() > 0) {
    qualName.append(schema);
    qualName.append(DOT);
  }
  qualName.append(table);
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str",catalog,schema,table,qualName));
  }
  return qualName.toString();
}

Fixed version (ground truth):
public String toQualifiedName(String catalog,String schema,String table){
  if (is(MSSQL)) {
    schema="String_Node_Str";
  }
  if (is(SYBASE_ASE)) {
    schema="String_Node_Str";
  }
  StringBuffer qualName=new StringBuffer();
  if (catalog != null && catalog.length() > 0) {
    qualName.append(catalog);
    qualName.append(DOT);
  }
  if (schema != null && schema.length() > 0) {
    qualName.append(schema);
    qualName.append(DOT);
  }
  qualName.append(table);
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str",catalog,schema,table,qualName));
  }
  return qualName.toString();
}
Program: 140347
Project: 140347
Buggy source:
/** 
 * Method "initDbmsFunctions" initialize functions specific to DBMS. This is needed for ZQLParser which does not know all available functions.
 * @param dbms
 * @return the initialized map of functions with their number of parameters.
 */
private Map<String,Integer> initDbmsFunctions(String dbms){
  Map<String,Integer> functions=new HashMap<String,Integer>();
  functions.put("String_Node_Str",1);
  functions.put("String_Node_Str",1);
  functions.put("String_Node_Str",1);
  functions.put("String_Node_Str",1);
  functions.put("String_Node_Str",1);
  if (is(SQL)) {
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",1);
  }
  if (is(MYSQL)) {
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",2);
    for (    DateGrain grain : DateGrain.values()) {
      functions.put(grain.getName(),1);
    }
  }
  if (is(ORACLE)) {
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",2);
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",2);
  }
  if (is(POSTGRESQL)) {
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",1);
  }
  if (is(MSSQL)) {
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",1);
  }
  if (is(DB2)) {
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",1);
  }
  if (is(SYBASE)) {
  }
  return functions;
}

Fixed version (ground truth):
/** 
 * Method "initDbmsFunctions" initialize functions specific to DBMS. This is needed for ZQLParser which does not know all available functions.
 * @param dbms
 * @return the initialized map of functions with their number of parameters.
 */
private Map<String,Integer> initDbmsFunctions(String dbms){
  Map<String,Integer> functions=new HashMap<String,Integer>();
  functions.put("String_Node_Str",1);
  functions.put("String_Node_Str",1);
  functions.put("String_Node_Str",1);
  functions.put("String_Node_Str",1);
  functions.put("String_Node_Str",1);
  if (is(SQL)) {
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",1);
  }
  if (is(MYSQL)) {
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",2);
    for (    DateGrain grain : DateGrain.values()) {
      functions.put(grain.getName(),1);
    }
  }
  if (is(ORACLE)) {
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",2);
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",2);
  }
  if (is(POSTGRESQL)) {
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",1);
  }
  if (is(MSSQL)) {
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",1);
  }
  if (is(DB2)) {
    functions.put("String_Node_Str",1);
    functions.put("String_Node_Str",1);
  }
  if (is(SYBASE_ASE)) {
  }
  return functions;
}
Program: 140348
Project: 140348
Buggy source:
/** 
 * DOC scorreia Comment method "getPatterns".
 * @param indicator
 * @return the patterns or null if none has been found
 */
private List<String> getPatterns(Indicator indicator){
  List<String> patternStrings=new ArrayList<String>();
  Domain dataValidDomain=indicator.getParameters().getDataValidDomain();
  if (dataValidDomain == null) {
    return patternStrings;
  }
  EList<Pattern> patterns=dataValidDomain.getPatterns();
  for (  Pattern pattern : patterns) {
    EList<PatternComponent> components=pattern.getComponents();
    for (    PatternComponent patternComponent : components) {
      Expression expression=dbms().getExpression(patternComponent);
      if (expression != null) {
        String body=expression.getBody();
        patternStrings.add(body);
      }
    }
  }
  return patternStrings;
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getPatterns".
 * @param indicator
 * @return the patterns or null if none has been found
 */
private List<String> getPatterns(Indicator indicator){
  List<String> patternStrings=new ArrayList<String>();
  Domain dataValidDomain=indicator.getParameters().getDataValidDomain();
  if (dataValidDomain == null) {
    return patternStrings;
  }
  EList<Pattern> patterns=dataValidDomain.getPatterns();
  for (  Pattern pattern : patterns) {
    String regexp=this.dbmsLanguage.getRegexp(pattern);
    if (regexp != null) {
      patternStrings.add(regexp);
    }
  }
  return patternStrings;
}
Program: 140349
Project: 140349
Buggy source:
protected String getRowsStatement(String regexpCmp){
  String lang=dbmsLanguage.getDbmsName();
  Expression instantiatedExpression=this.indicator.getInstantiatedExpressions(lang);
  String instantiatedSQL=instantiatedExpression.getBody();
  if (instantiatedSQL == null) {
    log.error("String_Node_Str" + indicator.getName() + "String_Node_Str"+ analysis.getName());
    return null;
  }
  int b=instantiatedSQL.indexOf(this.dbmsLanguage.from());
  String fromClause=instantiatedSQL.substring(b);
  String where=fromClause.contains(dbmsLanguage.where()) ? dbmsLanguage.and() : dbmsLanguage.where();
  return SELECT + fromClause + where+ regexpCmp;
}

Fixed version (ground truth):
/** 
 * Method "getRowsStatement".
 * @param whereClause the WHERE clause of the statement
 * @return the full SELECT statement with the WHERE clause
 */
protected String getRowsStatement(String whereClause){
  String lang=dbmsLanguage.getDbmsName();
  Expression instantiatedExpression=this.indicator.getInstantiatedExpressions(lang);
  String instantiatedSQL=instantiatedExpression.getBody();
  if (instantiatedSQL == null) {
    log.error("String_Node_Str" + indicator.getName() + "String_Node_Str"+ analysis.getName());
    return null;
  }
  int b=instantiatedSQL.indexOf(this.dbmsLanguage.from());
  String fromClause=instantiatedSQL.substring(b);
  String where=fromClause.contains(dbmsLanguage.where()) ? dbmsLanguage.and() : dbmsLanguage.where();
  return SELECT + fromClause + where+ whereClause;
}
Program: 140350
Project: 140350
Buggy source:
public String getValidRowsStatement() throws TalendException {
  if (this.indicator == null || !(this.indicator instanceof PatternMatchingIndicator)) {
    throw new TalendException("String_Node_Str" + analysis.getName());
  }
  String regexPatternString=IndicatorHelper.getRegexPatternString((PatternMatchingIndicator)this.indicator);
  String regexCmp=dbmsLanguage.regexLike(indicator.getAnalyzedElement().getName(),regexPatternString);
  return getRowsStatement(regexCmp);
}

Fixed version (ground truth):
public String getValidRowsStatement() throws TalendException {
  if (this.indicator == null || !(this.indicator instanceof PatternMatchingIndicator)) {
    throw new TalendException("String_Node_Str" + analysis.getName());
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString((PatternMatchingIndicator)this.indicator);
  String regexCmp=dbmsLanguage.regexLike(indicator.getAnalyzedElement().getName(),regexPatternString);
  return getRowsStatement(regexCmp);
}
Program: 140351
Project: 140351
Buggy source:
public String getInvalidRowsStatement(){
  String regexPatternString=IndicatorHelper.getRegexPatternString((PatternMatchingIndicator)this.indicator);
  String regexCmp=dbmsLanguage.regexNotLike(indicator.getAnalyzedElement().getName(),regexPatternString);
  return getRowsStatement(regexCmp);
}

Fixed version (ground truth):
public String getInvalidRowsStatement(){
  String regexPatternString=dbmsLanguage.getRegexPatternString((PatternMatchingIndicator)this.indicator);
  String columnName=indicator.getAnalyzedElement().getName();
  String regexCmp=dbmsLanguage.regexNotLike(columnName,regexPatternString);
  String nullClause=dbmsLanguage.or() + columnName + dbmsLanguage.isNull();
  return getRowsStatement(regexCmp + nullClause);
}
Program: 140353
Project: 140353
Buggy source:
@Override protected void addFields(){
  this.setLayout(new GridLayout());
  Group group=new Group(this,SWT.NONE);
  group.setLayout(new GridLayout(DateGrain.VALUES.size() / 2,true));
  group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  group.setText("String_Node_Str");
  for (  DateGrain oneDate : DateGrain.VALUES) {
    btn=new Button(group,SWT.RADIO);
    btn.setText(oneDate.getLiteral());
    btn.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        parameter.setDataUnit(btn.getText());
      }
    }
);
    allBtns.add(btn);
  }
}

Fixed version (ground truth):
@Override protected void addFields(){
  this.setLayout(new GridLayout());
  Group group=new Group(this,SWT.NONE);
  group.setLayout(new GridLayout(DateGrain.VALUES.size() / 2,true));
  group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  group.setText("String_Node_Str");
  for (  DateGrain oneDate : DateGrain.VALUES) {
    btn=new Button(group,SWT.RADIO);
    btn.setText(oneDate.getLiteral());
    btn.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        parameter.setDataUnit(btn.getText());
        updateStatus(IStatus.OK,MSG_OK);
      }
    }
);
    allBtns.add(btn);
  }
}
Program: 140354
Project: 140354
Buggy source:
@Override protected TdDataProvider findDataProvider(){
  return DataProviderHelper.getTdDataProvider((Package)selectedObj);
}

Fixed version (ground truth):
@Override protected TdDataProvider findDataProvider(){
  TdDataProvider provider=DataProviderHelper.getTdDataProvider((Package)selectedObj);
  IFile file=PrvResourceFileHelper.getInstance().findCorrespondingFile(provider);
  TdDataProvider synchronizedProvider=PrvResourceFileHelper.getInstance().readFromFile(file).getObject();
  List<TdCatalog> tdCatalogs=DataProviderHelper.getTdCatalogs(synchronizedProvider);
  for (  TdCatalog catalog : tdCatalogs) {
    if (((Package)selectedObj).getName().equals(catalog.getName())) {
      selectedObj=catalog;
    }
  }
  return synchronizedProvider;
}
Program: 140355
Project: 140355
Buggy source:
@Override protected TdDataProvider findDataProvider(){
  TypedReturnCode<TdDataProvider> returnVlaue=PrvResourceFileHelper.getInstance().getTdProvider((IFile)selectedObj);
  return returnVlaue.getObject();
}

Fixed version (ground truth):
@Override protected TdDataProvider findDataProvider(){
  TypedReturnCode<TdDataProvider> returnVlaue=PrvResourceFileHelper.getInstance().readFromFile((IFile)selectedObj);
  return returnVlaue.getObject();
}
Program: 140356
Project: 140356
Buggy source:
@Override protected TdDataProvider findDataProvider(){
  Package parentCatalogOrSchema=ColumnSetHelper.getParentCatalogOrSchema((ColumnSet)selectedObj);
  return DataProviderHelper.getTdDataProvider(parentCatalogOrSchema);
}

Fixed version (ground truth):
@Override protected TdDataProvider findDataProvider(){
  ColumnSet columnSet=(ColumnSet)selectedObj;
  Package parentCatalogOrSchema=ColumnSetHelper.getParentCatalogOrSchema(columnSet);
  TdDataProvider provider=DataProviderHelper.getTdDataProvider(parentCatalogOrSchema);
  IFile file=PrvResourceFileHelper.getInstance().findCorrespondingFile(provider);
  TdDataProvider synchronizedProvider=PrvResourceFileHelper.getInstance().readFromFile(file).getObject();
  List<TdCatalog> tdCatalogs=DataProviderHelper.getTdCatalogs(synchronizedProvider);
  TdCatalog newCatalog=null;
  for (  TdCatalog catalog : tdCatalogs) {
    if (parentCatalogOrSchema.getName().equals(catalog.getName())) {
      newCatalog=catalog;
    }
  }
  List<TdTable> tables=CatalogHelper.getTables(newCatalog);
  for (  TdTable table : tables) {
    if (columnSet.getName().equals(table.getName())) {
      selectedObj=table;
    }
  }
  List<TdView> views=CatalogHelper.getViews(newCatalog);
  for (  TdView view : views) {
    if (columnSet.getName().equals(view.getName())) {
      selectedObj=view;
    }
  }
  return synchronizedProvider;
}
Program: 140357
Project: 140357
Buggy source:
public void deleteResource(){
  final IResource[] resources=getSelectedResourcesArray();
  if (!checkDeleteContent(resources)) {
    return;
  }
  EObjectHelper.removeDependencys(resources);
  CorePlugin.getDefault().refreshWorkSpace();
  DQRespositoryView findView=(DQRespositoryView)CorePlugin.getDefault().findView(DQRespositoryView.ID);
  findView.getCommonViewer().refresh();
  Job deletionCheckJob=new Job("String_Node_Str"){
    protected IStatus run(    IProgressMonitor monitor){
      if (resources.length == 0) {
        return Status.CANCEL_STATUS;
      }
      scheduleDeleteJob(resources);
      return Status.OK_STATUS;
    }
    public boolean belongsTo(    Object family){
      if ("String_Node_Str".equals(family)) {
        return true;
      }
      return super.belongsTo(family);
    }
  }
;
  deletionCheckJob.schedule();
}

Fixed version (ground truth):
public void deleteResource(){
  final IResource[] resources=getSelectedResourcesArray();
  List<IContainer> parentList=new ArrayList<IContainer>();
  for (  IResource resource : resources) {
    parentList.add(resource.getParent());
  }
  if (!checkDeleteContent(resources)) {
    return;
  }
  EObjectHelper.removeDependencys(resources);
  Job deletionCheckJob=new Job("String_Node_Str"){
    protected IStatus run(    IProgressMonitor monitor){
      if (resources.length == 0) {
        return Status.CANCEL_STATUS;
      }
      scheduleDeleteJob(resources);
      return Status.OK_STATUS;
    }
    public boolean belongsTo(    Object family){
      if ("String_Node_Str".equals(family)) {
        return true;
      }
      return super.belongsTo(family);
    }
  }
;
  deletionCheckJob.schedule();
  for (  IContainer container : parentList) {
    try {
      container.refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
  }
  DQRespositoryView findView=(DQRespositoryView)CorePlugin.getDefault().findView(DQRespositoryView.ID);
  findView.getCommonViewer().refresh();
}
Program: 140358
Project: 140358
Buggy source:
@Override public void run(){
  boolean conf=MessageDialog.openConfirm(Display.getDefault().getActiveShell(),"String_Node_Str","String_Node_Str");
  if (conf) {
    try {
      obj.delete(true,null);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  boolean conf=MessageDialog.openConfirm(Display.getDefault().getActiveShell(),"String_Node_Str","String_Node_Str");
  if (conf) {
    try {
      obj.delete(true,null);
      obj.getParent().refreshLocal(IResource.DEPTH_INFINITE,null);
      DQRespositoryView findView=(DQRespositoryView)CorePlugin.getDefault().findView(DQRespositoryView.ID);
      findView.getCommonViewer().refresh();
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
  }
}
Program: 140360
Project: 140360
Buggy source:
public List<IFile> findCorrespondingFile(List<RenderedObject> renderObjs){
  this.getAllAnalysis();
  List<IFile> fileList=new ArrayList<IFile>();
  for (int i=0; i < renderObjs.size(); i++) {
    if (this.registedResourceMap.containsValue(renderObjs.get(i).eResource())) {
      Iterator<IFile> iterator=this.registedResourceMap.keySet().iterator();
      while (iterator.hasNext()) {
        IFile next=iterator.next();
        if (registedResourceMap.get(next) == renderObjs.get(i).eResource()) {
          fileList.add(next);
        }
      }
    }
  }
  return fileList;
}

Fixed version (ground truth):
public List<IFile> findCorrespondingFile(List<RenderedObject> renderObjs){
  this.getAllAnalysis();
  List<IFile> fileList=new ArrayList<IFile>();
  for (int i=0; i < renderObjs.size(); i++) {
    Iterator<IFile> iterator=this.registedResourceMap.keySet().iterator();
    Resource renderObjResource=renderObjs.get(i).eResource();
    while (iterator.hasNext()) {
      IFile next=iterator.next();
      if (registedResourceMap.get(next).getURI().toString().equals(renderObjResource.getURI().toString())) {
        fileList.add(next);
        break;
      }
    }
  }
  return fileList;
}
Program: 140361
Project: 140361
Buggy source:
public Collection<AnalysisEntity> getAllAnalysis(){
  if (resourceChanged) {
    this.clear();
    IFolder defaultAnalysFolder=ResourcesPlugin.getWorkspace().getRoot().getProject(PluginConstant.DATA_PROFILING_PROJECTNAME).getFolder(DQStructureManager.ANALYSIS);
    try {
      searchAllAnalysis(defaultAnalysFolder);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
    resourceChanged=false;
  }
  return allAnalysisMap.values();
}

Fixed version (ground truth):
public Collection<AnalysisEntity> getAllAnalysis(){
  if (resourcesNumberChanged) {
    IFolder defaultAnalysFolder=ResourcesPlugin.getWorkspace().getRoot().getProject(PluginConstant.DATA_PROFILING_PROJECTNAME).getFolder(DQStructureManager.ANALYSIS);
    try {
      searchAllAnalysis(defaultAnalysFolder);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
    resourcesNumberChanged=false;
  }
  return allAnalysisMap.values();
}
Program: 140362
Project: 140362
Buggy source:
public Analysis readFromFile(IFile file){
  registedResourceMap.remove(file);
  Resource fileResource=getFileResource(file);
  Analysis analysis=retireAnalysis(fileResource);
  if (analysis != null) {
    AnalysisEntity entity=new AnalysisEntity(analysis);
    allAnalysisMap.put(file,entity);
  }
  return analysis;
}

Fixed version (ground truth):
public Analysis readFromFile(IFile file){
  this.remove(file);
  Resource fileResource=getFileResource(file);
  Analysis analysis=retireAnalysis(fileResource);
  if (analysis != null) {
    AnalysisEntity entity=new AnalysisEntity(analysis);
    allAnalysisMap.put(file,entity);
  }
  return analysis;
}
Program: 140363
Project: 140363
Buggy source:
public ReturnCode save(Analysis analysis){
  AnalysisWriter writer=new AnalysisWriter();
  ReturnCode saved=writer.save(analysis);
  if (saved.isOk()) {
    setResourceChanged(true);
  }
  return saved;
}

Fixed version (ground truth):
public ReturnCode save(Analysis analysis){
  AnalysisWriter writer=new AnalysisWriter();
  ReturnCode saved=writer.save(analysis);
  return saved;
}
Program: 140364
Project: 140364
Buggy source:
/** 
 * DOC xy Comment method "findPathAnalysis".
 * @param file
 * @return
 */
public Analysis findAnalysis(IFile file){
  AnalysisEntity analysisEntity=allAnalysisMap.get(file);
  if (analysisEntity != null) {
    return analysisEntity.getAnalysis();
  }
  Resource fileResource=getFileResource(file);
  Analysis analysis=retireAnalysis(fileResource);
  if (analysis != null) {
    AnalysisEntity entity=new AnalysisEntity(analysis);
    allAnalysisMap.put(file,entity);
  }
  return analysis;
}

Fixed version (ground truth):
/** 
 * DOC xy Comment method "findPathAnalysis".
 * @param file
 * @return
 */
public Analysis findAnalysis(IFile file){
  AnalysisEntity analysisEntity=allAnalysisMap.get(file);
  if (analysisEntity != null) {
    return analysisEntity.getAnalysis();
  }
  return readFromFile(file);
}
Program: 140366
Project: 140366
Buggy source:
/** 
 * DOC zqin Comment method "getAllAnalysis".
 * @return
 */
public Collection<Pattern> getAllPatternes(){
  if (resourceChanged) {
    patternsMap.clear();
    IFolder defaultPatternFolder=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.LIBRARIES).getFolder(DQStructureManager.PATTERNS);
    try {
      searchAllPatternes(defaultPatternFolder);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
    resourceChanged=false;
  }
  return patternsMap.values();
}

Fixed version (ground truth):
/** 
 * DOC zqin Comment method "getAllAnalysis".
 * @return
 */
public Collection<Pattern> getAllPatternes(){
  if (resourcesNumberChanged) {
    IFolder defaultPatternFolder=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.LIBRARIES).getFolder(DQStructureManager.PATTERNS);
    try {
      searchAllPatternes(defaultPatternFolder);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
    resourcesNumberChanged=false;
  }
  return patternsMap.values();
}
Program: 140367
Project: 140367
Buggy source:
/** 
 * DOC qzhang Comment method "getPatternFile".
 * @param pattern
 */
public IFile getPatternFile(Pattern pattern){
  IFile file=null;
  if (resourceChanged) {
    patternsMap.clear();
    IFolder defaultPatternFolder=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.LIBRARIES).getFolder(DQStructureManager.PATTERNS);
    try {
      searchAllPatternes(defaultPatternFolder);
      defaultPatternFolder=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.LIBRARIES).getFolder(DQStructureManager.SQL_PATTERNS);
      searchAllPatternes(defaultPatternFolder);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
    resourceChanged=false;
  }
  Set<IFile> keySet=patternsMap.keySet();
  for (  IFile file2 : keySet) {
    Pattern pattern2=patternsMap.get(file2);
    RegularExpression e2=(RegularExpression)pattern.getComponents().get(0);
    RegularExpression e=(RegularExpression)pattern2.getComponents().get(0);
    String et=e.getExpressionType();
    String et2=e2.getExpressionType();
    if (pattern2.getName().equals(pattern.getName())) {
      boolean b=et == null && et2 == null;
      b=b || (et != null && et.equals(et2));
      if (b) {
        file=file2;
      }
    }
  }
  return file;
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "getPatternFile".
 * @param pattern
 */
public IFile getPatternFile(Pattern pattern){
  IFile file=null;
  if (resourcesNumberChanged) {
    IFolder defaultPatternFolder=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.LIBRARIES).getFolder(DQStructureManager.PATTERNS);
    try {
      searchAllPatternes(defaultPatternFolder);
      defaultPatternFolder=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.LIBRARIES).getFolder(DQStructureManager.SQL_PATTERNS);
      searchAllPatternes(defaultPatternFolder);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
    resourcesNumberChanged=false;
  }
  Set<IFile> keySet=patternsMap.keySet();
  for (  IFile file2 : keySet) {
    Pattern pattern2=patternsMap.get(file2);
    RegularExpression e2=(RegularExpression)pattern.getComponents().get(0);
    RegularExpression e=(RegularExpression)pattern2.getComponents().get(0);
    String et=e.getExpressionType();
    String et2=e2.getExpressionType();
    if (pattern2.getName().equals(pattern.getName())) {
      boolean b=et == null && et2 == null;
      b=b || (et != null && et.equals(et2));
      if (b) {
        file=file2;
      }
    }
  }
  return file;
}
Program: 140368
Project: 140368
Buggy source:
@SuppressWarnings("String_Node_Str") public boolean save(Pattern pattern){
  EMFUtil sharedEmfUtil=EMFSharedResources.getSharedEmfUtil();
  boolean saved=sharedEmfUtil.saveSingleResource(pattern.eResource());
  if (saved) {
    setResourceChanged(true);
  }
  return saved;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean save(Pattern pattern){
  EMFUtil sharedEmfUtil=EMFSharedResources.getSharedEmfUtil();
  boolean saved=sharedEmfUtil.saveSingleResource(pattern.eResource());
  return saved;
}
Program: 140369
Project: 140369
Buggy source:
public IFile findCorrespondingFile(TdDataProvider provider){
  Iterator<IFile> iterator=this.providerMap.keySet().iterator();
  while (iterator.hasNext()) {
    IFile next=iterator.next();
    TypedReturnCode<TdDataProvider> typedReturnCode=providerMap.get(next);
    if (provider == typedReturnCode.getObject()) {
      return next;
    }
  }
  return null;
}

Fixed version (ground truth):
public IFile findCorrespondingFile(TdDataProvider provider){
  Iterator<IFile> iterator=this.providerMap.keySet().iterator();
  while (iterator.hasNext()) {
    IFile next=iterator.next();
    TypedReturnCode<TdDataProvider> typedReturnCode=providerMap.get(next);
    if (ResourceHelper.areSame(provider,typedReturnCode.getObject())) {
      return next;
    }
  }
  return null;
}
Program: 140370
Project: 140370
Buggy source:
/** 
 * DOC rli Comment method "readFromFile".
 * @param file
 * @return
 */
public TypedReturnCode<TdDataProvider> readFromFile(IFile file){
  TypedReturnCode<TdDataProvider> rc;
  registedResourceMap.remove(file);
  rc=new TypedReturnCode<TdDataProvider>();
  Resource resource=getFileResource(file);
  findTdProvider(file,rc,resource);
  return rc;
}

Fixed version (ground truth):
/** 
 * DOC rli Comment method "readFromFile".
 * @param file
 * @return
 */
public TypedReturnCode<TdDataProvider> readFromFile(IFile file){
  TypedReturnCode<TdDataProvider> rc;
  this.remove(file);
  rc=new TypedReturnCode<TdDataProvider>();
  Resource resource=getFileResource(file);
  findTdProvider(file,rc,resource);
  return rc;
}
Program: 140371
Project: 140371
Buggy source:
public TdReport readFromFile(IFile file){
  registedResourceMap.remove(file);
  Resource fileResource=getFileResource(file);
  TdReport report=retireReport(fileResource);
  if (report != null) {
    allRepMap.put(file,report);
  }
  return report;
}

Fixed version (ground truth):
public TdReport readFromFile(IFile file){
  this.remove(file);
  Resource fileResource=getFileResource(file);
  TdReport report=retireReport(fileResource);
  if (report != null) {
    allRepMap.put(file,report);
  }
  return report;
}
Program: 140372
Project: 140372
Buggy source:
public ReturnCode save(TdReport report){
  ReportWriter writer=new ReportWriter();
  ReturnCode saved=writer.save(report);
  if (saved.isOk()) {
    setResourceChanged(true);
  }
  return saved;
}

Fixed version (ground truth):
public ReturnCode save(TdReport report){
  ReportWriter writer=new ReportWriter();
  ReturnCode saved=writer.save(report);
  return saved;
}