nus-yam/ex-repair huggingface dataset:
Program: 140427
Project: 140427
Buggy source:
public void run(){
  for (  ChartWithData chartData : IndicatorChartFactory.createChart(columnIndicator,true)) {
    ExpandableComposite subComp=toolkit.createExpandableComposite(comp,ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT | ExpandableComposite.EXPANDED);
    subComp.setText(chartData.getChartNamedType());
    Composite composite=toolkit.createComposite(subComp);
    composite.setLayout(new GridLayout(2,false));
    composite.setLayoutData(new GridData(GridData.FILL_VERTICAL));
    ChartTableFactory.createTable(composite,chartData);
    ImageDescriptor imageDescriptor=chartData.getImageDescriptor();
    if (imageDescriptor != null) {
      ImageHyperlink image=toolkit.createImageHyperlink(composite,SWT.WRAP);
      image.setImage(imageDescriptor.createImage());
    }
    subComp.setClient(composite);
    subComp.addExpansionListener(new ExpansionAdapter(){
      @Override public void expansionStateChanged(      ExpansionEvent e){
        form.reflow(true);
      }
    }
);
  }
}

Fixed version (ground truth):
public void run(){
  for (  ChartWithData chartData : IndicatorChartFactory.createChart(columnIndicator,true)) {
    ExpandableComposite subComp=toolkit.createExpandableComposite(comp,ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT | ExpandableComposite.EXPANDED);
    subComp.setText(chartData.getChartNamedType());
    Composite composite=toolkit.createComposite(subComp);
    composite.setLayout(new GridLayout(2,false));
    composite.setLayoutData(new GridData(GridData.FILL_VERTICAL));
    ChartTableFactory.createTable(composite,chartData);
    ImageDescriptor imageDescriptor=chartData.getImageDescriptor();
    if (imageDescriptor != null) {
      ImageHyperlink image=toolkit.createImageHyperlink(composite,SWT.WRAP);
      image.setImage(imageDescriptor.createImage());
      if (chartData.getChartNamedType().equals(CompositeIndicator.SUMMARY_STATISTICS)) {
        addShowDefinition(image);
      }
    }
    subComp.setClient(composite);
    subComp.addExpansionListener(new ExpansionAdapter(){
      @Override public void expansionStateChanged(      ExpansionEvent e){
        form.reflow(true);
      }
    }
);
  }
}
Program: 140428
Project: 140428
Buggy source:
public void run(){
  for (  ChartWithData chart : IndicatorChartFactory.createChart(columnIndicator,isCreate)) {
    if (chart.getImageDescriptor() != null) {
      ImageHyperlink image=toolkit.createImageHyperlink(comp,SWT.WRAP);
      image.setImage(chart.getImageDescriptor().createImage());
      image.setToolTipText("String_Node_Str");
      image.addHyperlinkListener(new HyperlinkAdapter(){
        public void linkActivated(        HyperlinkEvent e){
          try {
            WebBrowserEditor.open(new WebBrowserEditorInput(new URL("String_Node_Str")));
          }
 catch (          MalformedURLException e1) {
            e1.printStackTrace();
          }
        }
      }
);
    }
  }
}

Fixed version (ground truth):
public void run(){
  for (  ChartWithData chart : IndicatorChartFactory.createChart(columnIndicator,isCreate)) {
    if (chart.getImageDescriptor() != null) {
      ImageHyperlink image=toolkit.createImageHyperlink(comp,SWT.WRAP);
      image.setImage(chart.getImageDescriptor().createImage());
      if (chart.getChartNamedType().equals(CompositeIndicator.SUMMARY_STATISTICS)) {
        ColumnAnalysisResultPage.addShowDefinition(image);
      }
    }
  }
}
Program: 140429
Project: 140429
Buggy source:
public void linkActivated(HyperlinkEvent e){
  try {
    WebBrowserEditor.open(new WebBrowserEditorInput(new URL("String_Node_Str")));
  }
 catch (  MalformedURLException e1) {
    e1.printStackTrace();
  }
}

Fixed version (ground truth):
public void linkActivated(HyperlinkEvent e){
  for (  Control control : chartComposite.getChildren()) {
    control.dispose();
  }
  boolean analysisStatue=analysis.getResults().getResultMetadata() != null && analysis.getResults().getResultMetadata().getExecutionDate() != null;
  if (!analysisStatue) {
    boolean returnCode=MessageDialog.openConfirm(null,"String_Node_Str","String_Node_Str");
    if (returnCode) {
      new RunAnalysisAction().run();
      message.setVisible(false);
    }
 else {
      createPreviewCharts(form,chartComposite,false);
      message.setText("String_Node_Str" + "String_Node_Str");
      message.setVisible(true);
    }
  }
 else {
    createPreviewCharts(form,chartComposite,true);
  }
  chartComposite.layout();
  form.reflow(true);
}
Program: 140432
Project: 140432
Buggy source:
/** 
 * DOC qzhang Comment method "initAllDrivers".
 */
