nus-yam/ex-repair huggingface dataset:
Program: 136567
Project: 136567
Buggy source:
private void createReport(String name,IFolder folder,Boolean isDelete){
  IPath createPath=Path.EMPTY;
  if (folder != null) {
    createPath=new Path(folder.getFullPath().lastSegment());
  }
  Report report1=ReportHelper.createReport(name);
  TDQReportItem item1=PropertiesFactoryImpl.eINSTANCE.createTDQReportItem();
  org.talend.core.model.properties.Property property1=PropertiesFactory.eINSTANCE.createProperty();
  property1.setId(EcoreUtil.generateUUID());
  property1.setItem(item1);
  property1.setLabel(report1.getName());
  item1.setProperty(property1);
  item1.setReport(report1);
  ItemState itemState=org.talend.core.model.properties.PropertiesFactory.eINSTANCE.createItemState();
  itemState.setDeleted(isDelete);
  item1.setState(itemState);
  try {
    ProxyRepositoryFactory.getInstance().create(item1,createPath,false);
  }
 catch (  PersistenceException e) {
    Assert.fail(e.getMessage());
  }
}

Fixed version (ground truth):
private void createReport(String name,IPath createPath,Boolean isDelete){
  Report report1=ReportHelper.createReport(name);
  TDQReportItem item1=PropertiesFactoryImpl.eINSTANCE.createTDQReportItem();
  org.talend.core.model.properties.Property property1=PropertiesFactory.eINSTANCE.createProperty();
  property1.setId(EcoreUtil.generateUUID());
  property1.setItem(item1);
  property1.setLabel(report1.getName());
  item1.setProperty(property1);
  item1.setReport(report1);
  ItemState itemState=org.talend.core.model.properties.PropertiesFactory.eINSTANCE.createItemState();
  itemState.setDeleted(isDelete);
  item1.setState(itemState);
  try {
    ProxyRepositoryFactory.getInstance().create(item1,createPath,false);
  }
 catch (  PersistenceException e) {
    Assert.fail(e.getMessage());
  }
}
Program: 136568
Project: 136568
Buggy source:
private void createAnalysis(String name,IFolder folder,Boolean isDelete){
  IPath createPath=Path.EMPTY;
  if (folder != null) {
    createPath=new Path(folder.getFullPath().lastSegment());
  }
  Analysis analysis1=AnalysisHelper.createAnalysis(name);
  TDQAnalysisItem item1=PropertiesFactoryImpl.eINSTANCE.createTDQAnalysisItem();
  org.talend.core.model.properties.Property property1=PropertiesFactory.eINSTANCE.createProperty();
  property1.setId(EcoreUtil.generateUUID());
  property1.setItem(item1);
  property1.setLabel(analysis1.getName());
  item1.setProperty(property1);
  item1.setAnalysis(analysis1);
  ItemState itemState=org.talend.core.model.properties.PropertiesFactory.eINSTANCE.createItemState();
  itemState.setDeleted(isDelete);
  item1.setState(itemState);
  AnalysisResult analysisResult1=AnalysisFactory.eINSTANCE.createAnalysisResult();
  analysis1.setResults(analysisResult1);
  try {
    ProxyRepositoryFactory.getInstance().create(item1,createPath,false);
  }
 catch (  PersistenceException e) {
    Assert.fail(e.getMessage());
  }
}

Fixed version (ground truth):
private void createAnalysis(String name,IPath createPath,Boolean isDelete){
  Analysis analysis1=AnalysisHelper.createAnalysis(name);
  TDQAnalysisItem item1=PropertiesFactoryImpl.eINSTANCE.createTDQAnalysisItem();
  org.talend.core.model.properties.Property property1=PropertiesFactory.eINSTANCE.createProperty();
  property1.setId(EcoreUtil.generateUUID());
  property1.setItem(item1);
  property1.setLabel(analysis1.getName());
  item1.setProperty(property1);
  item1.setAnalysis(analysis1);
  ItemState itemState=org.talend.core.model.properties.PropertiesFactory.eINSTANCE.createItemState();
  itemState.setDeleted(isDelete);
  item1.setState(itemState);
  AnalysisResult analysisResult1=AnalysisFactory.eINSTANCE.createAnalysisResult();
  analysis1.setResults(analysisResult1);
  try {
    ProxyRepositoryFactory.getInstance().create(item1,createPath,false);
  }
 catch (  PersistenceException e) {
    Assert.fail(e.getMessage());
  }
}
Program: 136570
Project: 136570
Buggy source:
/** 
 * Test method for  {@link org.talend.dataprofiler.core.ui.views.provider.ResourceViewLabelProvider#getFileCount(org.eclipse.core.resources.IFolder,java.lang.String[])}
 */
