nus-yam/ex-repair huggingface dataset:
Program: 71200
Project: 71200
Buggy source:
/** 
 * Get the evaluated result by the ScriptExpression
 * @param aggrIndex
 * @param aggrInfo
 * @param i
 * @throws DataException
 */
private void evaluateArgsValue(int aggrIndex,IAggrInfo aggrInfo,int i,boolean isOptional) throws DataException {
  if (i >= aggrInfo.getArgument().length) {
    return;
  }
  IBaseExpression argExpr=aggrInfo.getArgument()[i];
  if (!isOptional) {
    checkExpression(aggrInfo,argExpr);
  }
 else   if (argExpr == null || ((IScriptExpression)argExpr).getText() == null || ((IScriptExpression)argExpr).getText().trim().length() == 0) {
    aggrArgs[aggrIndex][i]=null;
    return;
  }
  try {
    aggrArgs[aggrIndex][i]=ExprEvaluateUtil.evaluateValue(argExpr,this.populator.getCache().getCurrentIndex(),this.populator.getCache().getCurrentResult(),this.populator.getQuery().getExprProcessor().getScope(),this.populator.getSession().getEngineContext().getScriptContext());
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}

Fixed version (ground truth):
/** 
 * Get the evaluated result by the ScriptExpression
 * @param aggrIndex
 * @param aggrInfo
 * @param i
 * @throws DataException
 */
private void evaluateArgsValue(int aggrIndex,IAggrInfo aggrInfo,int i,IParameterDefn paramDefn) throws DataException {
  if (i >= aggrInfo.getArgument().length) {
    return;
  }
  IBaseExpression argExpr=aggrInfo.getArgument()[i];
  if (!paramDefn.isOptional()) {
    if (!isFunctionCount(aggrInfo) && isEmptyScriptExpression(argExpr)) {
      throw new DataException(ResourceConstants.AGGREGATION_ARGUMENT_CANNOT_BE_BLANK,new Object[]{paramDefn.getName(),aggrInfo.getName()});
    }
  }
 else   if (argExpr == null || ((IScriptExpression)argExpr).getText() == null || ((IScriptExpression)argExpr).getText().trim().length() == 0) {
    aggrArgs[aggrIndex][i]=null;
    return;
  }
  try {
    aggrArgs[aggrIndex][i]=ExprEvaluateUtil.evaluateValue(argExpr,this.populator.getCache().getCurrentIndex(),this.populator.getCache().getCurrentResult(),this.populator.getQuery().getExprProcessor().getScope(),this.populator.getSession().getEngineContext().getScriptContext());
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}
Program: 71202
Project: 71202
Buggy source:
public Object visitListItem(ListItemDesign list,Object value){
  IDataQueryDefinition query;
  if (list.useCachedResult()) {
    query=getRefenceQuery(list);
    if (query == null) {
      registerUnresolvedQueryReference(list);
      return null;
    }
  }
 else {
    query=createQuery(list,(IDataQueryDefinition)value);
  }
  BaseQueryDefinition baseQuery=(BaseQueryDefinition)query;
  if (query == null) {
    handleListingBand(list.getHeader(),baseQuery,true,null);
    handleListingBand(list.getFooter(),baseQuery,true,null);
  }
 else {
    handleListingQuery(list,baseQuery);
    handleListingBand(list.getHeader(),baseQuery,true,null);
    SlotHandle groupsSlot=((ListHandle)list.getHandle()).getGroups();
    for (int i=0; i < list.getGroupCount(); i++) {
      handleListingGroup(list.getGroup(i),(GroupHandle)groupsSlot.get(i),query);
    }
    BandDesign detail=list.getDetail();
    if (!baseQuery.cacheQueryResults()) {
      if (detail == null || detail.getContentCount() == 0) {
        baseQuery.setUsesDetails(false);
      }
    }
    handleListingBand(detail,baseQuery,false,null);
    handleListingBand(list.getFooter(),baseQuery,true,null);
  }
  try {
    transformExpressions(list,baseQuery);
  }
 catch (  BirtException ex) {
    context.addException(list.getHandle(),ex);
  }
  return getResultQuery(query,value);
}

Fixed version (ground truth):
public Object visitListItem(ListItemDesign list,Object value){
  IDataQueryDefinition query;
  if (list.useCachedResult()) {
    query=getRefenceQuery(list);
    if (query == null) {
      registerUnresolvedQueryReference(list);
      return null;
    }
  }
 else {
    query=createQuery(list,(IDataQueryDefinition)value);
  }
  BaseQueryDefinition baseQuery=(BaseQueryDefinition)query;
  if (query == null) {
    handleListingBand(list.getHeader(),baseQuery,true,null);
    handleListingBand(list.getFooter(),baseQuery,true,null);
  }
 else {
    handleListingQuery(list,baseQuery);
    handleListingBand(list.getHeader(),baseQuery,true,null);
    SlotHandle groupsSlot=((ListHandle)list.getHandle()).getGroups();
    for (int i=0; i < list.getGroupCount(); i++) {
      handleListingGroup(list.getGroup(i),(GroupHandle)groupsSlot.get(i),query);
    }
    BandDesign detail=list.getDetail();
    setUsesDetails(detail,baseQuery);
    handleListingBand(detail,baseQuery,false,null);
    handleListingBand(list.getFooter(),baseQuery,true,null);
  }
  try {
    transformExpressions(list,baseQuery);
  }
 catch (  BirtException ex) {
    context.addException(list.getHandle(),ex);
  }
  return getResultQuery(query,value);
}
Program: 71203
Project: 71203
Buggy source:
public Object visitTableItem(TableItemDesign table,Object value){
  IDataQueryDefinition query;
  if (table.useCachedResult()) {
    query=getRefenceQuery(table);
    if (query == null) {
      registerUnresolvedQueryReference(table);
      return null;
    }
  }
 else {
    query=createQuery(table,(IDataQueryDefinition)value);
  }
  BaseQueryDefinition baseQuery=(BaseQueryDefinition)query;
  if (query == null) {
    handleListingBand(table.getHeader(),baseQuery,true,null);
    handleListingBand(table.getFooter(),baseQuery,true,null);
  }
 else {
    handleListingQuery(table,baseQuery);
    for (int i=0; i < table.getColumnCount(); i++) {
      handleColumn(table.getColumn(i),query);
    }
    handleListingBand(table.getHeader(),baseQuery,true,null);
    SlotHandle groupsSlot=((TableHandle)table.getHandle()).getGroups();
    for (int i=0; i < table.getGroupCount(); i++) {
      handleListingGroup(table.getGroup(i),(GroupHandle)groupsSlot.get(i),baseQuery);
    }
    BandDesign detail=table.getDetail();
    if (!baseQuery.cacheQueryResults()) {
      if (detail == null || detail.getContentCount() == 0) {
        baseQuery.setUsesDetails(false);
      }
    }
    handleListingBand(detail,baseQuery,false,null);
    handleListingBand(table.getFooter(),baseQuery,true,null);
  }
  try {
    transformExpressions(table,baseQuery);
  }
 catch (  BirtException ex) {
    context.addException(table.getHandle(),ex);
  }
  return getResultQuery(query,value);
}

Fixed version (ground truth):
public Object visitTableItem(TableItemDesign table,Object value){
  IDataQueryDefinition query;
  if (table.useCachedResult()) {
    query=getRefenceQuery(table);
    if (query == null) {
      registerUnresolvedQueryReference(table);
      return null;
    }
  }
 else {
    query=createQuery(table,(IDataQueryDefinition)value);
  }
  BaseQueryDefinition baseQuery=(BaseQueryDefinition)query;
  if (query == null) {
    handleListingBand(table.getHeader(),baseQuery,true,null);
    handleListingBand(table.getFooter(),baseQuery,true,null);
  }
 else {
    handleListingQuery(table,baseQuery);
    for (int i=0; i < table.getColumnCount(); i++) {
      handleColumn(table.getColumn(i),query);
    }
    handleListingBand(table.getHeader(),baseQuery,true,null);
    SlotHandle groupsSlot=((TableHandle)table.getHandle()).getGroups();
    for (int i=0; i < table.getGroupCount(); i++) {
      handleListingGroup(table.getGroup(i),(GroupHandle)groupsSlot.get(i),baseQuery);
    }
    BandDesign detail=table.getDetail();
    setUsesDetails(detail,baseQuery);
    handleListingBand(detail,baseQuery,false,null);
    handleListingBand(table.getFooter(),baseQuery,true,null);
  }
  try {
    transformExpressions(table,baseQuery);
  }
 catch (  BirtException ex) {
    context.addException(table.getHandle(),ex);
  }
  return getResultQuery(query,value);
}
Program: 71205
Project: 71205
Buggy source:
/** 
 * Computes min, max value, step size and step number of the Axis
 * @param oMinValue min value in data points. Double or CDateTime type.
 * @param oMaxValue max value in data points. Double or CDateTime type.
 */
public final void updateAxisMinMax(Object oMinValue,Object oMaxValue){
  if (rtc.getSharedScale() != null && rtc.getSharedScale().isShared()) {
    updateContext(rtc.getSharedScale().getScaleContext());
    return;
  }
  ScaleContext sct;
  if ((iType & LOGARITHMIC) == LOGARITHMIC) {
    if ((iType & PERCENT) == PERCENT) {
      oMaximum=new Double(100);
      oMinimum=new Double(1);
      setStep(new Double(10));
      bMaximumFixed=true;
      bMinimumFixed=true;
      bStepFixed=true;
      return;
    }
    sct=new ScaleContext(iMarginPercent,iType,oMinValue,oMaxValue,oStep);
  }
 else   if ((iType & DATE_TIME) == DATE_TIME) {
    int iUnit=asInteger(oUnit);
    sct=new ScaleContext(iMarginPercent,iType,iUnit,oMinValue,oMaxValue,oStep);
  }
 else {
    sct=new ScaleContext(iMarginPercent,iType,oMinValue,oMaxValue,oStep);
  }
  if ((iType & DATE_TIME) == DATE_TIME) {
    sct.setFixedValue(bMinimumFixed,bMaximumFixed,oMinimumFixed,oMaximumFixed);
  }
 else {
    sct.setFixedValue(bMinimumFixed,bMaximumFixed,oMinimum,oMaximum);
  }
  sct.setExpandMinmax(bExpandMinMax);
  sct.setFixedStep(bStepFixed,oStepNumber);
  sct.computeMinMax();
  updateContext(sct);
  tmpSC=sct;
  updateSharedScaleContext(rtc,iType,tmpSC);
}

Fixed version (ground truth):
/** 
 * Computes min, max value, step size and step number of the Axis
 * @param oMinValue min value in data points. Double or CDateTime type.
 * @param oMaxValue max value in data points. Double or CDateTime type.
 */
public final void updateAxisMinMax(Object oMinValue,Object oMaxValue){
  if (rtc.getSharedScale() != null && rtc.getSharedScale().isShared()) {
    updateContext(rtc.getSharedScale().getScaleContext());
    return;
  }
  ScaleContext sct;
  if ((iType & LOGARITHMIC) == LOGARITHMIC) {
    if ((iType & PERCENT) == PERCENT) {
      oMaximum=new Double(100);
      oMinimum=new Double(1);
      setStep(new Double(10));
      bMaximumFixed=true;
      bMinimumFixed=true;
      bStepFixed=true;
      return;
    }
    sct=new ScaleContext(iMarginPercent,iType,oMinValue,oMaxValue,oStep);
  }
 else   if ((iType & DATE_TIME) == DATE_TIME) {
    int iUnit=asInteger(oUnit);
    sct=new ScaleContext(iMarginPercent,iType,iUnit,oMinValue,oMaxValue,oStep);
  }
 else {
    sct=new ScaleContext(iMarginPercent,iType,oMinValue,oMaxValue,oStep);
  }
  if ((iType & DATE_TIME) == DATE_TIME) {
    sct.setFixedValue(bMinimumFixed,bMaximumFixed,oMinimumFixed,oMaximumFixed);
  }
 else {
    sct.setFixedValue(bMinimumFixed,bMaximumFixed,oMinimum,oMaximum);
  }
  sct.setExpandMinmax(bExpandMinMax);
  sct.setFixedStep(bStepFixed,oStepNumber);
  sct.computeMinMax(bAlignZero);
  updateContext(sct);
  tmpSC=sct;
  updateSharedScaleContext(rtc,iType,tmpSC);
}
Program: 71206
Project: 71206
Buggy source:
public final Object clone(){
  final AutoScale sc=new AutoScale(iType,oMinimum,oMaximum);
  sc.oStep=oStep;
  sc.oStepNumber=this.oStepNumber;
  sc.dStart=dStart;
  sc.dEnd=dEnd;
  sc.oMaximumWithMargin=oMaximumWithMargin;
  sc.oMinimumWithMargin=oMinimumWithMargin;
  sc.iMarginPercent=iMarginPercent;
  sc.atcTickCoordinates=atcTickCoordinates;
  sc.dStartShift=dStartShift;
  sc.dEndShift=dEndShift;
  sc.dsiData=dsiData;
  sc.oUnit=oUnit;
  sc.bMaximumFixed=bMaximumFixed;
  sc.bMinimumFixed=bMinimumFixed;
  sc.bStepFixed=bStepFixed;
  sc.fs=fs;
  sc.rtc=rtc;
  sc.bIntegralZoom=bIntegralZoom;
  sc.bCategoryScale=bCategoryScale;
  sc.labelVisHelper=labelVisHelper;
  sc.iScaleDirection=iScaleDirection;
  sc.staggeredHelper=staggeredHelper;
  sc.bAxisLabelStaggered=bAxisLabelStaggered;
  sc.iLabelShowingInterval=iLabelShowingInterval;
  sc.bTickBetweenCategories=bTickBetweenCategories;
  sc.bLabelWithinAxes=bLabelWithinAxes;
  sc.iMinUnit=iMinUnit;
  sc.hmComputedLabelText=sc.hmComputedLabelText;
  sc.tmpSC=tmpSC;
  sc.bExpandMinMax=bExpandMinMax;
  return sc;
}

Fixed version (ground truth):
public final Object clone(){
  final AutoScale sc=new AutoScale(iType,oMinimum,oMaximum);
  sc.oStep=oStep;
  sc.oStepNumber=this.oStepNumber;
  sc.dStart=dStart;
  sc.dEnd=dEnd;
  sc.oMaximumWithMargin=oMaximumWithMargin;
  sc.oMinimumWithMargin=oMinimumWithMargin;
  sc.iMarginPercent=iMarginPercent;
  sc.atcTickCoordinates=atcTickCoordinates;
  sc.dStartShift=dStartShift;
  sc.dEndShift=dEndShift;
  sc.dsiData=dsiData;
  sc.oUnit=oUnit;
  sc.bMaximumFixed=bMaximumFixed;
  sc.bMinimumFixed=bMinimumFixed;
  sc.bStepFixed=bStepFixed;
  sc.fs=fs;
  sc.rtc=rtc;
  sc.bIntegralZoom=bIntegralZoom;
  sc.bCategoryScale=bCategoryScale;
  sc.labelVisHelper=labelVisHelper;
  sc.iScaleDirection=iScaleDirection;
  sc.staggeredHelper=staggeredHelper;
  sc.bAxisLabelStaggered=bAxisLabelStaggered;
  sc.iLabelShowingInterval=iLabelShowingInterval;
  sc.bTickBetweenCategories=bTickBetweenCategories;
  sc.bLabelWithinAxes=bLabelWithinAxes;
  sc.iMinUnit=iMinUnit;
  sc.hmComputedLabelText=sc.hmComputedLabelText;
  sc.tmpSC=tmpSC;
  sc.bExpandMinMax=bExpandMinMax;
  sc.bAlignZero=bAlignZero;
  return sc;
}
Program: 71207
Project: 71207
Buggy source:
public void computeMinMax(){
  if ((iType & LINEAR) == LINEAR) {
    computeLinearMinMax();
  }
 else   if ((iType & DATE_TIME) == DATE_TIME) {
    computeDateTimeMinMax();
  }
 else   if ((iType & LOGARITHMIC) == LOGARITHMIC) {
    computeLogMinMax();
  }
}

Fixed version (ground truth):
public void computeMinMax(boolean bAlignZero){
  if ((iType & LINEAR) == LINEAR) {
    computeLinearMinMax(bAlignZero);
  }
 else   if ((iType & DATE_TIME) == DATE_TIME) {
    computeDateTimeMinMax();
  }
 else   if ((iType & LOGARITHMIC) == LOGARITHMIC) {
    computeLogMinMax();
  }
}
Program: 71209
Project: 71209
Buggy source:
/** 
 * @param queryType
 * @param query
 * @param expr
 * @param seriesDefinition
 * @since 2.5
 */
protected void manageColorAndQuery(String queryType,Query query,String expr,SeriesDefinition seriesDefinition){
  if (DataDefinitionTextManager.getInstance().getNumberOfSameDataDefinition(query.getDefinition()) == 0) {
    ColorPalette.getInstance().retrieveColor(query.getDefinition());
  }
  updateQuery(queryType,query,expr,seriesDefinition);
  DataDefinitionTextManager.getInstance().updateText(query);
  refreshTableColor();
  DataDefinitionTextManager.getInstance().refreshAll();
}

Fixed version (ground truth):
/** 
 * @param queryType
 * @param query
 * @param expr
 * @param seriesDefinition
 * @since 2.5
 */
protected void manageColorAndQuery(String queryType,Query query,String expr,SeriesDefinition seriesDefinition){
  if (dataProvider.getNumberOfSameDataDefinition(query.getDefinition()) == 1) {
    ColorPalette.getInstance().retrieveColor(query.getDefinition());
  }
  updateQuery(queryType,query,expr,seriesDefinition);
  ColorPalette.getInstance().putColor(expr);
  DataDefinitionTextManager.getInstance().updateText(query);
  refreshTableColor();
  DataDefinitionTextManager.getInstance().refreshAll();
}
Program: 71211
Project: 71211
Buggy source:
private void cleanDataDefinition(SeriesDefinition sd){
  EList dds=sd.getDesignTimeSeries().getDataDefinition();
  for (int i=0; i < dds.size(); i++) {
    ((Query)dds.get(i)).setDefinition("String_Node_Str");
  }
}

Fixed version (ground truth):
private void cleanDataDefinition(SeriesDefinition sd){
  EList<Query> dds=sd.getDesignTimeSeries().getDataDefinition();
  for (int i=0; i < dds.size(); i++) {
    dds.get(i).setDefinition("String_Node_Str");
  }
}
Program: 71212
Project: 71212
Buggy source:
/** 
 * Updates the color registry and refresh all background color of the text field
 * @param seriesIndex -1 means all series under selected axis
 */
private void updateColorRegistry(int seriesIndex){
  List dataDefinitions=null;
  if (seriesIndex > -1) {
    dataDefinitions=((SeriesDefinition)seriesDefns.get(seriesIndex)).getDesignTimeSeries().getDataDefinition();
  }
 else {
    List allSeriesDefns=ChartUIUtil.getAllOrthogonalSeriesDefinitions(getChart());
    dataDefinitions=new ArrayList();
    for (int i=0; i < allSeriesDefns.size(); i++) {
      dataDefinitions.addAll(((SeriesDefinition)allSeriesDefns.get(i)).getDesignTimeSeries().getDataDefinition());
    }
  }
  Map queryMap=new HashMap();
  for (int i=0; i < dataDefinitions.size(); i++) {
    String expression=((Query)dataDefinitions.get(i)).getDefinition();
    if (queryMap.containsKey(expression)) {
      int expCount=((Integer)queryMap.get(expression)).intValue();
      queryMap.put(expression,new Integer(expCount++));
    }
 else {
      queryMap.put(expression,new Integer(1));
    }
  }
  for (Iterator iterator=queryMap.keySet().iterator(); iterator.hasNext(); ) {
    String expression=(String)iterator.next();
    if (DataDefinitionTextManager.getInstance().getNumberOfSameDataDefinition(expression) == ((Integer)queryMap.get(expression)).intValue()) {
      ColorPalette.getInstance().retrieveColor(expression);
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates the color registry and refresh all background color of the text field
 * @param seriesIndex -1 means all series under selected axis
 */
private void updateColorRegistry(int seriesIndex){
  List<Query> dataDefinitions=null;
  if (seriesIndex > -1) {
    dataDefinitions=seriesDefns.get(seriesIndex).getDesignTimeSeries().getDataDefinition();
  }
 else {
    List<SeriesDefinition> allSeriesDefns=ChartUIUtil.getAllOrthogonalSeriesDefinitions(getChart());
    dataDefinitions=new ArrayList<Query>();
    for (int i=0; i < allSeriesDefns.size(); i++) {
      dataDefinitions.addAll(allSeriesDefns.get(i).getDesignTimeSeries().getDataDefinition());
    }
  }
  Map<String,Integer> queryMap=new HashMap<String,Integer>();
  for (int i=0; i < dataDefinitions.size(); i++) {
    String expression=dataDefinitions.get(i).getDefinition();
    if (queryMap.containsKey(expression)) {
      int expCount=queryMap.get(expression).intValue();
      queryMap.put(expression,new Integer(expCount++));
    }
 else {
      queryMap.put(expression,new Integer(1));
    }
  }
  for (Iterator<String> iterator=queryMap.keySet().iterator(); iterator.hasNext(); ) {
    String expression=iterator.next();
    if (DataDefinitionTextManager.getInstance().getNumberOfSameDataDefinition(expression) == queryMap.get(expression).intValue()) {
      ColorPalette.getInstance().retrieveColor(expression);
    }
  }
  final Event e=new Event();
  e.data=DataDefinitionSelector.this;
  e.type=IChartDataSheet.EVENT_QUERY;
  e.detail=IChartDataSheet.DETAIL_UPDATE_COLOR;
  Display.getCurrent().asyncExec(new Runnable(){
    public void run(){
      wizardContext.getDataSheet().notifyListeners(e);
    }
  }
);
}
Program: 71213
Project: 71213
Buggy source:
private SeriesDefinition getCurrentSeriesDefinition(){
  if (seriesDefns.isEmpty()) {
    addNewSeriesDefinition();
    refreshSeriesCombo();
    cmbSeriesSelect.select(0);
  }
  return (SeriesDefinition)seriesDefns.get(cmbSeriesSelect.getSelectionIndex());
}

Fixed version (ground truth):
private SeriesDefinition getCurrentSeriesDefinition(){
  if (seriesDefns.isEmpty()) {
    addNewSeriesDefinition();
    refreshSeriesCombo();
    cmbSeriesSelect.select(0);
  }
  return seriesDefns.get(cmbSeriesSelect.getSelectionIndex());
}
Program: 71214
Project: 71214
Buggy source:
private void refreshAxisCombo(){
  ArrayList itemList=new ArrayList();
  int axisNum=ChartUIUtil.getOrthogonalAxisNumber(getChart());
  for (int i=1; i <= axisNum; i++) {
    itemList.add(Messages.getString("String_Node_Str") + i);
  }
  itemList.add(Messages.getString("String_Node_Str"));
  cmbAxisSelect.removeAll();
  cmbAxisSelect.setItems((String[])itemList.toArray(new String[axisNum]));
}

Fixed version (ground truth):
private void refreshAxisCombo(){
  ArrayList<String> itemList=new ArrayList<String>();
  int axisNum=ChartUIUtil.getOrthogonalAxisNumber(getChart());
  for (int i=1; i <= axisNum; i++) {
    itemList.add(Messages.getString("String_Node_Str") + i);
  }
  itemList.add(Messages.getString("String_Node_Str"));
  cmbAxisSelect.removeAll();
  cmbAxisSelect.setItems(itemList.toArray(new String[axisNum]));
}
Program: 71215
Project: 71215
Buggy source:
protected void removeSeriesDefinition(){
  boolean isNotificaionIgnored=ChartAdapter.isNotificationIgnored();
  ChartAdapter.ignoreNotifications(true);
  int firstIndex=getFirstIndexOfSameAxis();
  EList list=getChart().getSampleData().getOrthogonalSampleData();
  for (int i=0; i < list.size(); i++) {
    if (((OrthogonalSampleData)list.get(i)).getSeriesDefinitionIndex() == (firstIndex + cmbSeriesSelect.getSelectionIndex())) {
      list.remove(i);
      break;
    }
  }
  ChartUIUtil.reorderOrthogonalSampleDataIndex(getChart());
  updateSeriesPalette(cmbSeriesSelect.getSelectionIndex());
  ChartAdapter.ignoreNotifications(isNotificaionIgnored);
  seriesDefns.remove(cmbSeriesSelect.getSelectionIndex());
}

Fixed version (ground truth):
protected void removeSeriesDefinition(){
  boolean isNotificaionIgnored=ChartAdapter.isNotificationIgnored();
  ChartAdapter.ignoreNotifications(true);
  int firstIndex=getFirstIndexOfSameAxis();
  EList<OrthogonalSampleData> list=getChart().getSampleData().getOrthogonalSampleData();
  for (int i=0; i < list.size(); i++) {
    if (list.get(i).getSeriesDefinitionIndex() == (firstIndex + cmbSeriesSelect.getSelectionIndex())) {
      list.remove(i);
      break;
    }
  }
  ChartUIUtil.reorderOrthogonalSampleDataIndex(getChart());
  updateSeriesPalette(cmbSeriesSelect.getSelectionIndex());
  ChartAdapter.ignoreNotifications(isNotificaionIgnored);
  seriesDefns.remove(cmbSeriesSelect.getSelectionIndex());
}
Program: 71216
Project: 71216
Buggy source:
/** 
 * Updates series palette of series definition list without the series to be moved
 * @param removedIndex the index of the series to be removed
 */
private void updateSeriesPalette(int removedIndex){
  for (int i=0, j=0; i < seriesDefns.size(); i++) {
    if (i != removedIndex) {
      ((SeriesDefinition)seriesDefns.get(i)).getSeriesPalette().shift(-j++);
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates series palette of series definition list without the series to be moved
 * @param removedIndex the index of the series to be removed
 */
private void updateSeriesPalette(int removedIndex){
  for (int i=0, j=0; i < seriesDefns.size(); i++) {
    if (i != removedIndex) {
      seriesDefns.get(i).getSeriesPalette().shift(-j++);
    }
  }
}
Program: 71217
Project: 71217
Buggy source:
private void refreshSeriesCombo(Combo cmbSeriesSelect){
  ArrayList itemList=new ArrayList();
  int seriesSize=seriesDefns.size();
  for (int i=1; i <= seriesSize; i++) {
    itemList.add(selectionName + "String_Node_Str" + i);
  }
  if (!isPartChart()) {
    itemList.add(Messages.getString("String_Node_Str"));
  }
  cmbSeriesSelect.removeAll();
  cmbSeriesSelect.setItems((String[])itemList.toArray(new String[seriesSize]));
}

Fixed version (ground truth):
private void refreshSeriesCombo(Combo cmbSeriesSelect){
  ArrayList<String> itemList=new ArrayList<String>();
  int seriesSize=seriesDefns.size();
  for (int i=1; i <= seriesSize; i++) {
    itemList.add(selectionName + "String_Node_Str" + i);
  }
  if (!isPartChart()) {
    itemList.add(Messages.getString("String_Node_Str"));
  }
  cmbSeriesSelect.removeAll();
  cmbSeriesSelect.setItems(itemList.toArray(new String[seriesSize]));
}
Program: 71219
Project: 71219
Buggy source:
private void outputPageBand(IPageContent page,IContent band){
  writer.openTag(HTMLTags.TAG_TD);
  if (htmlRtLFlag) {
    writer.attribute(HTMLTags.ATTR_HTML_DIR,"String_Node_Str");
  }
  StringBuffer styleBuffer=new StringBuffer();
  htmlEmitter.buildPageBandStyle(styleBuffer,page.getStyle());
  writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
  contentVisitor.visitChildren(band,null);
  writer.closeTag(HTMLTags.TAG_TD);
}

Fixed version (ground truth):
private void outputPageBand(IPageContent page,IContent band){
  writer.openTag(HTMLTags.TAG_TD);
  writeBidiFlag();
  StringBuffer styleBuffer=new StringBuffer();
  htmlEmitter.buildPageBandStyle(styleBuffer,page.getStyle());
  writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
  contentVisitor.visitChildren(band,null);
  writer.closeTag(HTMLTags.TAG_TD);
}
Program: 71221
Project: 71221
Buggy source:
protected void updateRtLFlag() throws EngineException {
  if (renderOptions == null)   return;
  IReportRunnable runnable=executionContext.getRunnable();
  if (runnable == null)   return;
  ReportDesignHandle handle=(ReportDesignHandle)runnable.getDesignHandle();
  if (handle != null) {
    Object bidiFlag=renderOptions.getOption(IRenderOption.RTL_FLAG);
    if (Boolean.TRUE.equals(bidiFlag)) {
      try {
        handle.setBidiOrientation(DesignChoiceConstants.BIDI_DIRECTION_RTL);
      }
 catch (      SemanticException e) {
        log.log(Level.WARNING,"String_Node_Str",e);
        throw new EngineException("String_Node_Str");
      }
    }
 else     if (handle.isDirectionRTL()) {
      renderOptions.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
      IRenderOption renderOptions2=executionContext.getRenderOption();
      if (renderOptions2 != null) {
        renderOptions2.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
        executionContext.setRenderOption(renderOptions2);
      }
    }
  }
}

Fixed version (ground truth):
protected void updateRtLFlag() throws EngineException {
  if (renderOptions == null)   return;
  IReportRunnable runnable=executionContext.getRunnable();
  if (runnable == null)   return;
  Report report=executionContext.getReport();
  AbstractStyle rootStyle=(AbstractStyle)report.getStyles().get(report.getRootStyleName());
  ReportDesignHandle handle=(ReportDesignHandle)runnable.getDesignHandle();
  if (handle != null) {
    Object bidiFlag=renderOptions.getOption(IRenderOption.RTL_FLAG);
    String bidiOrientation=null;
    if (bidiFlag != null) {
      if (Boolean.TRUE.equals(bidiFlag)) {
        bidiOrientation=DesignChoiceConstants.BIDI_DIRECTION_RTL;
      }
 else {
        bidiOrientation=DesignChoiceConstants.BIDI_DIRECTION_LTR;
      }
      try {
        handle.setBidiOrientation(bidiOrientation);
        rootStyle.setDirection(bidiOrientation);
      }
 catch (      SemanticException e) {
        log.log(Level.WARNING,"String_Node_Str",e);
        throw new EngineException("String_Node_Str");
      }
    }
 else     if (handle.isDirectionRTL()) {
      renderOptions.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
      IRenderOption renderOptions2=executionContext.getRenderOption();
      if (renderOptions2 != null) {
        renderOptions2.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
        executionContext.setRenderOption(renderOptions2);
      }
    }
  }
}
Program: 71222
Project: 71222
Buggy source:
protected void writeRunProperties(IStyle style,String fontFamily,boolean ishyperlink){
  writeFont(fontFamily);
  writeFontSize(style);
  writeLetterSpacing(style);
  writeFontStyle(style);
  writeHyperlinkStyle(ishyperlink);
}

Fixed version (ground truth):
protected void writeRunProperties(IStyle style,String fontFamily,boolean ishyperlink){
  writeFont(fontFamily);
  writeFontSize(style);
  writeLetterSpacing(style);
  writeTextUnderline(style);
  writeTextLineThrough(style);
  writeFontStyle(style);
  writeFontWeight(style);
  writeTextColor(style);
  writeHyperlinkStyle(ishyperlink);
}
Program: 71223
Project: 71223
Buggy source:
private void writeFontStyle(IStyle style){
  String val=WordUtil.removeQuote(style.getTextUnderline());
  if (!"String_Node_Str".equalsIgnoreCase(val)) {
    writeAttrTag("String_Node_Str","String_Node_Str");
  }
  val=WordUtil.removeQuote(style.getTextLineThrough());
  if (!"String_Node_Str".equalsIgnoreCase(val)) {
    writeAttrTag("String_Node_Str","String_Node_Str");
  }
  val=WordUtil.removeQuote(style.getFontStyle());
  if (!"String_Node_Str".equalsIgnoreCase(val)) {
    writeAttrTag("String_Node_Str","String_Node_Str");
  }
  val=WordUtil.removeQuote(style.getFontWeight());
  if (!"String_Node_Str".equalsIgnoreCase(val)) {
    writeAttrTag("String_Node_Str","String_Node_Str");
  }
  val=WordUtil.parseColor(style.getColor());
  if (val != null) {
    writeAttrTag("String_Node_Str",val);
  }
}

Fixed version (ground truth):
protected abstract void writeFontStyle(IStyle style);
Program: 71225
Project: 71225
Buggy source:
protected void updateRtLFlag() throws EngineException {
  if (renderOptions == null)   return;
  IReportRunnable runnable=executionContext.getRunnable();
  if (runnable == null)   return;
  ReportDesignHandle handle=(ReportDesignHandle)runnable.getDesignHandle();
  if (handle != null) {
    Object bidiFlag=renderOptions.getOption(IRenderOption.RTL_FLAG);
    String bidiOrientation=null;
    if (bidiFlag != null) {
      if (Boolean.TRUE.equals(bidiFlag)) {
        bidiOrientation=DesignChoiceConstants.BIDI_DIRECTION_RTL;
      }
 else {
        bidiOrientation=DesignChoiceConstants.BIDI_DIRECTION_LTR;
      }
      try {
        handle.setBidiOrientation(bidiOrientation);
        Report report=executionContext.getReport();
        AbstractStyle rootStyle=(AbstractStyle)report.getStyles().get(report.getRootStyleName());
{
          if (rootStyle != null) {
            rootStyle.setDirection(bidiOrientation);
          }
        }
      }
 catch (      SemanticException e) {
        log.log(Level.WARNING,"String_Node_Str",e);
        throw new EngineException("String_Node_Str");
      }
    }
 else     if (handle.isDirectionRTL()) {
      renderOptions.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
      IRenderOption renderOptions2=executionContext.getRenderOption();
      if (renderOptions2 != null) {
        renderOptions2.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
        executionContext.setRenderOption(renderOptions2);
      }
    }
  }
}

Fixed version (ground truth):
protected void updateRtLFlag() throws EngineException {
  if (renderOptions == null)   return;
  IReportRunnable runnable=executionContext.getRunnable();
  if (runnable == null)   return;
  ReportDesignHandle handle=(ReportDesignHandle)runnable.getDesignHandle();
  if (handle != null) {
    Object bidiFlag=renderOptions.getOption(IRenderOption.RTL_FLAG);
    String bidiOrientation=null;
    if (bidiFlag != null) {
      if (Boolean.TRUE.equals(bidiFlag)) {
        bidiOrientation=DesignChoiceConstants.BIDI_DIRECTION_RTL;
      }
 else {
        bidiOrientation=DesignChoiceConstants.BIDI_DIRECTION_LTR;
      }
      try {
        handle.setBidiOrientation(bidiOrientation);
        Report report=executionContext.getReport();
        AbstractStyle rootStyle=(AbstractStyle)report.getStyles().get(report.getRootStyleName());
        if (rootStyle != null) {
          rootStyle.setDirection(bidiOrientation);
        }
      }
 catch (      SemanticException e) {
        log.log(Level.WARNING,"String_Node_Str",e);
        throw new EngineException("String_Node_Str");
      }
    }
 else     if (handle.isDirectionRTL()) {
      renderOptions.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
      IRenderOption renderOptions2=executionContext.getRenderOption();
      if (renderOptions2 != null) {
        renderOptions2.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
        executionContext.setRenderOption(renderOptions2);
      }
    }
  }
}
Program: 71226
Project: 71226
Buggy source:
protected void endCell(IContent content,boolean finished,IContentEmitter emitter,boolean visible){
  AbstractNode current=(AbstractNode)currentNode;
  if (!current.isFirst) {
    current.setFinished(false);
  }
 else {
    current.setFinished(finished);
  }
  if (currentNode.isStarted()) {
    currentNode.end();
  }
 else {
  }
  currentNode=currentNode.getParent();
}

Fixed version (ground truth):
protected void endCell(IContent content,boolean finished,IContentEmitter emitter,boolean visible){
  AbstractNode current=(AbstractNode)currentNode;
  if (!current.isFirst) {
    current.setFinished(false);
  }
 else {
    current.setFinished(finished);
  }
  if (currentNode.isStarted()) {
    currentNode.end();
  }
 else {
    if (finished) {
      currentNode.start();
      currentNode.end();
    }
  }
  currentNode=currentNode.getParent();
}
Program: 71228
Project: 71228
Buggy source:
public TextCompositor(ITextContent textContent,FontMappingManager fontManager,boolean bidiProcessing,boolean fontSubstitution,boolean textWrapping,boolean hyphenation,Locale locale){
  this.textContent=textContent;
  this.fontManager=fontManager;
  this.bidiProcessing=bidiProcessing;
  this.fontSubstitution=fontSubstitution;
  this.hyphenation=hyphenation;
  this.textWrapping=textWrapping;
  this.locale=locale;
  IStyle style=textContent.getComputedStyle();
  letterSpacing=PropertyUtil.getDimensionValue(style.getProperty(StyleConstants.STYLE_LETTER_SPACING));
  wordSpacing=PropertyUtil.getDimensionValue(style.getProperty(StyleConstants.STYLE_WORD_SPACING));
  remainChunks=new ChunkGenerator(fontManager,textContent,bidiProcessing,fontSubstitution);
}

Fixed version (ground truth):
public TextCompositor(ITextContent textContent,FontMappingManager fontManager,boolean bidiProcessing,boolean fontSubstitution,boolean textWrapping,boolean hyphenation,Locale locale){
  this.textContent=textContent;
  this.fontManager=fontManager;
  this.bidiProcessing=bidiProcessing;
  this.fontSubstitution=fontSubstitution;
  this.hyphenation=hyphenation;
  this.locale=locale;
  IStyle style=textContent.getComputedStyle();
  letterSpacing=PropertyUtil.getDimensionValue(style.getProperty(StyleConstants.STYLE_LETTER_SPACING));
  wordSpacing=PropertyUtil.getDimensionValue(style.getProperty(StyleConstants.STYLE_WORD_SPACING));
  this.textWrapping=textWrapping && !PropertyUtil.isWhiteSpaceNoWrap(style.getProperty(StyleConstants.STYLE_WHITE_SPACE));
  remainChunks=new ChunkGenerator(fontManager,textContent,bidiProcessing,fontSubstitution);
}
Program: 71231
Project: 71231
Buggy source:
/** 
 * If the cell properties is not set, then check the row properties and write those properties.
 * @param style this cell style
 */
private void writeCellProperties(IStyle style){
  if (style == null) {
    return;
  }
  writeBackgroundColor(style.getBackgroundColor());
  writeCellBorders(style);
  String verticalAlign=style.getVerticalAlign();
  if (verticalAlign != null) {
    writeAttrTag("String_Node_Str",WordUtil.parseVerticalAlign(verticalAlign));
  }
}

Fixed version (ground truth):
/** 
 * If the cell properties is not set, then check the row properties and write those properties.
 * @param style this cell style
 */
private void writeCellProperties(IStyle style){
  if (style == null) {
    return;
  }
  writeBackgroundColor(style.getBackgroundColor());
  writeCellBorders(style);
  String verticalAlign=style.getVerticalAlign();
  if (verticalAlign != null) {
    writeAttrTag("String_Node_Str",WordUtil.parseVerticalAlign(verticalAlign));
  }
  String noWrap=CSSConstants.CSS_NOWRAP_VALUE.equalsIgnoreCase(style.getWhiteSpace()) ? "String_Node_Str" : "String_Node_Str";
  writeAttrTag("String_Node_Str",noWrap);
}
Program: 71233
Project: 71233
Buggy source:
public boolean equals(Object o){
  MemberForTest other=(MemberForTest)o;
  if (this.iField != other.iField) {
    return false;
  }
  if (!this.bigDecimalField.equals(other.bigDecimalField)) {
    return false;
  }
  if (this.booleanField != other.booleanField) {
    return false;
  }
  if (!this.dateField.equals(other.dateField)) {
    return false;
  }
  if (!this.stringField.equals(other.stringField)) {
    return false;
  }
  if (this.doubleField != other.doubleField) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean equals(Object o){
  MemberForTest other=(MemberForTest)o;
  if (this.iField != other.iField) {
    return false;
  }
  if ((this.bigDecimalField != null && !this.bigDecimalField.equals(other.bigDecimalField)) || (this.bigDecimalField == null && other.bigDecimalField != null)) {
    return false;
  }
  if (this.booleanField != other.booleanField) {
    return false;
  }
  if ((this.dateField != null && !this.dateField.equals(other.dateField)) || (this.dateField == null && other.dateField != null)) {
    return false;
  }
  if ((this.stringField != null && !this.stringField.equals(other.stringField)) || (this.stringField == null && other.stringField != null)) {
    return false;
  }
  if (this.doubleField != other.doubleField) {
    return false;
  }
  return true;
}
Program: 71234
Project: 71234
Buggy source:
protected Object readObject() throws IOException {
  short fieldCount=randomAccessFile.readShort();
  if (fieldCount == NULL_VALUE) {
    return null;
  }
  Object[] objects=new Object[fieldCount];
  for (int i=0; i < objects.length; i++) {
    objects[i]=fieldReaders[i].read(randomAccessFile);
  }
  return creator.createInstance(objects);
}

Fixed version (ground truth):
protected Object readObject() throws IOException {
  short fieldCount=randomAccessFile.readShort();
  if (fieldCount == NULL_VALUE) {
    return null;
  }
  Object[] objects=new Object[fieldCount];
  for (int i=0; i < objects.length; i++) {
    if (fieldReaders[i].getDataType() != fieldWriters[i].getDataType())     fieldReaders[i].setDataType(fieldWriters[i].getDataType());
    objects[i]=fieldReaders[i].read(randomAccessFile);
  }
  return creator.createInstance(objects);
}
Program: 71235
Project: 71235
Buggy source:
/** 
 * Build the style of text content.
 */
public void buildTextStyle(ITextContent text,StringBuffer styleBuffer,int display){
  IStyle style=text.getStyle();
  handleShrink(display,style,text.getHeight(),text.getWidth(),styleBuffer);
  setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  AttributeBuilder.buildBidiDirection(styleBuffer,text.getComputedStyle());
  String textAlign=style.getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
  style=getElementStyle(text);
  if (style == null) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
  AttributeBuilder.buildTextDecoration(styleBuffer,style);
}

Fixed version (ground truth):
/** 
 * Build the style of text content.
 */
public void buildTextStyle(ITextContent text,StringBuffer styleBuffer,int display){
  IStyle style=text.getStyle();
  handleTextShrink(display,style,text.getHeight(),text.getWidth(),styleBuffer);
  setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  AttributeBuilder.buildBidiDirection(styleBuffer,text.getComputedStyle());
  String textAlign=style.getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
  style=getElementStyle(text);
  if (style == null) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
  AttributeBuilder.buildTextDecoration(styleBuffer,style);
}
Program: 71237
Project: 71237
Buggy source:
/** 
 * Build the style of text content.
 */
public void buildTextStyle(ITextContent text,StringBuffer styleBuffer,int display){
  IStyle style=text.getStyle();
  handleShrink(display,style,text.getHeight(),text.getWidth(),styleBuffer);
  setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  IStyle textComputedStyle=text.getComputedStyle();
  if (null != textComputedStyle) {
    AttributeBuilder.buildTextDecoration(styleBuffer,textComputedStyle);
    AttributeBuilder.buildBidiDirection(styleBuffer,textComputedStyle);
  }
  String textAlign=style.getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
  style=getElementStyle(text);
  if (style == null) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
}

Fixed version (ground truth):
/** 
 * Build the style of text content.
 */
public void buildTextStyle(ITextContent text,StringBuffer styleBuffer,int display){
  IStyle style=text.getStyle();
  handleTextShrink(display,style,text.getHeight(),text.getWidth(),styleBuffer);
  setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  IStyle textComputedStyle=text.getComputedStyle();
  if (null != textComputedStyle) {
    AttributeBuilder.buildTextDecoration(styleBuffer,textComputedStyle);
    AttributeBuilder.buildBidiDirection(styleBuffer,textComputedStyle);
  }
  String textAlign=style.getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
  style=getElementStyle(text);
  if (style == null) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
}
Program: 71238
Project: 71238
Buggy source:
/** 
 * @param levelIndex
 * @return
 */
private AggrSortDefinition findAggregationSort(int levelIndex){
  AggrSortDefinition aggrSortDefn=null;
  if (this.sortList != null) {
    DimLevel level=this.rs.getLevel(levelIndex);
    for (int i=0; i < this.sortList.size(); i++) {
      if (level.equals(aggrSortDefn.getTargetLevel())) {
        aggrSortDefn=(AggrSortDefinition)sortList.get(i);
        break;
      }
    }
  }
  return aggrSortDefn;
}

Fixed version (ground truth):
/** 
 * @param levelIndex
 * @return
 */
private AggrSortDefinition findAggregationSort(int levelIndex){
  AggrSortDefinition aggrSortDefn=null;
  if (this.sortList != null) {
    DimLevel level=this.rs.getLevel(levelIndex);
    for (int i=0; i < this.sortList.size(); i++) {
      AggrSortDefinition defn=(AggrSortDefinition)sortList.get(i);
      if (level.equals(defn.getTargetLevel())) {
        aggrSortDefn=defn;
        break;
      }
    }
  }
  return aggrSortDefn;
}
Program: 71239
Project: 71239
Buggy source:
protected void endCell(IContent content,boolean finished,IContentEmitter emitter,boolean visible){
  AbstractNode current=(AbstractNode)currentNode;
  if (!current.isFirst) {
    current.setFinished(false);
  }
 else {
    current.setFinished(finished);
  }
  if (currentNode.isStarted()) {
    currentNode.end();
  }
 else {
    if (finished) {
      currentNode.start();
      currentNode.end();
    }
  }
  currentNode=currentNode.getParent();
}

Fixed version (ground truth):
protected void endCell(IContent content,boolean finished,IContentEmitter emitter,boolean visible){
  AbstractNode current=(AbstractNode)currentNode;
  if (!current.isFirst) {
    current.setFinished(false);
  }
 else {
    current.setFinished(finished);
  }
  if (currentNode.isStarted()) {
    currentNode.end();
  }
 else {
    if (finished && !isRepeated) {
      currentNode.start();
      currentNode.end();
    }
  }
  currentNode=currentNode.getParent();
}
Program: 71240
Project: 71240
Buggy source:
public void handleOnFetch(IDataSetInstanceHandle dataSet,IDataRow row){
  if (reportContext == null)   return;
  try {
    if (!this.useOnFetchEventHandler) {
      JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),ON_FETCH,dataSetHandle.getOnFetch());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.onFetch(new DataSetInstance(dataSet),new DataSetRow(row),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleOnFetch(IDataSetInstanceHandle dataSet,IDataRow row){
  if (reportContext == null)   return;
  try {
    if (!this.useOnFetchEventHandler) {
      Scriptable scope=getScriptScope(dataSet);
      JSScriptStatus status=handleJS(scope,dataSet.getName(),ON_FETCH,dataSetHandle.getOnFetch());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.onFetch(new DataSetInstance(dataSet),new DataSetRow(row),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 71241
Project: 71241
Buggy source:
public void handleBeforeOpen(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeOpenEventHandler) {
      JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),BEFORE_OPEN,dataSetHandle.getBeforeOpen());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeOpen(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleBeforeOpen(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeOpenEventHandler) {
      Scriptable scope=getScriptScope(dataSet);
      JSScriptStatus status=handleJS(scope,dataSet.getName(),BEFORE_OPEN,dataSetHandle.getBeforeOpen());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeOpen(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 71242
Project: 71242
Buggy source:
public void handleBeforeClose(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeCloseEventHandler) {
      JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),BEFORE_CLOSE,dataSetHandle.getBeforeClose());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeClose(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleBeforeClose(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeCloseEventHandler) {
      Scriptable scope=getScriptScope(dataSet);
      JSScriptStatus status=handleJS(scope,dataSet.getName(),BEFORE_CLOSE,dataSetHandle.getBeforeClose());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeClose(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 71243
Project: 71243
Buggy source:
public void handleAfterClose(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterCloseEventHandler) {
      JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),AFTER_CLOSE,dataSetHandle.getAfterClose());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterClose(reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleAfterClose(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterCloseEventHandler) {
      Scriptable scope=getScriptScope(dataSet);
      JSScriptStatus status=handleJS(scope,dataSet.getName(),AFTER_CLOSE,dataSetHandle.getAfterClose());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterClose(reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 71244
Project: 71244
Buggy source:
public void handleAfterOpen(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterOpenEventHandler) {
      JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),AFTER_OPEN,dataSetHandle.getAfterOpen());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterOpen(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleAfterOpen(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterOpenEventHandler) {
      Scriptable scope=getScriptScope(dataSet);
      JSScriptStatus status=handleJS(scope,dataSet.getName(),AFTER_OPEN,dataSetHandle.getAfterOpen());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterOpen(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}