private void initAllDrivers(){
  DriverManager driverModel=getDriverModel();
  Collection<ManagedDriver> drivers=driverModel.getDrivers();
  for (  ManagedDriver mand : drivers) {
    String id2=mand.getId();
    EDriverName[] values=EDriverName.values();
    for (    EDriverName supportDBUrlType : values) {
      if (id2.equals(supportDBUrlType.getSqlEid())) {
        mand.setJars(supportDBUrlType.getJars());
        mand.setDriverClassName(supportDBUrlType.getDbDriver());
        try {
          mand.registerSQLDriver();
        }
 catch (        Exception e) {
        }
        break;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "initAllDrivers".
 */
private void initAllDrivers(){
  DriverManager driverModel=getDriverModel();
  Collection<ManagedDriver> drivers=driverModel.getDrivers();
  for (  ManagedDriver mand : drivers) {
    String id2=mand.getId();
    EDriverName[] values=EDriverName.values();
    for (    EDriverName supportDBUrlType : values) {
      if (id2.equals(supportDBUrlType.getSqlEid())) {
        LinkedList<String> jars=mand.getJars();
        if (jars.isEmpty()) {
          mand.setJars(supportDBUrlType.getJars());
        }
        mand.setDriverClassName(supportDBUrlType.getDbDriver());
        try {
          mand.registerSQLDriver();
        }
 catch (        Exception e) {
        }
        break;
      }
    }
  }
}
Program: 140433
Project: 140433
Buggy source:
protected synchronized Class findClass(String className) throws ClassNotFoundException {
  Class cls=(Class)_classes.get(className);
  if (cls == null) {
    cls=super.findClass(className);
    _classes.put(className,cls);
  }
  return cls;
}

Fixed version (ground truth):
public synchronized Class findClass(String className) throws ClassNotFoundException {
  Class cls=(Class)_classes.get(className);
  if (cls == null) {
    cls=super.findClass(className);
    _classes.put(className,cls);
  }
  return cls;
}
Program: 140434
Project: 140434
Buggy source:
/** 
 * Method "getTypeSystem". Method this.  {@link #retrieveDeployedSystemInformations()} should be called beforegetting the type system.
 * @return the TypeSystem that defines the datatypes supported by the software system.
 */
public TypeSystem getTypeSystem(){
  if (softwareSystemBuilder == null) {
    return null;
  }
  return softwareSystemBuilder.getTypeSystem();
}

Fixed version (ground truth):
/** 
 * Method "getTypeSystem". Method this.  {@link #retrieveDeployedSystemInformations()} should be called before gettingthe type system.
 * @return the TypeSystem that defines the datatypes supported by the software system.
 */
public TypeSystem getTypeSystem(){
  if (softwareSystemBuilder == null) {
    return null;
  }
  return softwareSystemBuilder.getTypeSystem();
}
Program: 140435
Project: 140435
Buggy source:
/** 
 * Method "connect". Opens a connection by using the DriverManager class. It is of the responsability of the caller to close it correctly.
 * @param dbUrl the url
 * @param driverClassName
 * @param props
 * @return true if the connection is opened.
 * @throws SQLException
 */
private boolean connectLow(String dbUrl,String driverClassName,Properties props) throws SQLException {
  boolean ok=true;
  try {
    driver=(Driver)Class.forName(driverClassName).newInstance();
    DriverManager.registerDriver(driver);
    connection=DriverManager.getConnection(dbUrl,props);
    this.providerConnection=DatabaseContentRetriever.getProviderConnection(dbUrl,driverClassName,props,connection);
  }
 catch (  InstantiationException e) {
    log.error(e);
    ok=false;
  }
catch (  IllegalAccessException e) {
    log.error(e);
    ok=false;
  }
catch (  ClassNotFoundException e) {
    log.error(e);
    ok=false;
  }
  return ok;
}

Fixed version (ground truth):
/** 
 * Method "connect". Opens a connection by using the DriverManager class. It is of the responsability of the caller to close it correctly.
 * @param dbUrl the url
 * @param driverClassName
 * @param props
 * @return true if the connection is opened.
 * @throws SQLException
 */
private boolean connectLow(String dbUrl,String driverClassName,Properties props) throws SQLException {
  boolean ok=true;
  try {
    driver=ConnectionUtils.getClassDriver(driverClassName);
    connection=driver.connect(dbUrl,props);
    this.providerConnection=DatabaseContentRetriever.getProviderConnection(dbUrl,driverClassName,props,connection);
  }
 catch (  InstantiationException e) {
    log.error(e);
    ok=false;
  }
catch (  IllegalAccessException e) {
    log.error(e);
    ok=false;
  }
catch (  ClassNotFoundException e) {
    log.error(e);
    ok=false;
  }
  return ok;
}
Program: 140436
Project: 140436
Buggy source:
protected boolean isAccessWith(TdDataProvider dp){
  if (dataprovider == null) {
    dataprovider=dp;
    return true;
  }
  if (dataprovider.equals(dp) || ResourceHelper.getUUID(dataprovider) == ResourceHelper.getUUID(dp)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
protected boolean isAccessWith(TdDataProvider dp){
  if (dataprovider == null) {
    dataprovider=dp;
    return true;
  }
  if (dataprovider.equals(dp) || StringUtils.equals(ResourceHelper.getUUID(dataprovider),ResourceHelper.getUUID(dp))) {
    return true;
  }
  return false;
}
Program: 140439
Project: 140439
Buggy source:
@Override protected void createFormContent(IManagedForm managedForm){
  super.createFormContent(managedForm);
  final ScrolledForm form=managedForm.getForm();
  form.setText("String_Node_Str");
  this.metadataSection.setText("String_Node_Str");
  this.metadataSection.setDescription("String_Node_Str");
  createAnalysisParamSection(form,topComp);
  createAnalysisSummarySection(form,topComp);
  createStatisticalSection(form,topComp);
}

Fixed version (ground truth):
@Override protected void createFormContent(IManagedForm managedForm){
  super.createFormContent(managedForm);
  final ScrolledForm form=managedForm.getForm();
  form.setText("String_Node_Str");
  this.metadataSection.setText("String_Node_Str");
  this.metadataSection.setDescription("String_Node_Str");
  createAnalysisParamSection(form,topComp);
  createAnalysisSummarySection(form,topComp);
  createStatisticalSection(form,topComp);
  GridData gdBtn=new GridData();
  gdBtn.horizontalAlignment=SWT.CENTER;
  gdBtn.horizontalSpan=2;
  gdBtn.widthHint=120;
  Button runBtn=toolkit.createButton(form.getBody(),"String_Node_Str",SWT.NONE);
  runBtn.setLayoutData(gdBtn);
  runBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      new RunAnalysisAction().run();
    }
  }
);
}
Program: 140440
Project: 140440
Buggy source:
/** 
 * Method "setDataFilterPattern".
 * @param dataFilters a list of data filters
 * @param type
 * @param domainName
 * @param filterPattern
 * @return
 */
private static Domain setDataFilterPattern(final Collection<Domain> dataFilters,PatternType type,DomainType domainName,String filterPattern){
  RegularExpression filterExpr=BooleanExpressionHelper.createRegularExpression(null,filterPattern);
  for (  Domain domain : dataFilters) {
    if (!domainName.label.equals(domain.getName())) {
      continue;
    }
    boolean exists=false;
    EList<Pattern> patterns=domain.getPatterns();
    for (    Pattern pattern : patterns) {
      if (type.equals(pattern.getName())) {
        exists=true;
        pattern.getComponents().clear();
        pattern.getComponents().add(filterExpr);
      }
    }
    if (!exists) {
      addPatternToDomain(domain,filterExpr,filterPattern,type);
    }
    return domain;
  }
  Domain domain=DomainFactory.eINSTANCE.createDomain();
  dataFilters.add(domain);
  domain.setName(domainName.label);
  addPatternToDomain(domain,filterExpr,filterPattern,type);
  return domain;
}

Fixed version (ground truth):
/** 
 * Method "setDataFilterPattern".
 * @param dataFilters a list of data filters
 * @param type
 * @param domainName
 * @param filterPattern
 * @return
 */
private static Domain setDataFilterPattern(final Collection<Domain> dataFilters,PatternType type,DomainType domainName,String filterPattern){
  RegularExpression filterExpr=BooleanExpressionHelper.createRegularExpression(null,filterPattern);
  for (  Domain domain : dataFilters) {
    if (!domainName.label.equals(domain.getName())) {
      continue;
    }
    boolean exists=false;
    EList<Pattern> patterns=domain.getPatterns();
    for (    Pattern pattern : patterns) {
      if (type.label.equals(pattern.getName())) {
        exists=true;
        pattern.getComponents().clear();
        pattern.getComponents().add(filterExpr);
      }
    }
    if (!exists) {
      addPatternToDomain(domain,filterExpr,filterPattern,type);
    }
    return domain;
  }
  Domain domain=DomainFactory.eINSTANCE.createDomain();
  dataFilters.add(domain);
  domain.setName(domainName.label);
  addPatternToDomain(domain,filterExpr,filterPattern,type);
  return domain;
}
Program: 140441
Project: 140441
Buggy source:
private void creatPatternDefinitionSection(ScrolledForm form,Composite topComp){
  Section section=createSection(form,topComp,"String_Node_Str",false,null);
  sectionComp=toolkit.createComposite(section);
  sectionComp.setLayout(new GridLayout());
  componentsComp=new Composite(sectionComp,SWT.NONE);
  componentsComp.setLayout(new GridLayout());
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,false).applyTo(componentsComp);
  EList<PatternComponent> components=this.pattern.getComponents();
  for (int i=0; i < components.size(); i++) {
    RegularExpressionImpl regularExpress=(RegularExpressionImpl)components.get(i);
    creatNewExpressLine(form,regularExpress);
  }
  createAddButton(form);
  section.setClient(sectionComp);
}

Fixed version (ground truth):
private void creatPatternDefinitionSection(ScrolledForm form,Composite topComp){
  Section section=createSection(form,topComp,"String_Node_Str",false,null);
  sectionComp=toolkit.createComposite(section);
  sectionComp.setLayout(new GridLayout());
  Label label=new Label(sectionComp,SWT.WRAP);
  label.setText("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  componentsComp=new Composite(sectionComp,SWT.NONE);
  componentsComp.setLayout(new GridLayout());
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,false).applyTo(componentsComp);
  EList<PatternComponent> components=this.pattern.getComponents();
  for (int i=0; i < components.size(); i++) {
    RegularExpressionImpl regularExpress=(RegularExpressionImpl)components.get(i);
    creatNewExpressLine(form,regularExpress);
  }
  createAddButton(form);
  section.setClient(sectionComp);
}
Program: 140444
Project: 140444
Buggy source:
private void addTreeListener(final Tree tree){
  tree.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      if (getTheSuitedComposite(e) != null) {
        getTheSuitedComposite(e).setFocus();
      }
      if (e.item instanceof TreeItem) {
        TreeItem item=(TreeItem)e.item;
        if (DATA_PARAM.equals(item.getData(DATA_PARAM))) {
          tree.setMenu(null);
          return;
        }
      }
      tree.setMenu(menu);
    }
  }
);
  tree.addTreeListener(new TreeAdapter(){
    @Override public void treeCollapsed(    TreeEvent e){
      if (getTheSuitedComposite(e) != null) {
        getTheSuitedComposite(e).setExpanded(false);
      }
      masterPage.getForm().reflow(true);
    }
    @Override public void treeExpanded(    TreeEvent e){
      if (getTheSuitedComposite(e) != null) {
        getTheSuitedComposite(e).setExpanded(true);
      }
      masterPage.getForm().reflow(true);
    }
  }
);
}