@Test public void testGetFileCount(){
  IFolder anaFolder=initFolder(EResourceConstant.ANALYSIS.getPath());
  IFolder repFolder=initFolder(EResourceConstant.REPORTS.getPath());
  ResourceViewLabelProvider reViewLabelProvider=new ResourceViewLabelProvider();
  int AnalysisNum=reViewLabelProvider.getFileCount(anaFolder,filterExtensions);
  int reportNum=reViewLabelProvider.getFileCount(repFolder,filterExtensions);
  assertEquals(AnalysisNum,3);
  assertEquals(reportNum,3);
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.talend.dataprofiler.core.ui.views.provider.ResourceViewLabelProvider#getFileCount(org.eclipse.core.resources.IFolder,java.lang.String[])}
 */
@Test public void testGetFileCount(){
  log.debug("String_Node_Str");
  IFolder repFolder=initFolder(EResourceConstant.REPORTS.getPath());
  IFolder anaFolder=initFolder(EResourceConstant.ANALYSIS.getPath());
  ResourceViewLabelProvider reViewLabelProvider=new ResourceViewLabelProvider();
  int analysisNum=reViewLabelProvider.getFileCount(anaFolder,filterExtensions);
  int reportNum=reViewLabelProvider.getFileCount(repFolder,filterExtensions);
  log.debug("String_Node_Str" + analysisNum);
  log.debug("String_Node_Str" + reportNum);
  assertEquals(3,analysisNum);
  assertEquals(3,reportNum);
}
Program: 136571
Project: 136571
Buggy source:
public String getValue(){
  if (value != null) {
    return StringFormatUtil.format(value,StringFormatUtil.NUMBER).toString();
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public String getValue(){
  return value;
}
Program: 136572
Project: 136572
Buggy source:
/** 
 * DOC xqliu Comment method "handleMatchingValue".
 * @param indicator
 * @return
 */
private static Object handleMatchingValue(Indicator indicator){
  Object tempObject;
  PatternMatchingExt patternExt=new PatternMatchingExt();
  if (UDIHelper.isUDI(indicator)) {
    UserDefIndicator udi=(UserDefIndicator)indicator;
    if (udi.getMatchingValueCount() != null) {
      patternExt.setMatchingValueCount(udi.getMatchingValueCount());
    }
    if (udi.getNotMatchingValueCount() != null) {
      patternExt.setNotMatchingValueCount(udi.getNotMatchingValueCount());
    }
  }
 else {
    patternExt.setMatchingValueCount(((PatternMatchingIndicator)indicator).getMatchingValueCount());
    patternExt.setNotMatchingValueCount(((PatternMatchingIndicator)indicator).getNotMatchingValueCount());
  }
  tempObject=patternExt;
  return tempObject;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "handleMatchingValue".
 * @param indicator
 * @return
 */
public static PatternMatchingExt handleMatchingValue(Indicator indicator){
  PatternMatchingExt patternExt=new PatternMatchingExt();
  if (UDIHelper.isUDI(indicator)) {
    UserDefIndicator udi=(UserDefIndicator)indicator;
    if (udi.getMatchingValueCount() != null) {
      patternExt.setMatchingValueCount(udi.getMatchingValueCount());
    }
    if (udi.getNotMatchingValueCount() != null) {
      patternExt.setNotMatchingValueCount(udi.getNotMatchingValueCount());
    }
  }
 else {
    patternExt.setMatchingValueCount(((PatternMatchingIndicator)indicator).getMatchingValueCount());
    patternExt.setNotMatchingValueCount(((PatternMatchingIndicator)indicator).getNotMatchingValueCount());
  }
  return patternExt;
}
Program: 136573
Project: 136573
Buggy source:
/** 
 * Added TDQ-8787 20140613 yyin: create all charts before running, register each chart with its related indicator.
 */
public void registerDynamicEvent(){
  List<DynamicIndicatorModel> indiAndDatasets=uiPagination.getAllIndcatorAndDatasetOfCurrentPage();
  for (  DynamicIndicatorModel oneCategoryIndicatorModel : indiAndDatasets) {
    TableViewer tableViewer=oneCategoryIndicatorModel.getTableViewer();
    if (EIndicatorChartType.SUMMARY_STATISTICS.equals(oneCategoryIndicatorModel.getChartType())) {
      DynamicBAWChartEventReceiver bawReceiver=AnalysisUtils.createDynamicBAWChartEventReceiver(oneCategoryIndicatorModel,eventReceivers);
      bawReceiver.setChartComposite(chartComposite);
      bawReceiver.refreshChart();
      bawReceiver.setTableViewer(tableViewer);
    }
 else {
      int index=0;
      for (      Indicator oneIndicator : oneCategoryIndicatorModel.getIndicatorList()) {
        DynamicChartEventReceiver eReceiver=AnalysisUtils.createDynamicChartEventReceiver(oneCategoryIndicatorModel,index++,oneIndicator);
        eReceiver.setChartComposite(chartComposite);
        eReceiver.setParentChartComposite((Composite)oneCategoryIndicatorModel.getBawParentChartComp());
        eReceiver.refreshChart();
        eReceiver.setTableViewer(tableViewer);
        eReceiver.clearValue();
        registerIndicatorEvent(oneIndicator,eReceiver);
      }
    }
  }
  reLayoutChartComposite();
  registerOtherDynamicEvent();
}

Fixed version (ground truth):
/** 
 * Added TDQ-8787 20140613 yyin: create all charts before running, register each chart with its related indicator.
 */
public void registerDynamicEvent(){
  List<DynamicIndicatorModel> indiAndDatasets=uiPagination.getAllIndcatorAndDatasetOfCurrentPage();
  for (  DynamicIndicatorModel oneCategoryIndicatorModel : indiAndDatasets) {
    TableViewer tableViewer=oneCategoryIndicatorModel.getTableViewer();
    if (EIndicatorChartType.SUMMARY_STATISTICS.equals(oneCategoryIndicatorModel.getChartType())) {
      DynamicBAWChartEventReceiver bawReceiver=AnalysisUtils.createDynamicBAWChartEventReceiver(oneCategoryIndicatorModel,eventReceivers);
      bawReceiver.setChartComposite(chartComposite);
      bawReceiver.setParentChartComposite((Composite)oneCategoryIndicatorModel.getBawParentChartComp());
      bawReceiver.refreshChart();
      bawReceiver.setTableViewer(tableViewer);
    }
 else {
      int index=0;
      for (      Indicator oneIndicator : oneCategoryIndicatorModel.getIndicatorList()) {
        DynamicChartEventReceiver eReceiver=AnalysisUtils.createDynamicChartEventReceiver(oneCategoryIndicatorModel,index++,oneIndicator);
        eReceiver.setChartComposite(chartComposite);
        eReceiver.setParentChartComposite((Composite)oneCategoryIndicatorModel.getBawParentChartComp());
        eReceiver.refreshChart();
        eReceiver.setTableViewer(tableViewer);
        eReceiver.clearValue();
        registerIndicatorEvent(oneIndicator,eReceiver);
      }
    }
  }
  reLayoutChartComposite();
  registerOtherDynamicEvent();
}
Program: 136574
Project: 136574
Buggy source:
public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    String label=unit.getIndicator().getName();
    PatternMatchingExt patternExt=(PatternMatchingExt)unit.getValue();
    String notMathCount=PatternStatisticeStateUtil.getNotMatchCount(patternExt);
    String machCount=PatternStatisticeStateUtil.getMatchCount(patternExt);
    customerdataset.addValue(Double.parseDouble(notMathCount),DefaultMessagesImpl.getString("String_Node_Str"),label);
    customerdataset.addValue(Double.parseDouble(machCount),DefaultMessagesImpl.getString("String_Node_Str"),label);
    PatternChartDataEntity patternEntity=PatternStatisticeStateUtil.createDataEntity(unit,label,notMathCount,machCount);
    customerdataset.addDataEntity(patternEntity);
  }
  return customerdataset;
}

Fixed version (ground truth):
public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    String label=unit.getIndicator().getName();
    PatternMatchingExt patternExt=PatternStatisticeStateUtil.getUnitValue(unit.getIndicator(),unit.getValue());
    String notMathCount=PatternStatisticeStateUtil.getNotMatchCount(patternExt);
    String machCount=PatternStatisticeStateUtil.getMatchCount(patternExt);
    customerdataset.addValue(Double.parseDouble(notMathCount),DefaultMessagesImpl.getString("String_Node_Str"),label);
    customerdataset.addValue(Double.parseDouble(machCount),DefaultMessagesImpl.getString("String_Node_Str"),label);
    PatternChartDataEntity patternEntity=PatternStatisticeStateUtil.createDataEntity(unit,label,notMathCount,machCount);
    customerdataset.addDataEntity(patternEntity);
  }
  return customerdataset;
}
Program: 136575
Project: 136575
Buggy source:
@Override public ChartDataEntity[] getDataEntity(){
  List<ChartDataEntity> dataEnities=new ArrayList<ChartDataEntity>();
  for (  IndicatorUnit unit : units) {
    PatternMatchingExt patternExt=(PatternMatchingExt)unit.getValue();
    String notMathCount=PatternStatisticeStateUtil.getNotMatchCount(patternExt);
    String machCount=PatternStatisticeStateUtil.getMatchCount(patternExt);
    PatternChartDataEntity patternEntity=PatternStatisticeStateUtil.createDataEntity(unit,unit.getIndicator().getName(),notMathCount,machCount);
    dataEnities.add(patternEntity);
  }
  return dataEnities.toArray(new ChartDataEntity[dataEnities.size()]);
}