Fixed version (ground truth):
private void addTreeListener(final Tree tree){
  tree.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      boolean con=false;
      if (getTheSuitedComposite(e) != null) {
        getTheSuitedComposite(e).setFocus();
      }
      if (e.item instanceof TreeItem) {
        TreeItem item=(TreeItem)e.item;
        if (DATA_PARAM.equals(item.getData(DATA_PARAM))) {
          tree.setMenu(null);
          return;
        }
 else         if (item.getData(INDICATOR_UNIT_KEY) != null) {
          IndicatorUnit indicatorUnit=(IndicatorUnit)item.getData(INDICATOR_UNIT_KEY);
          IndicatorEnum type=indicatorUnit.getType();
          con=IndicatorEnum.RegexpMatchingIndicatorEnum.compareTo(type) == 0 || IndicatorEnum.SqlPatternMatchingIndicatorEnum.compareTo(type) == 0;
        }
      }
      createTreeMenu(tree,con);
    }
  }
);
  tree.addTreeListener(new TreeAdapter(){
    @Override public void treeCollapsed(    TreeEvent e){
      if (getTheSuitedComposite(e) != null) {
        getTheSuitedComposite(e).setExpanded(false);
      }
      masterPage.getForm().reflow(true);
    }
    @Override public void treeExpanded(    TreeEvent e){
      if (getTheSuitedComposite(e) != null) {
        getTheSuitedComposite(e).setExpanded(true);
      }
      masterPage.getForm().reflow(true);
    }
  }
);
}
Program: 140445
Project: 140445
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  if (getTheSuitedComposite(e) != null) {
    getTheSuitedComposite(e).setFocus();
  }
  if (e.item instanceof TreeItem) {
    TreeItem item=(TreeItem)e.item;
    if (DATA_PARAM.equals(item.getData(DATA_PARAM))) {
      tree.setMenu(null);
      return;
    }
  }
  tree.setMenu(menu);
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  boolean con=false;
  if (getTheSuitedComposite(e) != null) {
    getTheSuitedComposite(e).setFocus();
  }
  if (e.item instanceof TreeItem) {
    TreeItem item=(TreeItem)e.item;
    if (DATA_PARAM.equals(item.getData(DATA_PARAM))) {
      tree.setMenu(null);
      return;
    }
 else     if (item.getData(INDICATOR_UNIT_KEY) != null) {
      IndicatorUnit indicatorUnit=(IndicatorUnit)item.getData(INDICATOR_UNIT_KEY);
      IndicatorEnum type=indicatorUnit.getType();
      con=IndicatorEnum.RegexpMatchingIndicatorEnum.compareTo(type) == 0 || IndicatorEnum.SqlPatternMatchingIndicatorEnum.compareTo(type) == 0;
    }
  }
  createTreeMenu(tree,con);
}
Program: 140446
Project: 140446
Buggy source:
/** 
 * @param parent
 */
private Tree createTree(Composite parent){
  final Tree newTree=new Tree(parent,SWT.MULTI | SWT.BORDER);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,true).applyTo(newTree);
  newTree.setHeaderVisible(true);
  TreeColumn column1=new TreeColumn(newTree,SWT.CENTER);
  column1.setWidth(190);
  column1.setText("String_Node_Str");
  TreeColumn column2=new TreeColumn(newTree,SWT.CENTER);
  column2.setWidth(100);
  column2.setText("String_Node_Str");
  TreeColumn column3=new TreeColumn(newTree,SWT.CENTER);
  column3.setWidth(100);
  column3.setText("String_Node_Str");
  TreeColumn column4=new TreeColumn(newTree,SWT.CENTER);
  column4.setWidth(120);
  column4.setText("String_Node_Str");
  parent.layout();
  menu=new Menu(newTree);
  MenuItem deleteMenuItem=new MenuItem(menu,SWT.CASCADE);
  deleteMenuItem.setText("String_Node_Str");
  deleteMenuItem.setImage(ImageLib.getImage(ImageLib.DELETE_ACTION));
  deleteMenuItem.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      removeSelectedElements(newTree);
    }
  }
);
  newTree.setMenu(menu);
  AbstractAnalysisActionHandler actionHandler=new AbstractAnalysisActionHandler(parent){
    @Override protected void handleRemove(){
      removeSelectedElements(newTree);
    }
  }
;
  parent.setData(AbstractMetadataFormPage.ACTION_HANDLER,actionHandler);
  ColumnViewerDND.installDND(newTree);
  this.addTreeListener(newTree);
  return newTree;
}

Fixed version (ground truth):
/** 
 * @param parent
 */
private Tree createTree(Composite parent){
  final Tree newTree=new Tree(parent,SWT.MULTI | SWT.BORDER);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,true).applyTo(newTree);
  newTree.setHeaderVisible(true);
  TreeColumn column1=new TreeColumn(newTree,SWT.CENTER);
  column1.setWidth(190);
  column1.setText("String_Node_Str");
  TreeColumn column2=new TreeColumn(newTree,SWT.CENTER);
  column2.setWidth(100);
  column2.setText("String_Node_Str");
  TreeColumn column3=new TreeColumn(newTree,SWT.CENTER);
  column3.setWidth(100);
  column3.setText("String_Node_Str");
  TreeColumn column4=new TreeColumn(newTree,SWT.CENTER);
  column4.setWidth(120);
  column4.setText("String_Node_Str");
  parent.layout();
  createTreeMenu(newTree,false);
  AbstractAnalysisActionHandler actionHandler=new AbstractAnalysisActionHandler(parent){
    @Override protected void handleRemove(){
      removeSelectedElements(newTree);
    }
  }
;
  parent.setData(AbstractMetadataFormPage.ACTION_HANDLER,actionHandler);
  ColumnViewerDND.installDND(newTree);
  this.addTreeListener(newTree);
  return newTree;
}
Program: 140447
Project: 140447
Buggy source:
public String isNotBlank(String colName){
  if (is(MSSQL)) {
    return "String_Node_Str" + colName + "String_Node_Str"+ notEqual()+ "String_Node_Str";
  }
  return "String_Node_Str" + colName + "String_Node_Str"+ notEqual()+ "String_Node_Str";
}

Fixed version (ground truth):
public String isNotBlank(String colName){
  if (is(MSSQL)) {
    return "String_Node_Str" + colName + "String_Node_Str"+ notEqual()+ "String_Node_Str";
  }
  if (is(ORACLE)) {
    return "String_Node_Str" + colName + "String_Node_Str"+ isNull();
  }
  return "String_Node_Str" + colName + "String_Node_Str"+ notEqual()+ "String_Node_Str";
}
Program: 140448
Project: 140448
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=replaceVariables(sqlGenericExpression,rangeColumn,table);
  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);
  allWheresForSingleSelect.add(completedRange);
  return addWhereToSqlStringStatement(allWheresForSingleSelect,completedSqlString);
}
Program: 140449
Project: 140449
Buggy source:
/** 
 * DOC scorreia Comment method "getConnection".
 * @param analysis
 * @param schema
 * @return
 */