Fixed version (ground truth):
@Override public ChartDataEntity[] getDataEntity(){
  List<ChartDataEntity> dataEnities=new ArrayList<ChartDataEntity>();
  for (  IndicatorUnit unit : units) {
    PatternMatchingExt patternExt=PatternStatisticeStateUtil.getUnitValue(unit.getIndicator(),unit.getValue());
    String notMathCount=PatternStatisticeStateUtil.getNotMatchCount(patternExt);
    String machCount=PatternStatisticeStateUtil.getMatchCount(patternExt);
    PatternChartDataEntity patternEntity=PatternStatisticeStateUtil.createDataEntity(unit,unit.getIndicator().getName(),notMathCount,machCount);
    dataEnities.add(patternEntity);
  }
  return dataEnities.toArray(new ChartDataEntity[dataEnities.size()]);
}
Program: 136576
Project: 136576
Buggy source:
public DynamicChartEventReceiver createEventReceiver(IndicatorEnum type,Indicator oneIndicator){
  DynamicChartEventReceiver eReceiver=new DynamicChartEventReceiver(){
    @Override public boolean handle(    Object value){
      super.handle(value);
      addToSummaryMap(getIndicatorType(),value);
      if (isIntact()) {
        if (this.getTableViewer() != null) {
          String str=value == null ? String.valueOf(Double.NaN) : String.valueOf(value);
          this.refreshTable(str);
        }
      }
 else {
        updateValueOfIRQAndRange();
      }
      return true;
    }
  }
;
  eReceiver.setIndicatorType(type);
  eReceiver.setIndicatorName(oneIndicator.getName());
  indicators.add(new ColumnIndicatorUnit(type,oneIndicator,null));
  if (IndicatorEnum.IQRIndicatorEnum.equals(type)) {
    this.IRQIndicator=oneIndicator;
    this.IRQIndicatorEvent=eReceiver;
  }
 else   if (IndicatorEnum.RangeIndicatorEnum.equals(type)) {
    this.rangeIndicator=oneIndicator;
    this.rangeIndicatorEvent=eReceiver;
  }
  return eReceiver;
}

Fixed version (ground truth):
public DynamicChartEventReceiver createEventReceiver(IndicatorEnum type,Indicator oneIndicator){
  DynamicChartEventReceiver eReceiver=new DynamicChartEventReceiver(){
    @Override public boolean handle(    Object value){
      super.handle(value);
      addToSummaryMap(getIndicatorType(),value);
      if (isIntact()) {
        if (this.getTableViewer() != null) {
          String str=value == null ? String.valueOf(Double.NaN) : String.valueOf(value);
          this.refreshTable(str);
          if (isLastIndicator()) {
            updateValueOfIRQAndRange();
          }
        }
      }
 else {
        updateValueOfIRQAndRange();
      }
      return true;
    }
  }
;
  eReceiver.setIndicatorType(type);
  eReceiver.setIndicatorName(oneIndicator.getName());
  indicators.add(new ColumnIndicatorUnit(type,oneIndicator,null));
  if (IndicatorEnum.IQRIndicatorEnum.equals(type)) {
    this.IRQIndicator=oneIndicator;
    this.IRQIndicatorEvent=eReceiver;
  }
 else   if (IndicatorEnum.RangeIndicatorEnum.equals(type)) {
    this.rangeIndicator=oneIndicator;
    this.rangeIndicatorEvent=eReceiver;
  }
  return eReceiver;
}
Program: 136577
Project: 136577
Buggy source:
@Override public void refreshChart(){
  Map<IndicatorUnit,String> indicators2ValueMap=converIndicatorListToMap();
  SummaryStatisticsState state=new SummaryStatisticsState(indicators,indicators2ValueMap);
  state.setSupportDynamicChart(true);
  state.setSqltype(Types.DOUBLE);
  Object chart=state.getChart();
  TOPChartUtils.getInstance().decorateChart(chart,false);
  if (BAWparentComposite != null) {
    TOPChartUtils.getInstance().refrechChart(BAWparentComposite,chart);
  }
  EventManager.getInstance().publish(chartComposite,EventEnum.DQ_DYNAMIC_REFRESH_DYNAMIC_CHART,null);
}

Fixed version (ground truth):
@Override public void refreshChart(){
  Map<IndicatorUnit,String> indicators2ValueMap=converIndicatorListToMap();
  SummaryStatisticsState state=new SummaryStatisticsState(indicators,indicators2ValueMap);
  if (!isLastIndicator()) {
    state.setSupportDynamicChart(true);
  }
  state.setSqltype(Types.DOUBLE);
  Object chart=state.getChart();
  TOPChartUtils.getInstance().decorateChart(chart,false);
  if (BAWparentComposite != null) {
    TOPChartUtils.getInstance().refrechChart(BAWparentComposite,chart);
  }
  EventManager.getInstance().publish(chartComposite,EventEnum.DQ_DYNAMIC_REFRESH_DYNAMIC_CHART,null);
}
Program: 136578
Project: 136578
Buggy source:
@Override public boolean handle(Object value){
  Object indValue=value;
  if (value == null) {
    indValue=0;
  }
  if (dataset != null) {
    if (indValue instanceof Number) {
      TOPChartUtils.getInstance().setValue(dataset,(Number)indValue,indicatorName,indicatorName);
    }
 else     if (indValue instanceof String) {
      if (!(indicator instanceof ModeIndicator)) {
        TOPChartUtils.getInstance().setValue(dataset,Double.parseDouble((String)indValue),indicatorName,indicatorName);
      }
    }
 else     if (indValue instanceof PatternMatchingExt) {
      PatternMatchingExt patternExt=(PatternMatchingExt)indValue;
      TOPChartUtils.getInstance().setValue(dataset,patternExt.getNotMatchingValueCount(),DefaultMessagesImpl.getString("String_Node_Str"),this.indicatorName);
      TOPChartUtils.getInstance().setValue(dataset,patternExt.getMatchingValueCount(),DefaultMessagesImpl.getString("String_Node_Str"),this.indicatorName);
    }
 else {
      TOPChartUtils.getInstance().setValue(dataset,(Number)StringFormatUtil.format(indValue,StringFormatUtil.DOUBLE_NUMBER),indicatorName,indicatorName);
    }
  }
  if (tableViewer != null) {
    refreshTable(value == null ? NAN_STRING : String.valueOf(indValue));
  }
  EventManager.getInstance().publish(chartComposite,EventEnum.DQ_DYNAMIC_REFRESH_DYNAMIC_CHART,null);
  return true;
}

Fixed version (ground truth):
@Override public boolean handle(Object value){
  Object indValue=value;
  if (value == null) {
    indValue=0;
  }
  if (dataset != null) {
    settingDatasetValue(indValue);
  }
  if (tableViewer != null) {
    refreshTable(value == null ? NAN_STRING : String.valueOf(indValue));
  }
  EventManager.getInstance().publish(chartComposite,EventEnum.DQ_DYNAMIC_REFRESH_DYNAMIC_CHART,null);
  return true;
}
Program: 136579
Project: 136579
Buggy source:
public void clearValue(){
  if (dataset != null) {
    TOPChartUtils.getInstance().setValue(dataset,0.0,indicatorName,indicatorName);
  }
  if (tableViewer != null) {
    refreshTable(NAN_STRING);
  }
}

Fixed version (ground truth):
public void clearValue(){
  if (dataset != null) {
    clearDataset();
  }
  if (tableViewer != null) {
    refreshTable(NAN_STRING);
  }
}
Program: 136580
Project: 136580
Buggy source:
private void setFrequecyToDataset(Object customerdataset,FrequencyExt[] frequencyExt,Indicator indicator){
  int numOfShown=frequencyExt.length;
  IndicatorParameters parameters=indicator.getParameters();
  if (parameters != null) {
    if (parameters.getTopN() < numOfShown) {
      numOfShown=parameters.getTopN();
    }
  }
  FrequencyExt[] tempFreq=handleFrequency(frequencyExt);
  boolean withRowCountIndicator=FrequencyTypeStateUtil.isWithRowCountIndicator(indicator);
  for (int i=0; i < numOfShown; i++) {
    FrequencyExt freqExt=tempFreq[i];
    String keyLabel=String.valueOf(freqExt.getKey());
    if ("String_Node_Str".equals(keyLabel)) {
      keyLabel=SpecialValueDisplay.NULL_FIELD;
    }
    if ("String_Node_Str".equals(keyLabel)) {
      keyLabel=SpecialValueDisplay.EMPTY_FIELD;
    }
    addValueToDataset(customerdataset,freqExt,keyLabel);
    ChartDataEntity entity=FrequencyTypeStateUtil.createChartEntity(indicator,freqExt,keyLabel,withRowCountIndicator);
    if (customerdataset instanceof CustomerDefaultCategoryDataset) {
      ((CustomerDefaultCategoryDataset)customerdataset).addDataEntity(entity);
    }
  }
}

Fixed version (ground truth):
private void setFrequecyToDataset(Object customerdataset,FrequencyExt[] frequencyExt,Indicator indicator){
  int numOfShown=frequencyExt.length;
  IndicatorParameters parameters=indicator.getParameters();
  if (parameters != null) {
    if (parameters.getTopN() < numOfShown) {
      numOfShown=parameters.getTopN();
    }
  }
  FrequencyExt[] tempFreq=handleFrequency(frequencyExt);
  clearDataEntity(customerdataset);
  boolean withRowCountIndicator=FrequencyTypeStateUtil.isWithRowCountIndicator(indicator);
  for (int i=0; i < numOfShown; i++) {
    FrequencyExt freqExt=tempFreq[i];
    String keyLabel=String.valueOf(freqExt.getKey());
    if ("String_Node_Str".equals(keyLabel)) {
      keyLabel=SpecialValueDisplay.NULL_FIELD;
    }
    if ("String_Node_Str".equals(keyLabel)) {
      keyLabel=SpecialValueDisplay.EMPTY_FIELD;
    }
    ChartDataEntity entity=FrequencyTypeStateUtil.createChartEntity(indicator,freqExt,keyLabel,withRowCountIndicator);
    if (customerdataset instanceof CustomerDefaultCategoryDataset) {
      ((CustomerDefaultCategoryDataset)customerdataset).addDataEntity(entity);
      addValueToDataset(((CustomerDefaultCategoryDataset)customerdataset).getDataset(),freqExt,keyLabel);
    }
 else {
      ICustomerDataset customerDataset=TOPChartUtils.getInstance().getCustomerDataset(customerdataset);
      if (customerDataset != null && customerDataset instanceof CustomerDefaultCategoryDataset) {
        customerDataset.addDataEntity(entity);
        addValueToDataset(((CustomerDefaultCategoryDataset)customerDataset).getDataset(),freqExt,keyLabel);
      }
    }
  }
}
Program: 136581
Project: 136581
Buggy source:
/** 
 * DOC mzhao 2009-06-12 feature 5887 Comment method "removeSupplierDependenciesBetweenModels". This method removes supplier dependencies. See   {@link DependenciesHandler#removeDependenciesBetweenModels(ModelElement,List)}
 * @param elementFromRemove
 * @param elementToRemove
 * @return
 */
public List<Resource> removeSupplierDependenciesBetweenModels(ModelElement elementFromRemove,List<? extends ModelElement> elementToRemove){
  EList<Dependency> supplierDependencies;
  List<Resource> toRemoveResources=new ArrayList<Resource>();
  for (  ModelElement modelElement : elementToRemove) {
    toRemoveResources.add(modelElement.eResource());
  }
  supplierDependencies=elementFromRemove.getSupplierDependency();
  List<Resource> modifiedResources=new ArrayList<Resource>();
  for (  Dependency dependency : supplierDependencies) {
    EList<ModelElement> client=dependency.getClient();
    Iterator<ModelElement> dependencyIterator=client.iterator();
    while (dependencyIterator.hasNext()) {
      Resource clientResource=dependencyIterator.next().eResource();
      if (clientResource != null) {
        if (toRemoveResources.contains(clientResource)) {
          modifiedResources.add(clientResource);
          dependencyIterator.remove();
        }
      }
    }
  }
  return modifiedResources;
}

Fixed version (ground truth):
/** 
 * This method removes supplier dependencies. See  {@link DependenciesHandler#removeDependenciesBetweenModels(ModelElement,List)}
 * @param rule
 * @param analyses
 * @return
 */