protected TypedReturnCode<Connection> getConnection(Analysis analysis){
  TypedReturnCode<Connection> rc=new TypedReturnCode<Connection>();
  DataManager datamanager=analysis.getContext().getConnection();
  if (datamanager == null) {
    rc.setReturnCode("String_Node_Str" + analysis.getName(),false);
    return rc;
  }
  TdDataProvider dataprovider=SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(datamanager);
  if (dataprovider == null) {
    rc.setReturnCode("String_Node_Str" + datamanager.getName() + "String_Node_Str"+ analysis.getName(),false);
    return rc;
  }
  TypedReturnCode<TdProviderConnection> providerConnection=DataProviderHelper.getTdProviderConnection(dataprovider);
  if (!providerConnection.isOk()) {
    rc.setReturnCode(providerConnection.getMessage(),false);
    return rc;
  }
  TypedReturnCode<Connection> connection=JavaSqlFactory.createConnection(providerConnection.getObject());
  if (!connection.isOk()) {
    rc.setReturnCode(connection.getMessage(),false);
    return rc;
  }
  rc.setObject(connection.getObject());
  return rc;
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getConnection".
 * @param analysis
 * @param schema
 * @return
 */
protected TypedReturnCode<Connection> getConnection(Analysis analysis){
  TypedReturnCode<Connection> rc=new TypedReturnCode<Connection>();
  DataManager datamanager=analysis.getContext().getConnection();
  if (datamanager == null) {
    rc.setReturnCode("String_Node_Str" + analysis.getName(),false);
    return rc;
  }
  TdDataProvider dataprovider=SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(datamanager);
  if (dataprovider == null) {
    rc.setReturnCode("String_Node_Str" + datamanager.getName() + "String_Node_Str"+ analysis.getName(),false);
    return rc;
  }
  TypedReturnCode<Connection> connection=JavaSqlFactory.createConnection(dataprovider);
  if (!connection.isOk()) {
    rc.setReturnCode(connection.getMessage(),false);
    return rc;
  }
  rc.setObject(connection.getObject());
  return rc;
}
Program: 140450
Project: 140450
Buggy source:
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (element instanceof EObject) {
    EObject eObj=(EObject)element;
    if (SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(eObj) != null || dependencySwitch.doSwitch(eObj) != null) {
      return false;
    }
  }
 else   if (element instanceof IFile) {
    IFile file=(IFile)element;
    return file.getFileExtension() != null;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (parentElement instanceof TreePath) {
    TreePath path=(TreePath)parentElement;
    if (path.getLastSegment() instanceof AnaElementFolderNode) {
      return true;
    }
  }
  if (element instanceof EObject) {
    EObject eObj=(EObject)element;
    if (SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(eObj) != null || dependencySwitch.doSwitch(eObj) != null) {
      return false;
    }
  }
 else   if (element instanceof IFile) {
    IFile file=(IFile)element;
    return file.getFileExtension() != null;
  }
  return true;
}
Program: 140451
Project: 140451
Buggy source:
public String getText(Object element){
  if (element instanceof AbstractFolderNode) {
    if (((IFolderNode)element).getChildren() != null) {
      return ((IFolderNode)element).getName() + "String_Node_Str" + ((IFolderNode)element).getChildren().length+ "String_Node_Str";
    }
    return ((IFolderNode)element).getName();
  }
  if (element instanceof Pattern) {
    Pattern pattern=(Pattern)element;
    RegularExpression patternComponent=(RegularExpression)pattern.getComponents().get(0);
    return patternComponent.getExpression().getBody();
  }
  return super.getText(element);
}

Fixed version (ground truth):
public String getText(Object element){
  if (element instanceof AbstractFolderNode) {
    if (((IFolderNode)element).getChildren() != null) {
      return ((IFolderNode)element).getName() + "String_Node_Str" + ((IFolderNode)element).getChildren().length+ "String_Node_Str";
    }
    return ((IFolderNode)element).getName();
  }
  if (element instanceof Pattern) {
    Pattern pattern=(Pattern)element;
    RegularExpression patternComponent=(RegularExpression)pattern.getComponents().get(0);
    return patternComponent.getExpression().getBody();
  }
 else   if (element instanceof TdDataProvider) {
    return ((TdDataProvider)element).getName();
  }
  return super.getText(element);
}
Program: 140452
Project: 140452
Buggy source:
public Image getImage(Object element){
  if (element instanceof IFolderNode) {
    return ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
  }
  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);
  }
  return super.getImage(element);
}
Program: 140453
Project: 140453
Buggy source:
public void saveAnalysis() throws DataprofilerCoreException {
  if (this.domain == null) {
    domain=DomainFactory.eINSTANCE.createDomain();
    domain.setName(DomainHelper.ANALYSIS_DATA_FILTER);
  }
  List<Domain> domains=new ArrayList<Domain>();
  domains.add(domain);
  if (!this.tableFilterText.getText().equals(PluginConstant.EMPTY_STRING)) {
    DomainHelper.setDataFilterTablePattern(domains,tableFilterText.getText());
  }
  if (!this.viewFilterText.getText().equals(PluginConstant.EMPTY_STRING)) {
    DomainHelper.setDataFilterViewPattern(domains,viewFilterText.getText());
  }
  connectionAnalysis.getParameters().getDataFilter().add(domain);
  ReturnCode save=AnaResourceFileHelper.getInstance().save(connectionAnalysis);
  if (save.isOk()) {
    log.info("String_Node_Str" + connectionAnalysis.getFileName());
  }
}

Fixed version (ground truth):
public void saveAnalysis() throws DataprofilerCoreException {
  EList<Domain> dataFilters=connectionAnalysis.getParameters().getDataFilter();
  if (!this.tableFilterText.getText().equals(PluginConstant.EMPTY_STRING)) {
    DomainHelper.setDataFilterTablePattern(dataFilters,tableFilterText.getText());
  }
  if (!this.viewFilterText.getText().equals(PluginConstant.EMPTY_STRING)) {
    DomainHelper.setDataFilterViewPattern(dataFilters,viewFilterText.getText());
  }
  ReturnCode save=AnaResourceFileHelper.getInstance().save(connectionAnalysis);
  if (save.isOk()) {
    log.info("String_Node_Str" + connectionAnalysis.getFileName());
  }
}
Program: 140456
Project: 140456
Buggy source:
private IFile createEmptyAnalysisFile() throws DataprofilerCoreException {
  AnalysisBuilder analysisBuilder=new AnalysisBuilder();
  boolean analysisInitialized=analysisBuilder.initializeAnalysis(analysisName,analysisType);
  if (!analysisInitialized) {
    throw new DataprofilerCoreException(analysisName + "String_Node_Str");
  }
  Analysis analysis=analysisBuilder.getAnalysis();
  fillAnalysisBuilder(analysisBuilder);
  AnalysisWriter writer=new AnalysisWriter();
  TypedReturnCode<IFile> saved=writer.createAnalysisFile(analysis,folderResource);
  IFile file;
  if (saved.isOk()) {
    log.info("String_Node_Str" + folderResource.getFullPath().toString());
    file=saved.getObject();
    Resource anaResource=analysis.eResource();
    AnaResourceFileHelper.getInstance().register(file,anaResource);
    AnaResourceFileHelper.getInstance().setResourceChanged(true);
  }
 else {
    throw new DataprofilerCoreException("String_Node_Str" + folderResource.getFullPath().toString() + "String_Node_Str"+ saved.getMessage());
  }
  CorePlugin.getDefault().refreshWorkSpace();
  ((DQRespositoryView)CorePlugin.getDefault().findView(DQRespositoryView.ID)).getCommonViewer().refresh();
  return file;
}