public boolean removeSupplierDependenciesBetweenModels(ModelElement rule,List<? extends ModelElement> analyses){
  List<Resource> toRemoveResources=new ArrayList<Resource>();
  for (  ModelElement modelElement : analyses) {
    toRemoveResources.add(modelElement.eResource());
  }
  EList<Dependency> supplierDependencies=rule.getSupplierDependency();
  for (  Dependency dependency : supplierDependencies) {
    EList<ModelElement> client=dependency.getClient();
    Iterator<ModelElement> dependencyIterator=client.iterator();
    while (dependencyIterator.hasNext()) {
      Resource clientResource=dependencyIterator.next().eResource();
      if (clientResource != null) {
        if (toRemoveResources.contains(clientResource)) {
          dependencyIterator.remove();
        }
      }
    }
  }
  return true;
}
Program: 136582
Project: 136582
Buggy source:
/** 
 * DOC zshen Comment method "removeClientDependency".
 * @param client
 * @param supplier
 */
private void removeClientDependency(ModelElement client,ModelElement supplier){
  for (  Dependency dependency : client.getClientDependency()) {
    if (dependency.getKind() != null && USAGE.compareTo(dependency.getKind()) == 0) {
      EObject resolvedObject=ResourceHelper.resolveObject(dependency.getSupplier(),supplier);
      if (resolvedObject != null) {
        client.getClientDependency().remove(dependency);
        return;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "removeClientDependency".
 * @param client
 * @param supplier
 */
public void removeClientDependency(ModelElement client,ModelElement supplier){
  for (  Dependency dependency : client.getClientDependency()) {
    if (dependency.getKind() != null && USAGE.compareTo(dependency.getKind()) == 0) {
      EObject resolvedObject=ResourceHelper.resolveObject(dependency.getSupplier(),supplier);
      if (resolvedObject != null) {
        client.getClientDependency().remove(dependency);
        return;
      }
    }
  }
}
Program: 136583
Project: 136583
Buggy source:
@Override protected ReturnCode removeDependencies(Item item){
  ReturnCode rc=new ReturnCode();
  TDQAnalysisItem anaItem=(TDQAnalysisItem)item;
  Analysis analysis=anaItem.getAnalysis();
  List<Property> clintDependency=DependenciesHandler.getInstance().getClintDependency(anaItem.getProperty());
  List<ModelElement> clientDepListByResultList=getClientDepListByResult(analysis);
  for (  Property currentClient : clintDependency) {
    ModelElement modelElement=PropertyHelper.getModelElement(currentClient);
    if (!clientDepListByResultList.contains(modelElement)) {
      boolean isSuccess=DependenciesHandler.getInstance().removeDependenciesBetweenModel(analysis,modelElement);
      if (isSuccess) {
        try {
          ProxyRepositoryFactory.getInstance().getRepositoryFactoryFromProvider().getResourceManager().saveResource(modelElement.eResource());
        }
 catch (        PersistenceException e) {
          log.error(e,e);
          rc.setOk(false);
          rc.setMessage(e.getMessage());
        }
      }
 else {
        rc.setOk(false);
        rc.setMessage(Messages.getString("String_Node_Str",analysis.getName(),modelElement.getName()));
      }
    }
  }
  return rc;
}

Fixed version (ground truth):
@Override protected ReturnCode removeDependencies(Item item){
  ReturnCode rc=new ReturnCode();
  TDQAnalysisItem anaItem=(TDQAnalysisItem)item;
  Analysis analysis=anaItem.getAnalysis();
  List<Property> clintDependency=DependenciesHandler.getInstance().getClintDependency(anaItem.getProperty());
  List<ModelElement> clientDepListByResultList=DependenciesHandler.getInstance().getClientDepListByResult(analysis);
  for (  Property currentClient : clintDependency) {
    ModelElement modelElement=PropertyHelper.getModelElement(currentClient);
    if (!clientDepListByResultList.contains(modelElement)) {
      boolean isSuccess=DependenciesHandler.getInstance().removeDependenciesBetweenModel(analysis,modelElement);
      if (isSuccess) {
        try {
          ProxyRepositoryFactory.getInstance().getRepositoryFactoryFromProvider().getResourceManager().saveResource(modelElement.eResource());
        }
 catch (        PersistenceException e) {
          log.error(e,e);
          rc.setOk(false);
          rc.setMessage(e.getMessage());
        }
      }
 else {
        rc.setOk(false);
        rc.setMessage(Messages.getString("String_Node_Str",analysis.getName(),modelElement.getName()));
      }
    }
  }
  return rc;
}
Program: 136585
Project: 136585
Buggy source:
@Override public boolean handle(Object value){
  Object indValue=value;
  if (value == null) {
    indValue=0;
  }
  if (dataset != null) {
    if (indValue instanceof FrequencyExt[]) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])indValue;
      setFrequecyToDataset(dataset,frequencyExt,indicator);
    }
  }
  if (tableViewer != null) {
    TableWithData input=(TableWithData)tableViewer.getInput();
    if (input != null) {
      if (this.indicator instanceof ModeIndicator) {
        ChartDataEntity entity=new ChartDataEntity();
        entity.setIndicator(indicator);
        entity.setLabel(this.indicatorName);
        entity.setValue(String.valueOf(indValue));
        input.setEntities(new ChartDataEntity[]{entity});
      }
 else {
        ICustomerDataset customerDataset=TOPChartUtils.getInstance().getCustomerDataset(dataset);
        if (customerDataset != null) {
          input.setEntities((customerDataset).getDataEntities());
        }
 else {
          input.setEntities(((ICustomerDataset)dataset).getDataEntities());
        }
      }
    }
    if (!tableViewer.getTable().isDisposed()) {
      tableViewer.getTable().clearAll();
      tableViewer.setInput(input);
    }
  }
  if (registerChart != TOPChartUtils.getInstance().getChartFromChartComposite(parentChartComposite)) {
    restoreChart();
  }
  if (!(indicator instanceof ModeIndicator)) {
    EventManager.getInstance().publish(chartComposite,EventEnum.DQ_DYNAMIC_REFRESH_DYNAMIC_CHART,null);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean handle(Object value){
  Object indValue=value;
  if (value == null) {
    indValue=0;
  }
  if (dataset != null) {
    if (indValue instanceof FrequencyExt[]) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])indValue;
      setFrequecyToDataset(dataset,frequencyExt,indicator);
    }
  }
  if (tableViewer != null && dataset != null) {
    TableWithData input=(TableWithData)tableViewer.getInput();
    if (input != null) {
      if (this.indicator instanceof ModeIndicator) {
        ChartDataEntity entity=new ChartDataEntity();
        entity.setIndicator(indicator);
        entity.setLabel(this.indicatorName);
        entity.setValue(String.valueOf(indValue));
        input.setEntities(new ChartDataEntity[]{entity});
      }
 else {
        ICustomerDataset customerDataset=TOPChartUtils.getInstance().getCustomerDataset(dataset);
        if (customerDataset != null) {
          input.setEntities((customerDataset).getDataEntities());
        }
 else {
          input.setEntities(((ICustomerDataset)dataset).getDataEntities());
        }
      }
    }
    if (!tableViewer.getTable().isDisposed()) {
      tableViewer.getTable().clearAll();
      tableViewer.setInput(input);
    }
  }
  if (registerChart != TOPChartUtils.getInstance().getChartFromChartComposite(parentChartComposite)) {
    restoreChart();
  }
  if (!(indicator instanceof ModeIndicator)) {
    EventManager.getInstance().publish(chartComposite,EventEnum.DQ_DYNAMIC_REFRESH_DYNAMIC_CHART,null);
  }
  return true;
}
Program: 136586
Project: 136586
Buggy source:
/** 
 * @param contentProvider, use diffirent ContentProvider for Match analysis and column analysis.
 */
public ColumnAnalysisDOSelectionPage(ResourceViewContentProvider contentProvider){
  super(DefaultMessagesImpl.getString("String_Node_Str"),chooseConnStr,DefaultMessagesImpl.getString("String_Node_Str"),contentProvider,true);
  setPageComplete(true);
}

Fixed version (ground truth):
/** 
 * @param contentProvider, use diffirent ContentProvider for Match analysis and column analysis.
 */
public ColumnAnalysisDOSelectionPage(ResourceViewContentProvider contentProvider){
  super(DefaultMessagesImpl.getString("String_Node_Str"),chooseConnStr,DefaultMessagesImpl.getString("String_Node_Str"),contentProvider,true);
  setPageComplete(false);
}
Program: 136587
Project: 136587
Buggy source:
public void fireRuningItemChanged(boolean status);

Fixed version (ground truth):
public void fireRuningItemChanged(boolean status,boolean isSupportDynamicChart);
Program: 136589
Project: 136589
Buggy source:
public void fireRuningItemChanged(boolean status){
  ((AnalysisEditor)currentEditor).setRunActionButtonState(status);
  ((AnalysisEditor)currentEditor).setRefreshResultPage(status);
  if (!status) {
    switchToResultPage();
  }
}

Fixed version (ground truth):
public void fireRuningItemChanged(boolean status,boolean isSupportDynamicChart){
  ((AnalysisEditor)currentEditor).setRunActionButtonState(status);
  ((AnalysisEditor)currentEditor).setRefreshResultPage(isSupportDynamicChart);
  if (!status) {
    switchToResultPage();
  }
}
Program: 136590
Project: 136590
Buggy source:
public void fireRuningItemChanged(boolean status){
  ((AnalysisEditor)currentEditor).setRunActionButtonState(status);
  ((AnalysisEditor)currentEditor).setRefreshResultPage(status);
  IEditorPart editor=CorePlugin.getDefault().getCurrentActiveEditor();
  if (editor instanceof AnalysisEditor && status) {
    refresh(((AnalysisEditor)editor).getMasterPage());
  }
}

Fixed version (ground truth):
public void fireRuningItemChanged(boolean status,boolean isSupportDynamicChart){
  ((AnalysisEditor)currentEditor).setRunActionButtonState(status);
  ((AnalysisEditor)currentEditor).setRefreshResultPage(isSupportDynamicChart);
  IEditorPart editor=CorePlugin.getDefault().getCurrentActiveEditor();
  if (editor instanceof AnalysisEditor && status) {
    refresh(((AnalysisEditor)editor).getMasterPage());
  }
}
Program: 136591
Project: 136591
Buggy source:
/** 
 * Added TDQ-8787 20140613 yyin: create all charts before running, register each chart with its related indicator.
 */
public void registerDynamicEvent(){
  List<DynamicIndicatorModel> indiAndDatasets=uiPagination.getAllIndcatorAndDatasetOfCurrentPage();
  for (  DynamicIndicatorModel oneCategoryIndicatorModel : indiAndDatasets) {
    TableViewer tableViewer=oneCategoryIndicatorModel.getTableViewer();
    if (EIndicatorChartType.SUMMARY_STATISTICS.equals(oneCategoryIndicatorModel.getChartType())) {
      DynamicBAWChartEventReceiver bawReceiver=AnalysisUtils.createDynamicBAWChartEventReceiver(oneCategoryIndicatorModel,eventReceivers);
      bawReceiver.setChartComposite(chartComposite);
      bawReceiver.setTableViewer(tableViewer);
    }
 else {
      int index=0;
      for (      Indicator oneIndicator : oneCategoryIndicatorModel.getIndicatorList()) {
        DynamicChartEventReceiver eReceiver=AnalysisUtils.createDynamicChartEventReceiver(oneCategoryIndicatorModel,index++,oneIndicator);
        eReceiver.setChartComposite(chartComposite);
        eReceiver.setTableViewer(tableViewer);
        eReceiver.clearValue();
        registerIndicatorEvent(oneIndicator,eReceiver);
      }
    }
  }
  reLayoutChartComposite();
  registerOtherDynamicEvent();
}

Fixed version (ground truth):
/** 
 * Added TDQ-8787 20140613 yyin: create all charts before running, register each chart with its related indicator.
 */
public void registerDynamicEvent(){
  List<DynamicIndicatorModel> indiAndDatasets=uiPagination.getAllIndcatorAndDatasetOfCurrentPage();
  for (  DynamicIndicatorModel oneCategoryIndicatorModel : indiAndDatasets) {
    TableViewer tableViewer=oneCategoryIndicatorModel.getTableViewer();
    if (EIndicatorChartType.SUMMARY_STATISTICS.equals(oneCategoryIndicatorModel.getChartType())) {
      DynamicBAWChartEventReceiver bawReceiver=AnalysisUtils.createDynamicBAWChartEventReceiver(oneCategoryIndicatorModel,eventReceivers);
      bawReceiver.setChartComposite(chartComposite);
      bawReceiver.refreshChart();
      bawReceiver.setTableViewer(tableViewer);
    }
 else {
      int index=0;
      for (      Indicator oneIndicator : oneCategoryIndicatorModel.getIndicatorList()) {
        DynamicChartEventReceiver eReceiver=AnalysisUtils.createDynamicChartEventReceiver(oneCategoryIndicatorModel,index++,oneIndicator);
        eReceiver.setChartComposite(chartComposite);
        eReceiver.setParentChartComposite((Composite)oneCategoryIndicatorModel.getBawParentChartComp());
        eReceiver.refreshChart();
        eReceiver.setTableViewer(tableViewer);
        eReceiver.clearValue();
        registerIndicatorEvent(oneIndicator,eReceiver);
      }
    }
  }
  reLayoutChartComposite();
  registerOtherDynamicEvent();
}
Program: 136593
Project: 136593
Buggy source:
public CustomerDefaultBAWDataset(Double mean,Double median,Double q1,Double q3,Double minRegularValue,Double maxRegularValue){
  dataEnities=new ArrayList<ChartDataEntity>();
  bawDataset=TOPChartUtils.getInstance().createDefaultBoxAndWhiskerCategoryDataset(mean,median,q1,q3,minRegularValue,maxRegularValue);
}