Fixed version (ground truth):
protected IFile createEmptyAnalysisFile() throws DataprofilerCoreException {
  AnalysisBuilder analysisBuilder=new AnalysisBuilder();
  boolean analysisInitialized=analysisBuilder.initializeAnalysis(analysisName,analysisType);
  if (!analysisInitialized) {
    throw new DataprofilerCoreException(analysisName + "String_Node_Str");
  }
  Analysis analysis=analysisBuilder.getAnalysis();
  fillAnalysisBuilder(analysisBuilder);
  AnalysisWriter writer=new AnalysisWriter();
  TypedReturnCode<IFile> saved=writer.createAnalysisFile(analysis,folderResource);
  IFile file;
  if (saved.isOk()) {
    log.info("String_Node_Str" + folderResource.getFullPath().toString());
    file=saved.getObject();
    Resource anaResource=analysis.eResource();
    AnaResourceFileHelper.getInstance().register(file,anaResource);
    AnaResourceFileHelper.getInstance().setResourceChanged(true);
  }
 else {
    throw new DataprofilerCoreException("String_Node_Str" + folderResource.getFullPath().toString() + "String_Node_Str"+ saved.getMessage());
  }
  CorePlugin.getDefault().refreshWorkSpace();
  ((DQRespositoryView)CorePlugin.getDefault().findView(DQRespositoryView.ID)).getCommonViewer().refresh();
  return file;
}
Program: 140457
Project: 140457
Buggy source:
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  container.setLayout(new GridLayout());
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.heightHint=70;
  Label inforLabel=new Label(container,SWT.BORDER);
  inforLabel.setText(defaultInfor);
  inforLabel.setLayoutData(gd);
  Composite subContainer=new Composite(container,SWT.NONE);
  GridLayout subLayout=new GridLayout(2,false);
  subContainer.setLayout(subLayout);
  subContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
  Label labelTable=new Label(subContainer,SWT.NONE);
  labelTable.setText("String_Node_Str");
  tableFilter=new Text(subContainer,SWT.BORDER);
  tableFilter.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  tableFilter.setText("String_Node_Str");
  tableFilter.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      ((ConnectionAnalysisParameter)getConnectionParams()).setViewFilter(tableFilter.getText());
    }
  }
);
  Label labelView=new Label(subContainer,SWT.NONE);
  labelView.setText("String_Node_Str");
  viewFilter=new Text(subContainer,SWT.BORDER);
  viewFilter.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  viewFilter.setText("String_Node_Str");
  viewFilter.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      ((ConnectionAnalysisParameter)getConnectionParams()).setViewFilter(viewFilter.getText());
    }
  }
);
  setControl(container);
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  container.setLayout(new GridLayout());
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.heightHint=70;
  Label inforLabel=new Label(container,SWT.BORDER);
  inforLabel.setText(defaultInfor);
  inforLabel.setLayoutData(gd);
  Composite subContainer=new Composite(container,SWT.NONE);
  GridLayout subLayout=new GridLayout(2,false);
  subContainer.setLayout(subLayout);
  subContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
  Label labelTable=new Label(subContainer,SWT.NONE);
  labelTable.setText("String_Node_Str");
  tableFilter=new Text(subContainer,SWT.BORDER);
  tableFilter.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  tableFilter.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      ((ConnectionAnalysisParameter)getConnectionParams()).setTableFilter(tableFilter.getText());
    }
  }
);
  Label labelView=new Label(subContainer,SWT.NONE);
  labelView.setText("String_Node_Str");
  viewFilter=new Text(subContainer,SWT.BORDER);
  viewFilter.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  viewFilter.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      ((ConnectionAnalysisParameter)getConnectionParams()).setViewFilter(viewFilter.getText());
    }
  }
);
  setControl(container);
}
Program: 140458
Project: 140458
Buggy source:
@Override protected void fillAnalysisBuilder(AnalysisBuilder analysisBuilder){
  ConnectionAnalysisParameter parameters=(ConnectionAnalysisParameter)getAnalysisParameter();
  TdDataProvider tdProvider=parameters.getTdDataProvider();
  this.analysisBuilder=analysisBuilder;
  analysisBuilder.setAnalysisConnection(tdProvider);
  ConnectionIndicator indicator=SchemaFactory.eINSTANCE.createConnectionIndicator();
  indicator.setAnalyzedElement(tdProvider);
  List<TdSchema> tdSchemas=DataProviderHelper.getTdSchema(tdProvider);
  for (  TdSchema schema : tdSchemas) {
    SchemaIndicator createSchemaIndicator=SchemaFactory.eINSTANCE.createSchemaIndicator();
    createSchemaIndicator.setAnalyzedElement(schema);
    indicator.addSchemaIndicator(createSchemaIndicator);
  }
  List<TdCatalog> tdCatalogs=DataProviderHelper.getTdCatalogs(tdProvider);
  for (  TdCatalog tdCatalog : tdCatalogs) {
    SchemaIndicator createSchemaIndicator=SchemaFactory.eINSTANCE.createSchemaIndicator();
    createSchemaIndicator.setAnalyzedElement(tdCatalog);
    indicator.addSchemaIndicator(createSchemaIndicator);
  }
  analysisBuilder.addElementToAnalyze(tdProvider,indicator);
  super.fillAnalysisBuilder(analysisBuilder);
}