Fixed version (ground truth):
/** 
 * DOC zshen CustomerDefaultBAWDataset constructor comment.
 * @param mean
 * @param median
 * @param q1
 * @param q3
 * @param minRegularValue
 * @param maxRegularValue
 * @param defaultCategoryDataset should be DefaultCategoryDataset type
 */
public CustomerDefaultBAWDataset(Double mean,Double median,Double q1,Double q3,Double minRegularValue,Double maxRegularValue,Object defaultCategoryDataset){
  this(mean,median,q1,q3,minRegularValue,maxRegularValue);
  this.defaultCategoryDataset=defaultCategoryDataset;
}
Program: 136594
Project: 136594
Buggy source:
public ICustomerDataset getCustomerDataset(){
  Map<IndicatorEnum,Double> map=new HashMap<IndicatorEnum,Double>();
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    String value=summaryUtil.getUnitValue(unit);
    if (Java2SqlType.isNumbericInSQL(sqltype)) {
      try {
        map.put(unit.getType(),Double.parseDouble(value));
      }
 catch (      Exception e) {
        log.error(e.getMessage(),e);
      }
    }
    ChartDataEntity entity=summaryUtil.createDataEntity(unit,value);
    customerdataset.addDataEntity(entity);
  }
  if (isIntact()) {
    CustomerDefaultBAWDataset dataset=new CustomerDefaultBAWDataset(map.get(IndicatorEnum.MeanIndicatorEnum),map.get(IndicatorEnum.MedianIndicatorEnum),map.get(IndicatorEnum.LowerQuartileIndicatorEnum),map.get(IndicatorEnum.UpperQuartileIndicatorEnum),map.get(IndicatorEnum.MinValueIndicatorEnum),map.get(IndicatorEnum.MaxValueIndicatorEnum));
    dataset.addDataEntity(customerdataset.getDataEntities());
    return dataset;
  }
 else {
    map.remove(IndicatorEnum.RangeIndicatorEnum);
    map.remove(IndicatorEnum.IQRIndicatorEnum);
    for (    IndicatorEnum indicatorEnum : map.keySet()) {
      customerdataset.addValue(map.get(indicatorEnum),indicatorEnum.getLabel(),indicatorEnum.getLabel());
    }
    return customerdataset;
  }
}

Fixed version (ground truth):
public ICustomerDataset getCustomerDataset(){
  Map<IndicatorEnum,Double> map=new HashMap<IndicatorEnum,Double>();
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    String value=null;
    if (indicators2ValueMap.containsKey(unit)) {
      value=indicators2ValueMap.get(unit);
    }
 else {
      value=summaryUtil.getUnitValue(unit);
    }
    if (Java2SqlType.isNumbericInSQL(sqltype)) {
      try {
        map.put(unit.getType(),Double.parseDouble(value));
      }
 catch (      Exception e) {
        log.error(e.getMessage(),e);
      }
    }
    ChartDataEntity entity=summaryUtil.createDataEntity(unit,value);
    customerdataset.addDataEntity(entity);
  }
  if (isIntact() && !isSupportDynamicChart) {
    CustomerDefaultBAWDataset dataset=new CustomerDefaultBAWDataset(map.get(IndicatorEnum.MeanIndicatorEnum),map.get(IndicatorEnum.MedianIndicatorEnum),map.get(IndicatorEnum.LowerQuartileIndicatorEnum),map.get(IndicatorEnum.UpperQuartileIndicatorEnum),map.get(IndicatorEnum.MinValueIndicatorEnum),map.get(IndicatorEnum.MaxValueIndicatorEnum),customerdataset);
    dataset.addDataEntity(customerdataset.getDataEntities());
    return dataset;
  }
 else {
    if (!isIntact()) {
      map.remove(IndicatorEnum.RangeIndicatorEnum);
      map.remove(IndicatorEnum.IQRIndicatorEnum);
    }
    for (    IndicatorEnum indicatorEnum : map.keySet()) {
      customerdataset.addValue(map.get(indicatorEnum),indicatorEnum.getLabel(),indicatorEnum.getLabel());
    }
    return customerdataset;
  }
}
Program: 136595
Project: 136595
Buggy source:
public SummaryStatisticsState(List<IndicatorUnit> units){
  summaryUtil=new SummaryStatisticsStateUtil();
  if (units != null) {
    this.units.addAll(summaryUtil.check(units));
  }
  sqltype=summaryUtil.findSqlType(units);
}

Fixed version (ground truth):
public SummaryStatisticsState(List<IndicatorUnit> units,Map<IndicatorUnit,String> indicators2ValueMap){
  this(units);
  this.indicators2ValueMap=indicators2ValueMap;
}
Program: 136596
Project: 136596
Buggy source:
/** 
 * DOC yyin Comment method "createChart".
 * @param dataset
 * @return
 */
private Object createChart(Object dataset){
  String categoryAxisLabel=DefaultMessagesImpl.getString("String_Node_Str");
  String axisXLabel=DefaultMessagesImpl.getString("String_Node_Str");
  return TOPChartUtils.getInstance().createBenfordChart(axisXLabel,categoryAxisLabel,dataset,dotChartLabels,formalValues,axisXLabel);
}

Fixed version (ground truth):
/** 
 * DOC yyin Comment method "createChart".
 * @param dataset
 * @return
 */