Fixed version (ground truth):
@Override protected void fillAnalysisBuilder(AnalysisBuilder analysisBuilder){
  ConnectionAnalysisParameter parameters=(ConnectionAnalysisParameter)getAnalysisParameter();
  TdDataProvider tdProvider=parameters.getTdDataProvider();
  analysisBuilder.setAnalysisConnection(tdProvider);
  ConnectionIndicator indicator=SchemaFactory.eINSTANCE.createConnectionIndicator();
  indicator.setAnalyzedElement(tdProvider);
  List<TdSchema> tdSchemas=DataProviderHelper.getTdSchema(tdProvider);
  for (  TdSchema schema : tdSchemas) {
    SchemaIndicator createSchemaIndicator=SchemaFactory.eINSTANCE.createSchemaIndicator();
    createSchemaIndicator.setAnalyzedElement(schema);
    indicator.addSchemaIndicator(createSchemaIndicator);
  }
  List<TdCatalog> tdCatalogs=DataProviderHelper.getTdCatalogs(tdProvider);
  for (  TdCatalog tdCatalog : tdCatalogs) {
    SchemaIndicator createSchemaIndicator=SchemaFactory.eINSTANCE.createSchemaIndicator();
    createSchemaIndicator.setAnalyzedElement(tdCatalog);
    indicator.addSchemaIndicator(createSchemaIndicator);
  }
  analysisBuilder.addElementToAnalyze(tdProvider,indicator);
  super.fillAnalysisBuilder(analysisBuilder);
}
Program: 140459
Project: 140459
Buggy source:
public void run(){
  for (  ChartWithData chart : IndicatorChartFactory.createChart(columnIndicator,isCreate)) {
    ImageHyperlink image=toolkit.createImageHyperlink(comp,SWT.WRAP);
    image.setImage(chart.getImageDescriptor().createImage());
  }
}

Fixed version (ground truth):
public void run(){
  for (  ChartWithData chart : IndicatorChartFactory.createChart(columnIndicator,isCreate)) {
    if (chart.getImageDescriptor() != null) {
      ImageHyperlink image=toolkit.createImageHyperlink(comp,SWT.WRAP);
      image.setImage(chart.getImageDescriptor().createImage());
    }
  }
}
Program: 140461
Project: 140461
Buggy source:
private static CategoryDataset createSimpleDataset(List<IndicatorUnit> indicatorUnitList,boolean isCreate){
  DefaultCategoryDataset dataset=new DefaultCategoryDataset();
  if (isCreate) {
    for (int index=0; index < indicatorUnitList.size(); index++) {
      IndicatorUnit unit=indicatorUnitList.get(index);
      IndicatorCommonUtil.compositeIndicatorMap(unit);
      Object object=unit.getValue();
      String label=unit.getIndicatorName();
      if (object != null && !unit.getIndicator().getInstantiatedExpressions().isEmpty()) {
        String valueStr=String.valueOf(object);
        double value=Double.parseDouble(valueStr);
        renderer3d.setSeriesPaint(index,unit.getColor());
        dataset.addValue(value,label,"String_Node_Str");
      }
    }
  }
 else {
    for (    IndicatorUnit indicator : indicatorUnitList) {
      dataset.addValue(150,indicator.getIndicatorName(),"String_Node_Str");
    }
  }
  return dataset;
}

Fixed version (ground truth):
private static CategoryDataset createSimpleDataset(List<IndicatorUnit> indicatorUnitList,boolean isCreate){
  DefaultCategoryDataset dataset=new DefaultCategoryDataset();
  if (isCreate) {
    for (int index=0; index < indicatorUnitList.size(); index++) {
      IndicatorUnit unit=indicatorUnitList.get(index);
      IndicatorCommonUtil.compositeIndicatorMap(unit);
      if (unit.isExcuted()) {
        double value=Double.parseDouble(unit.getValue().toString());
        String label=unit.getIndicatorName();
        renderer3d.setSeriesPaint(index,unit.getColor());
        dataset.addValue(value,label,"String_Node_Str");
      }
    }
  }
 else {
    for (    IndicatorUnit indicator : indicatorUnitList) {
      dataset.addValue(150,indicator.getIndicatorName(),"String_Node_Str");
    }
  }
  return dataset;
}
Program: 140463
Project: 140463
Buggy source:
private static CategoryDataset createFrequenceDataset(List<IndicatorUnit> indicatorUnitList,boolean isCreate){
  DefaultCategoryDataset dataset=new DefaultCategoryDataset();
  for (  IndicatorUnit indicatorUnit : indicatorUnitList) {
    IndicatorCommonUtil.compositeIndicatorMap(indicatorUnit);
    Object object=indicatorUnit.getValue();
    if (object != null) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])object;
      Arrays.sort(frequencyExt);
      if (isCreate) {
        int numOfShown=frequencyExt.length;
        IndicatorParameters parameters=indicatorUnit.getIndicator().getParameters();
        if (parameters != null) {
          if (parameters.getTopN() < frequencyExt.length) {
            numOfShown=parameters.getTopN();
          }
        }
        for (int i=0; i < numOfShown; i++) {
          dataset.addValue(frequencyExt[i].getValue(),"String_Node_Str",String.valueOf(frequencyExt[i].getKey()));
        }
      }
 else {
        dataset.addValue(70,"String_Node_Str","String_Node_Str");
        dataset.addValue(150,"String_Node_Str","String_Node_Str");
        dataset.addValue(180,"String_Node_Str","String_Node_Str");
        dataset.addValue(185,"String_Node_Str","String_Node_Str");
        dataset.addValue(224,"String_Node_Str","String_Node_Str");
      }
    }
  }
  return dataset;
}

Fixed version (ground truth):
private static CategoryDataset createFrequenceDataset(List<IndicatorUnit> indicatorUnitList,boolean isCreate){
  DefaultCategoryDataset dataset=new DefaultCategoryDataset();
  for (  IndicatorUnit indicatorUnit : indicatorUnitList) {
    IndicatorCommonUtil.compositeIndicatorMap(indicatorUnit);
    if (indicatorUnit.isExcuted()) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])indicatorUnit.getValue();
      Arrays.sort(frequencyExt);
      if (isCreate) {
        int numOfShown=frequencyExt.length;
        IndicatorParameters parameters=indicatorUnit.getIndicator().getParameters();
        if (parameters != null) {
          if (parameters.getTopN() < frequencyExt.length) {
            numOfShown=parameters.getTopN();
          }
        }
        for (int i=0; i < numOfShown; i++) {
          dataset.addValue(frequencyExt[i].getValue(),"String_Node_Str",String.valueOf(frequencyExt[i].getKey()));
        }
      }
 else {
        dataset.addValue(70,"String_Node_Str","String_Node_Str");
        dataset.addValue(150,"String_Node_Str","String_Node_Str");
        dataset.addValue(180,"String_Node_Str","String_Node_Str");
        dataset.addValue(185,"String_Node_Str","String_Node_Str");
        dataset.addValue(224,"String_Node_Str","String_Node_Str");
      }
    }
  }
  return dataset;
}
Program: 140464
Project: 140464
Buggy source:
private static CategoryDataset createPatternMatchDataset(List<IndicatorUnit> indicatorUnitList,boolean isCreate){
  DefaultCategoryDataset dataset=new DefaultCategoryDataset();
  if (isCreate) {
    int i=0;
    for (    IndicatorUnit unit : indicatorUnitList) {
      IndicatorCommonUtil.compositeIndicatorMap(unit);
      String label=unit.getIndicatorName();
      if (unit.getValue() != null) {
        PatternMatchingExt patternExt=(PatternMatchingExt)unit.getValue();
        double notMathCount=patternExt.getNotMatchingValueCount();
        double machCount=patternExt.getMatchingValueCount();
        dataset.addValue(machCount,"String_Node_Str",label);
        dataset.addValue(notMathCount,"String_Node_Str",label);
      }
 else {
        dataset.addValue(0,"String_Node_Str","String_Node_Str");
        dataset.addValue(0,"String_Node_Str","String_Node_Str");
      }
      i++;
    }
  }
 else {
    dataset.addValue(0.23,"String_Node_Str","String_Node_Str");
    dataset.addValue(0.77,"String_Node_Str","String_Node_Str");
  }
  return dataset;
}

Fixed version (ground truth):
private static CategoryDataset createPatternMatchDataset(List<IndicatorUnit> indicatorUnitList,boolean isCreate){
  DefaultCategoryDataset dataset=new DefaultCategoryDataset();
  if (isCreate) {
    int i=0;
    for (    IndicatorUnit unit : indicatorUnitList) {
      IndicatorCommonUtil.compositeIndicatorMap(unit);
      String label=unit.getIndicatorName();
      if (unit.isExcuted()) {
        PatternMatchingExt patternExt=(PatternMatchingExt)unit.getValue();
        double notMathCount=patternExt.getNotMatchingValueCount();
        double machCount=patternExt.getMatchingValueCount();
        dataset.addValue(machCount,"String_Node_Str",label);
        dataset.addValue(notMathCount,"String_Node_Str",label);
      }
      i++;
    }
  }
 else {
    dataset.addValue(0.23,"String_Node_Str","String_Node_Str");
    dataset.addValue(0.77,"String_Node_Str","String_Node_Str");
  }
  return dataset;
}
Program: 140467
Project: 140467
Buggy source:
private String extract(DateGrain dateGrain,String colName){
  if (is(MYSQL)) {
    return dateGrain.getName() + surroundWith('(',colName,')');
  }
  if (is(ORACLE)) {
    String toNumberToChar="String_Node_Str";
switch (dateGrain.getValue()) {
case DateGrain.DAY_VALUE:
      return toNumberToChar + colName + "String_Node_Str";
case DateGrain.WEEK_VALUE:
    return toNumberToChar + colName + "String_Node_Str";
case DateGrain.MONTH_VALUE:
  return toNumberToChar + colName + "String_Node_Str";
case DateGrain.QUARTER_VALUE:
return toNumberToChar + colName + "String_Node_Str";
case DateGrain.YEAR_VALUE:
return toNumberToChar + colName + "String_Node_Str";
default :
}
}
return "String_Node_Str" + dateGrain + from()+ colName+ "String_Node_Str";
}

Fixed version (ground truth):
private String extract(DateGrain dateGrain,String colName){
  if (is(MYSQL)) {
    return dateGrain.getName() + surroundWith('(',colName,')');
  }
  if (is(ORACLE)) {
    String toNumberToChar="String_Node_Str";
switch (dateGrain.getValue()) {
case DateGrain.DAY_VALUE:
      return toNumberToChar + colName + "String_Node_Str";
case DateGrain.WEEK_VALUE:
    return toNumberToChar + colName + "String_Node_Str";
case DateGrain.MONTH_VALUE:
  return toNumberToChar + colName + "String_Node_Str";
case DateGrain.QUARTER_VALUE:
return toNumberToChar + colName + "String_Node_Str";
case DateGrain.YEAR_VALUE:
return toNumberToChar + colName + "String_Node_Str";
default :
}
}
if (is(MSSQL)) {
return "String_Node_Str" + dateGrain.getName() + "String_Node_Str"+ colName+ "String_Node_Str";
}
return "String_Node_Str" + dateGrain + from()+ colName+ "String_Node_Str";
}
Program: 140468
Project: 140468
Buggy source:
private String getAlias(String colName,DateGrain dateAggregationType){
  return "String_Node_Str" + colName + dateAggregationType.getName();
}

Fixed version (ground truth):
private String getAlias(String colName,DateGrain dateAggregationType){
  if (dbms().supportAliasesInGroupBy()) {
    return "String_Node_Str" + unquote(colName) + dateAggregationType.getName()+ "String_Node_Str";
  }
 else {
    return "String_Node_Str";
  }
}
Program: 140471
Project: 140471
Buggy source:
public void modifyText(ModifyEvent e){
  String numb=numbOfBins.getText();
  if (numb == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
  }
 else   if (!CheckValueUtils.isNumberValue(numb)) {
    updateStatus(IStatus.ERROR,MSG_ONLY_REAL_NUMBER);
  }
 else {
    updateStatus(IStatus.OK,MSG_OK);
    parameter.setNumOfBins(Integer.parseInt(numb));
  }
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  String numb=numbOfBins.getText();
  if (numb == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
  }
 else   if (!CheckValueUtils.isNumberValue(numb)) {
    updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
  }
 else {
    updateStatus(IStatus.OK,MSG_OK);
    parameter.setNumOfBins(Integer.parseInt(numb));
  }
}