private Object createChart(Object dataset){
  String categoryAxisLabel=DefaultMessagesImpl.getString("String_Node_Str");
  String axisXLabel=DefaultMessagesImpl.getString("String_Node_Str");
  return TOPChartUtils.getInstance().createBenfordChartByKCD(axisXLabel,categoryAxisLabel,dataset,dotChartLabels,formalValues,axisXLabel);
}
Program: 136597
Project: 136597
Buggy source:
public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  boolean withRowCountIndicator=isWithRowCountIndicator();
  for (  IndicatorUnit unit : units) {
    if (unit.isExcuted()) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])unit.getValue();
      sortIndicator(frequencyExt);
      int numOfShown=FrequencyTypeStateUtil.getNumberOfShown(unit,frequencyExt);
      for (int i=0; i < numOfShown; i++) {
        FrequencyExt freqExt=frequencyExt[i];
        String keyLabel=FrequencyTypeStateUtil.getKeyLabel(freqExt);
        setValueToDataset(customerdataset,freqExt,keyLabel);
        ChartDataEntity entity=FrequencyTypeStateUtil.createChartEntity(unit.getIndicator(),freqExt,keyLabel,withRowCountIndicator);
        customerdataset.addDataEntity(entity);
      }
    }
 else {
      ChartDataEntity entity=FrequencyTypeStateUtil.createChartEntity(unit.getIndicator(),null,SpecialValueDisplay.EMPTY_FIELD,false);
      FrequencyExt fre=new FrequencyExt();
      fre.setValue(0l);
      fre.setFrequency(0d);
      setValueToDataset(customerdataset,fre,unit.getIndicatorName());
      customerdataset.addDataEntity(entity);
    }
  }
  return customerdataset;
}

Fixed version (ground truth):
public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  boolean withRowCountIndicator=isWithRowCountIndicator();
  for (  IndicatorUnit unit : units) {
    if (unit.isExcuted() && !this.isSupportDynamicChart) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])unit.getValue();
      sortIndicator(frequencyExt);
      int numOfShown=FrequencyTypeStateUtil.getNumberOfShown(unit,frequencyExt);
      for (int i=0; i < numOfShown; i++) {
        FrequencyExt freqExt=frequencyExt[i];
        String keyLabel=FrequencyTypeStateUtil.getKeyLabel(freqExt);
        setValueToDataset(customerdataset,freqExt,keyLabel);
        ChartDataEntity entity=FrequencyTypeStateUtil.createChartEntity(unit.getIndicator(),freqExt,keyLabel,withRowCountIndicator);
        customerdataset.addDataEntity(entity);
      }
    }
 else {
      ChartDataEntity entity=FrequencyTypeStateUtil.createChartEntity(unit.getIndicator(),null,SpecialValueDisplay.EMPTY_FIELD,false);
      FrequencyExt fre=new FrequencyExt();
      fre.setValue(0l);
      fre.setFrequency(0d);
      setValueToDataset(customerdataset,fre,unit.getIndicatorName());
      customerdataset.addDataEntity(entity);
    }
  }
  return customerdataset;
}
Program: 136598
Project: 136598
Buggy source:
@Override public Object getChart(Object dataset){
  return TOPChartUtils.getInstance().createBarChart(DefaultMessagesImpl.getString("String_Node_Str"),dataset);
}

Fixed version (ground truth):
@Override public Object getChart(Object dataset){
  return TOPChartUtils.getInstance().createBarChartByKCD(DefaultMessagesImpl.getString("String_Node_Str"),dataset);
}
Program: 136599
Project: 136599
Buggy source:
public DynamicChartEventReceiver createEventReceiver(IndicatorEnum type,Indicator oneIndicator){
  DynamicChartEventReceiver eReceiver=new DynamicChartEventReceiver(){
    @Override public boolean handle(    Object value){
      if (isIntact()) {
        addToSummaryMap(getIndicatorType(),value);
        if (this.getTableViewer() != null) {
          String str=value == null ? String.valueOf(Double.NaN) : String.valueOf(value);
          this.refreshTable(str);
        }
      }
 else {
        super.handle(value);
        updateValueOfIRQAndRange();
      }
      return true;
    }
  }
;
  eReceiver.setIndicatorType(type);
  eReceiver.setIndicatorName(oneIndicator.getName());
  indicators.add(new ColumnIndicatorUnit(type,oneIndicator,null));
  if (IndicatorEnum.IQRIndicatorEnum.equals(type)) {
    this.IRQIndicator=oneIndicator;
    this.IRQIndicatorEvent=eReceiver;
  }
 else   if (IndicatorEnum.RangeIndicatorEnum.equals(type)) {
    this.rangeIndicator=oneIndicator;
    this.rangeIndicatorEvent=eReceiver;
  }
  return eReceiver;
}

Fixed version (ground truth):
public DynamicChartEventReceiver createEventReceiver(IndicatorEnum type,Indicator oneIndicator){
  DynamicChartEventReceiver eReceiver=new DynamicChartEventReceiver(){
    @Override public boolean handle(    Object value){
      super.handle(value);
      addToSummaryMap(getIndicatorType(),value);
      if (isIntact()) {
        if (this.getTableViewer() != null) {
          String str=value == null ? String.valueOf(Double.NaN) : String.valueOf(value);
          this.refreshTable(str);
        }
      }
 else {
        updateValueOfIRQAndRange();
      }
      return true;
    }
  }
;
  eReceiver.setIndicatorType(type);
  eReceiver.setIndicatorName(oneIndicator.getName());
  indicators.add(new ColumnIndicatorUnit(type,oneIndicator,null));
  if (IndicatorEnum.IQRIndicatorEnum.equals(type)) {
    this.IRQIndicator=oneIndicator;
    this.IRQIndicatorEvent=eReceiver;
  }
 else   if (IndicatorEnum.RangeIndicatorEnum.equals(type)) {
    this.rangeIndicator=oneIndicator;
    this.rangeIndicatorEvent=eReceiver;
  }
  return eReceiver;
}
Program: 136600
Project: 136600
Buggy source:
private void refreshChart(){
  if (isIntact()) {
    updateValueOfIRQAndRange();
  }
 else {
    if (summaryValues.size() == SummaryStatisticsState.FULL_CHART) {
      SummaryStatisticsState state=new SummaryStatisticsState(indicators);
      state.setSqltype(Types.DOUBLE);
      Object chart=state.getChart();
      TOPChartUtils.getInstance().decorateChart(chart,false);
      if (BAWparentComposite != null) {
        TOPChartUtils.getInstance().refrechChart(BAWparentComposite,chart);
      }
      EventManager.getInstance().publish(chartComposite,EventEnum.DQ_DYNAMIC_REFRESH_DYNAMIC_CHART,null);
      updateValueOfIRQAndRange();
      summaryValues.clear();
      indicators.clear();
    }
  }
}

Fixed version (ground truth):
@Override public void refreshChart(){
  Map<IndicatorUnit,String> indicators2ValueMap=converIndicatorListToMap();
  SummaryStatisticsState state=new SummaryStatisticsState(indicators,indicators2ValueMap);
  state.setSupportDynamicChart(true);
  state.setSqltype(Types.DOUBLE);
  Object chart=state.getChart();
  TOPChartUtils.getInstance().decorateChart(chart,false);
  if (BAWparentComposite != null) {
    TOPChartUtils.getInstance().refrechChart(BAWparentComposite,chart);
  }
  EventManager.getInstance().publish(chartComposite,EventEnum.DQ_DYNAMIC_REFRESH_DYNAMIC_CHART,null);
}