nus-yam/ex-repair huggingface dataset:
Program: 67367
Project: 67367
Buggy source:
public void render() throws Exception {
  setupRenderOption();
  IContentEmitter emitter=createContentEmitter();
  String format=executionContext.getOutputFormat();
  IReportExecutor executor=new ReportletExecutor(executionContext,offset);
  executor=createRenderExtensionExecutor(executor);
  executor=new SuppressDuplciateReportExecutor(executor);
  executor=new LocalizedReportExecutor(executionContext,executor);
  executionContext.setExecutor(executor);
  initializeContentEmitter(emitter,executor);
  IReportLayoutEngine layoutEngine=createReportLayoutEngine(pagination,renderOptions);
  layoutEngine.setPageHandler(new LayoutPageHandler(((HTMLReportLayoutEngine)layoutEngine).getContext()));
  layoutEngine.setLocale(executionContext.getLocale());
  if (ExtensionManager.PAPER_SIZE_PAGINATION.equals(pagination)) {
    emitter=new LayoutEngine(executor,((HTMLReportLayoutEngine)layoutEngine).getContext(),emitter,renderOptions,executionContext,getDocumentTotalPage());
  }
  startRender();
  IReportContent report=executor.execute();
  emitter.start(report);
  layoutEngine.layout(executor,report,emitter,false);
  layoutEngine.close();
  emitter.end(report);
  closeRender();
  executor.close();
  outputPageCount=layoutEngine.getPageCount();
}

Fixed version (ground truth):
public void render() throws Exception {
  setupRenderOption();
  IContentEmitter emitter=createContentEmitter();
  String format=executionContext.getOutputFormat();
  IReportExecutor executor=new ReportletExecutor(executionContext,offset);
  executor=createRenderExtensionExecutor(executor);
  executor=new SuppressDuplciateReportExecutor(executor);
  executor=new LocalizedReportExecutor(executionContext,executor);
  executionContext.setExecutor(executor);
  initializeContentEmitter(emitter);
  IReportLayoutEngine layoutEngine=createReportLayoutEngine(pagination,renderOptions);
  layoutEngine.setPageHandler(new LayoutPageHandler(((HTMLReportLayoutEngine)layoutEngine).getContext()));
  layoutEngine.setLocale(executionContext.getLocale());
  if (ExtensionManager.PAPER_SIZE_PAGINATION.equals(pagination)) {
    emitter=new LayoutEngine(executor,((HTMLReportLayoutEngine)layoutEngine).getContext(),emitter,renderOptions,executionContext,getDocumentTotalPage());
  }
  startRender();
  IReportContent report=executor.execute();
  emitter.start(report);
  layoutEngine.layout(executor,report,emitter,false);
  layoutEngine.close();
  emitter.end(report);
  closeRender();
  executor.close();
  outputPageCount=layoutEngine.getPageCount();
}
Program: 67370
Project: 67370
Buggy source:
public IParameterDefn[] getParameterDefn(){
  return new IParameterDefn[]{new ParameterDefn(Constants.EXPRESSION_NAME,Constants.EXPRESSION_DISPLAY_NAME,false,true,SupportedDataTypes.CALCULATABLE,"String_Node_Str"),new ParameterDefn("String_Node_Str",Messages.getString("String_Node_Str"),true,false,SupportedDataTypes.CALCULATABLE,"String_Node_Str")};
}

Fixed version (ground truth):
public IParameterDefn[] getParameterDefn(){
  return new IParameterDefn[]{new ParameterDefn(Constants.EXPRESSION_NAME,Constants.EXPRESSION_DISPLAY_NAME,false,true,SupportedDataTypes.CALCULATABLE,"String_Node_Str"),new ParameterDefn("String_Node_Str",Messages.getString("String_Node_Str"),false,false,SupportedDataTypes.CALCULATABLE,"String_Node_Str")};
}
Program: 67373
Project: 67373
Buggy source:
public ISelectDataComponent getSeriesDataComponent(int seriesType,SeriesDefinition seriesDefn,ChartWizardContext context,String sTitle){
  if (seriesType == ISelectDataCustomizeUI.ORTHOGONAL_SERIES) {
    return new BaseDataDefinitionComponent(BaseDataDefinitionComponent.BUTTON_AGGREGATION,sTitle,seriesDefn,ChartUIUtil.getDataQuery(seriesDefn,0),context,sTitle);
  }
 else   if (seriesType == ISelectDataCustomizeUI.GROUPING_SERIES) {
    BaseDataDefinitionComponent ddc=new YOptionalDataDefinitionComponent(BaseDataDefinitionComponent.BUTTON_GROUP,ChartUIConstants.QUERY_OPTIONAL,seriesDefn,seriesDefn.getQuery(),context,sTitle);
    return ddc;
  }
  return new DefaultSelectDataComponent();
}

Fixed version (ground truth):
public ISelectDataComponent getSeriesDataComponent(int seriesType,SeriesDefinition seriesDefn,ChartWizardContext context,String sTitle){
  if (seriesType == ISelectDataCustomizeUI.ORTHOGONAL_SERIES) {
    return new BaseDataDefinitionComponent(BaseDataDefinitionComponent.BUTTON_AGGREGATION,ChartUIConstants.QUERY_VALUE,seriesDefn,ChartUIUtil.getDataQuery(seriesDefn,0),context,sTitle);
  }
 else   if (seriesType == ISelectDataCustomizeUI.GROUPING_SERIES) {
    BaseDataDefinitionComponent ddc=new YOptionalDataDefinitionComponent(BaseDataDefinitionComponent.BUTTON_GROUP,ChartUIConstants.QUERY_OPTIONAL,seriesDefn,seriesDefn.getQuery(),context,sTitle);
    return ddc;
  }
  return new DefaultSelectDataComponent();
}
Program: 67374
Project: 67374
Buggy source:
private void recalculateAggregation(List<IAggregationResultRow> aggregationRows) throws DataException, IOException {
  Set<Integer> duplicatedIndex=new HashSet<Integer>();
  for (int i=0; i < aggregationRows.size(); i++) {
    this.calculator.start();
    List<Integer> positions=getRowsPositionInAggregationRows(i,aggregationRows);
    for (int k=0; k < positions.size(); k++) {
      this.calculator.onRow(aggregationRows.get(positions.get(k)));
      if (k != 0)       duplicatedIndex.add(positions.get(k));
    }
    this.calculator.finish(aggregationRows.get(i));
    int baseIndex=0;
    Iterator<Integer> iter=duplicatedIndex.iterator();
    while (iter.hasNext()) {
      int index=iter.next().intValue();
      aggregationRows.remove(index - baseIndex);
      baseIndex++;
    }
    duplicatedIndex.clear();
  }
}

Fixed version (ground truth):
private void recalculateAggregation(List<IAggregationResultRow> aggregationRows) throws DataException, IOException {
  Set<Integer> duplicatedIndex=new LinkedHashSet<Integer>();
  for (int i=0; i < aggregationRows.size(); i++) {
    this.calculator.start();
    List<Integer> positions=getRowsPositionInAggregationRows(i,aggregationRows);
    for (int k=0; k < positions.size(); k++) {
      this.calculator.onRow(aggregationRows.get(positions.get(k)));
      if (k != 0)       duplicatedIndex.add(positions.get(k));
    }
    this.calculator.finish(aggregationRows.get(i));
    int baseIndex=0;
    Iterator<Integer> iter=duplicatedIndex.iterator();
    while (iter.hasNext()) {
      int index=iter.next().intValue();
      aggregationRows.remove(index - baseIndex);
      baseIndex++;
    }
    duplicatedIndex.clear();
  }
}
Program: 67375
Project: 67375
Buggy source:
/** 
 * @param view
 * @param result
 * @param relationMap
 * @param manager
 */
public AggregationAccessor(BirtCubeView view,IResultSet result,Map relationMap){
  this.resultSet=result;
  this.view=view;
  this.relationMap=relationMap;
  if (result == null || result.getMeasureResult() == null)   return;
  this.currentPosition=new int[this.resultSet.getMeasureResult().length];
  for (int i=0; i < this.resultSet.getMeasureResult().length; i++) {
    try {
      if (this.resultSet.getMeasureResult()[i].getQueryResultSet().length() > 0) {
        this.resultSet.getMeasureResult()[i].getQueryResultSet().seek(0);
        currentPosition[i]=0;
      }
 else {
        currentPosition[i]=-1;
      }
    }
 catch (    IOException e) {
    }
  }
  initMeasureNavigator();
}

Fixed version (ground truth):
/** 
 * @param view
 * @param result
 * @param relationMap
 * @param manager
 */
public AggregationAccessor(BirtCubeView view,IResultSet result,Map relationMap){
  this.resultSet=result;
  this.view=view;
  this.relationMap=relationMap;
  this.dimensionPrepared=false;
  this.dimensionCursorMap=new HashMap();
  if (result == null || result.getMeasureResult() == null)   return;
  this.currentPosition=new int[this.resultSet.getMeasureResult().length];
  for (int i=0; i < this.resultSet.getMeasureResult().length; i++) {
    try {
      if (this.resultSet.getMeasureResult()[i].getQueryResultSet().length() > 0) {
        this.resultSet.getMeasureResult()[i].getQueryResultSet().seek(0);
        currentPosition[i]=0;
      }
 else {
        currentPosition[i]=-1;
      }
    }
 catch (    IOException e) {
    }
  }
  initMeasureNavigator();
}
Program: 67378
Project: 67378
Buggy source:
EdgeCursorImpl(BirtEdgeView view,boolean isPage,IEdgeAxis axis,CubeCursor cursor) throws OLAPException {
  super(new EdgeNavigator(axis),null);
  if (isPage)   pageOwner=cursor;
 else   ordinateOwner=cursor;
  view.setEdgeCursor(this);
  for (int i=view.getPageEndingIndex() + 1; i < axis.getAllDimensionAxis().length; i++) {
    dimensionCursorList.add(new DimensionCursorImpl(this,axis.getDimensionAxis(i),new DimensionNavigator(axis.getDimensionAxis(i))));
  }
}

Fixed version (ground truth):
EdgeCursorImpl(BirtEdgeView view,boolean isPage,IEdgeAxis axis,CubeCursor cursor) throws OLAPException {
  super(new EdgeNavigator(axis),null);
  if (isPage)   pageOwner=cursor;
 else   ordinateOwner=cursor;
  view.setEdgeCursor(this);
  dimensionCursorList=new ArrayList<DimensionCursorImpl>();
  for (int i=view.getPageEndingIndex() + 1; i < axis.getAllDimensionAxis().length; i++) {
    DimensionCursorImpl dimCursor=new DimensionCursorImpl(this,axis.getDimensionAxis(i),new DimensionNavigator(axis.getDimensionAxis(i)));
    if (axis.getDimensionAxis(i).getLevelDefinition() != null) {
      String uniqueName=UniqueNamingUtil.getUniqueName(axis.getDimensionAxis(i).getLevelDefinition().getHierarchy().getDimension().getName(),axis.getDimensionAxis(i).getLevelDefinition().getName());
      dimCursor.setName(uniqueName);
    }
    dimensionCursorList.add(dimCursor);
  }
}
Program: 67379
Project: 67379
Buggy source:
/** 
 * @param rs
 * @param view
 * @param isCalculatedMember
 * @throws OLAPException
 * @throws IOException
 */
private void populateDimensionAxis(IAggregationResultSet rs,BirtEdgeView view) throws IOException {
  List dimensionAxisList=new ArrayList();
  int index=-1, levelIndex=-1;
  if (!isCalculatedMember) {
    levelIndex=index=0;
    for (int i=0; i < view.getDimensionViews().size(); i++) {
      BirtDimensionView dv=(BirtDimensionView)(view.getDimensionViews().get(i));
      Iterator levelIter=dv.getMemberSelection().iterator();
      while (levelIter.hasNext()) {
        ILevelDefinition level=(ILevelDefinition)levelIter.next();
        DimensionAxis axis=null;
        axis=new DimensionAxis(this,rs,index,levelIndex);
        index++;
        levelIndex++;
        dimensionAxisList.add(axis);
      }
    }
  }
 else   if (isCalculatedMember) {
    DimensionAxis axis=new DimensionAxis(this,rs,index,0);
    dimensionAxisList.add(axis);
  }
  this.dimensionAxis=new DimensionAxis[dimensionAxisList.size()];
  for (int i=0; i < dimensionAxisList.size(); i++) {
    this.dimensionAxis[i]=(DimensionAxis)dimensionAxisList.get(i);
  }
}

Fixed version (ground truth):
/** 
 * @param rs
 * @param view
 * @param isCalculatedMember
 * @throws OLAPException
 * @throws IOException
 */
private void populateDimensionAxis(IAggregationResultSet rs,BirtEdgeView view) throws IOException {
  List dimensionAxisList=new ArrayList();
  int index=-1, levelIndex=-1;
  if (!isCalculatedMember) {
    levelIndex=index=0;
    for (int i=0; i < view.getDimensionViews().size(); i++) {
      BirtDimensionView dv=(BirtDimensionView)(view.getDimensionViews().get(i));
      Iterator levelIter=dv.getMemberSelection().iterator();
      while (levelIter.hasNext()) {
        ILevelDefinition level=(ILevelDefinition)levelIter.next();
        DimensionAxis axis=new DimensionAxis(this,rs,index,levelIndex);
        axis.setLevelDefinition(level);
        index++;
        levelIndex++;
        dimensionAxisList.add(axis);
      }
    }
  }
 else   if (isCalculatedMember) {
    DimensionAxis axis=new DimensionAxis(this,rs,index,0);
    dimensionAxisList.add(axis);
  }
  this.dimensionAxis=new DimensionAxis[dimensionAxisList.size()];
  for (int i=0; i < dimensionAxisList.size(); i++) {
    this.dimensionAxis[i]=(DimensionAxis)dimensionAxisList.get(i);
  }
}
Program: 67383
Project: 67383
Buggy source:
private int getLevelSize(DimLevel[] dimLevel) throws DataException {
  int[] dataType=new int[dimLevel.length];
  for (int i=0; i < dimLevel.length; i++) {
    DimColumn dimColumn=new DimColumn(dimLevel[i].getDimensionName(),dimLevel[i].getLevelName(),dimLevel[i].getLevelName());
    ColumnInfo columnInfo=(dataSet4Aggregation.getMetaInfo()).getColumnInfo(dimColumn);
    dataType[i]=columnInfo.getDataType();
  }
  return getObjectSize(dataType);
}

Fixed version (ground truth):
private int getLevelSize(DimLevel[] dimLevel) throws DataException {
  if (dimLevel == null || dimLevel.length == 0) {
    return 0;
  }
  int[] dataType=new int[dimLevel.length];
  for (int i=0; i < dimLevel.length; i++) {
    DimColumn dimColumn=new DimColumn(dimLevel[i].getDimensionName(),dimLevel[i].getLevelName(),dimLevel[i].getLevelName());
    ColumnInfo columnInfo=(dataSet4Aggregation.getMetaInfo()).getColumnInfo(dimColumn);
    dataType[i]=columnInfo.getDataType();
  }
  return getObjectSize(dataType);
}
Program: 67384
Project: 67384
Buggy source:
private int getMeasureSize() throws IOException {
  MeasureInfo[] measureInfo=dataSet4Aggregation.getMetaInfo().getMeasureInfos();
  int[] dataType=new int[measureInfo.length];
  for (int i=0; i < measureInfo.length; i++) {
    dataType[i]=measureInfo[i].getDataType();
  }
  return getObjectSize(dataType);
}

Fixed version (ground truth):
private int getMeasureSize() throws IOException {
  MeasureInfo[] measureInfo=dataSet4Aggregation.getMetaInfo().getMeasureInfos();
  if (measureInfo == null || measureInfo.length == 0)   return 0;
  int[] dataType=new int[measureInfo.length];
  for (int i=0; i < measureInfo.length; i++) {
    dataType[i]=measureInfo[i].getDataType();
  }
  return getObjectSize(dataType);
}
Program: 67385
Project: 67385
Buggy source:
private static int getArraySize(int length){
  return 16 + (4 + length * 4 - 1) / 8 * 8;
}

Fixed version (ground truth):
private static int getArraySize(int length){
  if (length == 0)   return 0;
  return 16 + (4 + length * 4 - 1) / 8 * 8;
}
Program: 67387
Project: 67387
Buggy source:
public int getResolution(){
  return getIntOption(OPTION_RESOLUTION,600);
}

Fixed version (ground truth):
public String getResolution(){
  return getStringOption(OPTION_RESOLUTION);
}
Program: 67388
Project: 67388
Buggy source:
public void setResolution(int resolution){
  options.put(OPTION_RESOLUTION,resolution);
}

Fixed version (ground truth):
public void setResolution(String resolution){
  options.put(OPTION_RESOLUTION,resolution);
}
Program: 67389
Project: 67389
Buggy source:
private void doNew(){
  DataSetParameter newParam=null;
  if (isOdaDataSetHandle)   newParam=new OdaDataSetParameter();
 else   newParam=new DataSetParameter();
  int position=viewer.getViewer().getTable().getItemCount();
  newParam.setName(getUniqueName());
  newParam.setIsInput(true);
  newParam.setPosition(new Integer(position + 1));
  doEdit(newParam);
}

Fixed version (ground truth):
private void doNew(){
  DataSetParameter newParam=null;
  if (isOdaDataSetHandle)   newParam=new OdaDataSetParameter();
 else   newParam=new DataSetParameter();
  int position=viewer.getViewer().getTable().getItemCount();
  newParam.setName(getUniqueName());
  newParam.setIsInput(true);
  newParam.setPosition(new Integer(position + 1));
  CommandStack stack=Utility.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  ParameterInputDialog dlg=new ParameterInputDialog(newParam,isOdaDataSetHandle);
  if (dlg.open() == Window.OK) {
    viewer.getViewer().refresh();
    refreshMessage();
    refreshLinkedReportParamStatus();
    stack.commit();
  }
 else {
    stack.rollback();
  }
}
Program: 67390
Project: 67390
Buggy source:
protected void doEdit(Object structureOrHandle){
  ParameterInputDialog dlg=new ParameterInputDialog(structureOrHandle,isOdaDataSetHandle);
  if (dlg.open() == Window.OK) {
    viewer.getViewer().refresh();
    refreshMessage();
    refreshLinkedReportParamStatus();
  }
}

Fixed version (ground truth):
private void doEdit(){
  int index=viewer.getViewer().getTable().getSelectionIndex();
  if (index == -1)   return;
  DataSetParameterHandle handle=(DataSetParameterHandle)viewer.getViewer().getTable().getItem(index).getData();
  originalStructure=(DataSetParameter)handle.getStructure().copy();
  CommandStack stack=Utility.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  ParameterInputDialog dlg=new ParameterInputDialog(handle,isOdaDataSetHandle);
  if (dlg.open() == Window.OK) {
    viewer.getViewer().refresh();
    refreshMessage();
    refreshLinkedReportParamStatus();
    stack.commit();
  }
 else {
    stack.rollback();
  }
}
Program: 67391
Project: 67391
Buggy source:
protected void rollback(){
  DataSetParameter structure=getStructure(getStructureOrHandle());
  try {
    if (originalStructure != null) {
      structure.setName(originalStructure.getName());
      structure.setParameterDataType(originalStructure.getParameterDataType());
      structure.setIsInput(originalStructure.isInput());
      structure.setIsOutput(originalStructure.isOutput());
      structure.setDefaultValue(originalStructure.getDefaultValue());
      structure.setExpressionProperty(DataSetParameter.DEFAULT_VALUE_MEMBER,originalStructure.getExpressionProperty(DataSetParameter.DEFAULT_VALUE_MEMBER));
      if (isOdaDataSetHandle)       ((OdaDataSetParameter)structure).setParamName(((OdaDataSetParameter)originalStructure).getParamName());
      originalStructure=null;
    }
 else {
      parameters.removeItem(structure);
      viewer.getViewer().refresh();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.handle(e);
  }
  modelChanged=inputChanged;
}

Fixed version (ground truth):
protected void rollback(){
  modelChanged=inputChanged;
}
Program: 67392
Project: 67392
Buggy source:
private boolean isUniqueName(){
  DataSetParameter structure=getStructure(getStructureOrHandle());
  Iterator iter=parameters.iterator();
  if (iter != null) {
    while (iter.hasNext()) {
      DataSetParameterHandle handle=(DataSetParameterHandle)iter.next();
      if (structure != handle.getStructure() && handle.getName().equals(dataSetParamName.getText())) {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean isUniqueName(){
  DataSetParameter structure=getStructure(getStructureOrHandle());
  Iterator iter=parameters.iterator();
  if (iter != null) {
    while (iter.hasNext()) {
      DataSetParameterHandle handle=(DataSetParameterHandle)iter.next();
      if (originalStructure != null && dataSetParamName.getText().equals(originalStructure.getName())) {
        return true;
      }
 else       if (structure != handle.getStructure() && handle.getName().equals(dataSetParamName.getText())) {
        return false;
      }
    }
  }
  return true;
}
Program: 67394
Project: 67394
Buggy source:
@Override public String getNullsOrdering(){
  return this.source.getNullsOrdering();
}

Fixed version (ground truth):
public String getNullsOrdering(){
  return this.source.getNullsOrdering();
}
Program: 67395
Project: 67395
Buggy source:
@Override public ULocale getCompareLocale(){
  return this.source.getCompareLocale();
}

Fixed version (ground truth):
public ULocale getCompareLocale(){
  return this.source.getCompareLocale();
}
Program: 67396
Project: 67396
Buggy source:
@Override public String getNullsOrdering(){
  return null;
}

Fixed version (ground truth):
public String getNullsOrdering(){
  return null;
}
Program: 67397
Project: 67397
Buggy source:
@Override public ULocale getCompareLocale(){
  return null;
}

Fixed version (ground truth):
public ULocale getCompareLocale(){
  return null;
}
Program: 67398
Project: 67398
Buggy source:
public boolean next() throws IOException, DataException {
  while (!stopSign.isStopped()) {
    try {
      if (currentSegment == null) {
        return false;
      }
      Bytes combinedDimensionPosition=currentSegment.readBytes();
      currentPos=factTable.getCombinedPositionCalculator().calculateDimensionPosition(subDimensionIndex,combinedDimensionPosition.bytesValue());
      readMeasure=false;
      if (!isSelectedRow()) {
        if (!readMeasure) {
          if (allMeasuerSize != -1) {
            int n=currentSegment.skipBytes(allMeasuerSize);
            if (n == -1) {
              break;
            }
          }
 else           readMeasure();
        }
        continue;
      }
 else {
        if (!readMeasure)         readMeasure();
        return true;
      }
    }
 catch (    EOFException e) {
      break;
    }
  }
  if (stopSign.isStopped() || !nextSegment()) {
    return false;
  }
  return next();
}

Fixed version (ground truth):
public boolean next() throws IOException, DataException {
  while (!stopSign.isStopped()) {
    try {
      if (currentSegment == null) {
        return false;
      }
      Bytes combinedDimensionPosition=currentSegment.readBytes();
      currentPos=factTable.getCombinedPositionCalculator().calculateDimensionPosition(subDimensionIndex,combinedDimensionPosition.bytesValue());
      readMeasure=false;
      if (!isSelectedRow()) {
        if (!readMeasure) {
          if (!skipMeasure())           break;
        }
        continue;
      }
 else {
        if (!readMeasure)         readMeasure();
        return true;
      }
    }
 catch (    EOFException e) {
      break;
    }
  }
  if (stopSign.isStopped() || !nextSegment()) {
    return false;
  }
  return next();
}
Program: 67399
Project: 67399
Buggy source:
private void setResolution(int resolution){
  if (resolution > 0) {
    out.println("String_Node_Str" + resolution + "String_Node_Str"+ resolution+ "String_Node_Str");
    out.println("String_Node_Str" + resolution + "String_Node_Str"+ resolution+ "String_Node_Str");
    out.println("String_Node_Str");
    out.println("String_Node_Str");
    out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
private void setResolution(String resolution){
  if (resolution != null && resolution.length() > 0) {
    int split=resolution.indexOf("String_Node_Str");
    if (split == -1) {
      split=resolution.indexOf("String_Node_Str");
    }
    if (split != -1) {
      int xResolution=new Integer(resolution.substring(0,split).trim());
      int yResolution=new Integer(resolution.substring(split + 1,resolution.length()).trim());
      if (xResolution > 0 && yResolution > 0) {
        out.println("String_Node_Str" + xResolution + "String_Node_Str"+ yResolution+ "String_Node_Str");
        out.println("String_Node_Str" + xResolution + "String_Node_Str"+ yResolution+ "String_Node_Str");
        out.println("String_Node_Str");
        out.println("String_Node_Str");
        out.println("String_Node_Str");
      }
    }
  }
}
Program: 67400
Project: 67400
Buggy source:
public void startRenderer(String author,String description,String paperSize,int paperTrayCode,String duplex,int copies,boolean collate,int resolution,boolean color,int scale) throws IOException {
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  int[] pageSize=getPaperSize(paperSize);
  int width=pageSize[0];
  int height=pageSize[1];
  setPaperSize(paperSize,width,height);
  setPaperTray(paperTrayCode);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(color);
  FileUtil.load("String_Node_Str",out);
  setScale(height,scale);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}

Fixed version (ground truth):
public void startRenderer(String author,String description,String paperSize,int paperTrayCode,String duplex,int copies,boolean collate,String resolution,boolean color,int scale) throws IOException {
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  int[] pageSize=getPaperSize(paperSize);
  int width=pageSize[0];
  int height=pageSize[1];
  setPaperSize(paperSize,width,height);
  setPaperTray(paperTrayCode);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(color);
  FileUtil.load("String_Node_Str",out);
  setScale(height,scale);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}
Program: 67401
Project: 67401
Buggy source:
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  int paperTrayCode=renderOption.getIntOption(PostscriptRenderOption.OPTION_PAPER_TRAY,IPostscriptRenderOption.TRAYCODE_AUTO);
  String duplex=renderOption.getStringOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  int resolution=renderOption.getIntOption(IPostscriptRenderOption.OPTION_RESOLUTION,0);
  boolean color=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_COLOR,true);
  int scale=renderOption.getIntOption(IPostscriptRenderOption.OPTION_SCALE,100);
  writer.startRenderer(author,description,paperSize,paperTrayCode,duplex,copies,collate,resolution,color,scale);
}

Fixed version (ground truth):
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  int paperTrayCode=renderOption.getIntOption(PostscriptRenderOption.OPTION_PAPER_TRAY,IPostscriptRenderOption.TRAYCODE_AUTO);
  String duplex=renderOption.getStringOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  String resolution=renderOption.getStringOption(IPostscriptRenderOption.OPTION_RESOLUTION);
  boolean color=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_COLOR,true);
  int scale=renderOption.getIntOption(IPostscriptRenderOption.OPTION_SCALE,100);
  writer.startRenderer(author,description,paperSize,paperTrayCode,duplex,copies,collate,resolution,color,scale);
}
Program: 67402
Project: 67402
Buggy source:
int getResolution();

Fixed version (ground truth):
String getResolution();
Program: 67403
Project: 67403
Buggy source:
void setResolution(int resolution);

Fixed version (ground truth):
void setResolution(String resolution);
Program: 67404
Project: 67404
Buggy source:
public void computePageProperties(IPageContent page){
  pageWidth=WordUtil.convertTo(page.getPageWidth(),0,reportDpi);
  pageHeight=WordUtil.convertTo(page.getPageHeight(),0,reportDpi);
  footerHeight=WordUtil.convertTo(page.getFooterHeight(),0,reportDpi);
  headerHeight=WordUtil.convertTo(page.getHeaderHeight(),0,reportDpi);
  topMargin=WordUtil.convertTo(page.getMarginTop(),0,reportDpi);
  bottomMargin=WordUtil.convertTo(page.getMarginBottom(),0,reportDpi);
  leftMargin=WordUtil.convertTo(page.getMarginLeft(),0,reportDpi);
  rightMargin=WordUtil.convertTo(page.getMarginRight(),0,reportDpi);
  contentWidth=pageWidth - leftMargin - rightMargin;
  orientation=page.getOrientation();
}

Fixed version (ground truth):
public void computePageProperties(IPageContent page){
  pageWidth=WordUtil.convertTo(page.getPageWidth(),11906,reportDpi);
  pageHeight=WordUtil.convertTo(page.getPageHeight(),16838,reportDpi);
  footerHeight=WordUtil.convertTo(page.getFooterHeight(),0,reportDpi);
  headerHeight=WordUtil.convertTo(page.getHeaderHeight(),0,reportDpi);
  topMargin=WordUtil.convertTo(page.getMarginTop(),0,reportDpi);
  bottomMargin=WordUtil.convertTo(page.getMarginBottom(),0,reportDpi);
  leftMargin=WordUtil.convertTo(page.getMarginLeft(),0,reportDpi);
  rightMargin=WordUtil.convertTo(page.getMarginRight(),0,reportDpi);
  contentWidth=pageWidth - leftMargin - rightMargin;
  orientation=page.getOrientation();
}
Program: 67406
Project: 67406
Buggy source:
protected void setUp() throws Exception {
  super.setUp();
  cells[0]=new CellArea(10,10,40,40);
  cells[1]=new CellArea(50,10,40,40);
  cells[2]=new CellArea(90,10,40,40);
  cells[2].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[2].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  cells[3]=new CellArea(10,50,40,80);
  cells[3].defineBorder(BorderInfo.BOTTOM_BORDER,6);
  cells[3].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[4]=new CellArea(50,50,40,40);
  cells[5]=new CellArea(90,50,40,40);
  cells[5].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[5].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  cells[6]=null;
  cells[7]=new CellArea(50,90,40,40);
  cells[7].defineBorder(BorderInfo.BOTTOM_BORDER,4);
  cells[7].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[8]=new CellArea(90,90,40,40);
  cells[8].defineBorder(BorderInfo.BOTTOM_BORDER,2);
  cells[8].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[8].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[8].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(new FileOutputStream("String_Node_Str"));
  writer=new PostscriptWriter(bufferedOutputStream,"String_Node_Str");
  writer.startRenderer(null,null,null,1,false,600,false,100);
  writer.startPage(pageWidth,pageHeight);
  testBorderDraw();
  writer.endPage();
  writer.stopRenderer();
}

Fixed version (ground truth):
protected void setUp() throws Exception {
  super.setUp();
  cells[0]=new CellArea(10,10,40,40);
  cells[1]=new CellArea(50,10,40,40);
  cells[2]=new CellArea(90,10,40,40);
  cells[2].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[2].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  cells[3]=new CellArea(10,50,40,80);
  cells[3].defineBorder(BorderInfo.BOTTOM_BORDER,6);
  cells[3].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[4]=new CellArea(50,50,40,40);
  cells[5]=new CellArea(90,50,40,40);
  cells[5].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[5].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  cells[6]=null;
  cells[7]=new CellArea(50,90,40,40);
  cells[7].defineBorder(BorderInfo.BOTTOM_BORDER,4);
  cells[7].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[8]=new CellArea(90,90,40,40);
  cells[8].defineBorder(BorderInfo.BOTTOM_BORDER,2);
  cells[8].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[8].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[8].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(new FileOutputStream("String_Node_Str"));
  writer=new PostscriptWriter(bufferedOutputStream,"String_Node_Str");
  writer.startRenderer();
  writer.startPage(pageWidth,pageHeight);
  testBorderDraw();
  writer.endPage();
  writer.stopRenderer();
}
Program: 67407
Project: 67407
Buggy source:
private void validateGanttEntryData(Object[] obja) throws ChartException {
  boolean valid=true;
  if (obja == null) {
    valid=false;
  }
 else   if (obja.length != 3) {
    throw new ChartException(ChartEngineExtensionPlugin.ID,ChartException.DATA_SET,"String_Node_Str",Messages.getResourceBundle(getULocale()));
  }
 else {
    for (int i=0; i < obja.length - 1; i++) {
      if (!(obja[i] instanceof CDateTime)) {
        valid=false;
        break;
      }
    }
  }
  if (!valid) {
    throw new ChartException(ChartEngineExtensionPlugin.ID,ChartException.VALIDATION,"String_Node_Str",Messages.getResourceBundle(getULocale()));
  }
}

Fixed version (ground truth):
private void validateGanttEntryData(Object[] obja) throws ChartException {
  boolean valid=true;
  if (obja == null) {
    valid=false;
  }
 else   if (obja.length != 3) {
    throw new ChartException(ChartEngineExtensionPlugin.ID,ChartException.DATA_SET,"String_Node_Str",Messages.getResourceBundle(getULocale()));
  }
 else {
    for (int i=0; i < obja.length - 1; i++) {
      if (obja[i] != null && !(obja[i] instanceof CDateTime)) {
        valid=false;
        break;
      }
    }
  }
  if (!valid) {
    throw new ChartException(ChartEngineExtensionPlugin.ID,ChartException.VALIDATION,"String_Node_Str",Messages.getResourceBundle(getULocale()));
  }
}
Program: 67408
Project: 67408
Buggy source:
@SuppressWarnings("String_Node_Str") public void updateRowExpressions(Map newExpressions){
  CompatibleExpressionUpdater.update(cm,newExpressions);
}

Fixed version (ground truth):
public void updateRowExpressions(Map newExpressions){
  CompatibleExpressionUpdater.update(cm,newExpressions);
}
Program: 67410
Project: 67410
Buggy source:
public void close() throws DataException {
  try {
    List<T> keyList=new LinkedList<T>();
    keyList.addAll(this.numberAndIndex.keySet());
    Collections.sort(keyList,new NumberComparator<T>());
    int segs=keyList.size() / BLOCKNUMBER + 1;
    IOUtil.writeInt(output,segs);
    long intOffset=output.getOffset();
    DataOutputStream dout=new DataOutputStream(output);
    long[] offsets=new long[segs];
    Object[] boundaryValues=new Object[segs];
    for (int i=0; i < segs; i++) {
      IOUtil.writeLong(dout,0);
      boundaryValues[i]=keyList.get(i * BLOCKNUMBER);
    }
    for (int i=0; i < boundaryValues.length; i++) {
      IOUtil.writeObject(dout,boundaryValues[i]);
    }
    for (int i=0; i < segs; i++) {
      offsets[i]=output.getOffset();
      IOUtil.writeInt(dout,i == segs - 1 ? keyList.size() % BLOCKNUMBER : BLOCKNUMBER);
      for (int j=i * BLOCKNUMBER; j < (i + 1) * BLOCKNUMBER && j < keyList.size(); j++) {
        IOUtil.writeObject(dout,keyList.get(j));
        IOUtil.writeList(dout,numberAndIndex.get(keyList.get(j)));
      }
    }
    output.seek(intOffset);
    for (int i=0; i < offsets.length; i++) {
      IOUtil.writeLong(dout,offsets[i]);
    }
    output.close();
  }
 catch (  Exception e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
public void close() throws DataException {
  try {
    List<T> keyList=new LinkedList<T>();
    keyList.addAll(this.numberAndIndex.keySet());
    if (keyList.size() == 0) {
      output.close();
      return;
    }
    Collections.sort(keyList,new NumberComparator<T>());
    int segs=(keyList.size() - 1) / BLOCKNUMBER + 1;
    IOUtil.writeInt(output,segs);
    long intOffset=output.getOffset();
    DataOutputStream dout=new DataOutputStream(output);
    long[] offsets=new long[segs];
    Object[] boundaryValues=new Object[segs];
    for (int i=0; i < segs; i++) {
      IOUtil.writeLong(dout,0);
      boundaryValues[i]=keyList.get(i * BLOCKNUMBER);
    }
    for (int i=0; i < boundaryValues.length; i++) {
      IOUtil.writeObject(dout,boundaryValues[i]);
    }
    for (int i=0; i < segs; i++) {
      offsets[i]=output.getOffset();
      IOUtil.writeInt(dout,i == segs - 1 ? keyList.size() % BLOCKNUMBER : BLOCKNUMBER);
      for (int j=i * BLOCKNUMBER; j < (i + 1) * BLOCKNUMBER && j < keyList.size(); j++) {
        IOUtil.writeObject(dout,keyList.get(j));
        IOUtil.writeList(dout,numberAndIndex.get(keyList.get(j)));
      }
    }
    output.seek(intOffset);
    for (int i=0; i < offsets.length; i++) {
      IOUtil.writeLong(dout,offsets[i]);
    }
    output.close();
  }
 catch (  Exception e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}
Program: 67412
Project: 67412
Buggy source:
/** 
 * Find the value matcher in cube cursor. Based on sort direction and compared result, decide to move on/back along resultset.
 * @param rs
 * @param levelList
 * @param valueMap
 * @param aggrIndex
 * @return
 * @throws IOException 
 */
private boolean findValueMatcherOneByOne(IAggregationResultSet rs,List levelList,Map valueMap,int aggrIndex) throws IOException {
  int position=0;
  if (rs.length() <= 0 || levelList.isEmpty())   return true;
  while (position < rs.length()) {
    rs.seek(position);
    boolean match=true;
    for (int i=0; i < levelList.size(); i++) {
      DimLevel level=(DimLevel)levelList.get(i);
      Object value1=valueMap.get(level);
      Object value2=null;
      if (rs.getLevelKeyValue(rs.getLevelIndex(level)) != null)       value2=rs.getLevelKeyValue(rs.getLevelIndex(level))[rs.getLevelKeyColCount(rs.getLevelIndex(level)) - 1];
      ;
      if (value1 == value2) {
        continue;
      }
      if (value1 == null || value2 == null || !value1.equals(value2)) {
        match=false;
        break;
      }
    }
    if (match) {
      return true;
    }
 else {
      ++position;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Find the value matcher in cube cursor. Based on sort direction and compared result, decide to move on/back along resultset.
 * @param rs
 * @param levelList
 * @param valueMap
 * @param aggrIndex
 * @return
 * @throws IOException 
 */
private boolean findValueMatcherOneByOne(IAggregationResultSet rs,List levelList,Map valueMap,int aggrIndex) throws IOException {
  int position=0;
  if (rs.length() <= 0 || levelList.isEmpty())   return true;
  while (position < rs.length()) {
    rs.seek(position);
    boolean match=true;
    for (int i=0; i < levelList.size(); i++) {
      DimLevel level=(DimLevel)levelList.get(i);
      Object value1=valueMap.get(level);
      Object value2=null;
      int index=rs.getLevelIndex(level);
      Object[] keyValues=rs.getLevelKeyValue(index);
      if (keyValues != null)       value2=keyValues[rs.getLevelKeyColCount(index) - 1];
      ;
      if (value1 == value2) {
        continue;
      }
      if (value1 == null || value2 == null || !value1.equals(value2)) {
        match=false;
        break;
      }
    }
    if (match) {
      return true;
    }
 else {
      ++position;
    }
  }
  return false;
}
Program: 67414
Project: 67414
Buggy source:
public void setPaperTray(String paperTray){
  options.put(OPTION_PAPER_TRAY,paperTray);
}

Fixed version (ground truth):
public void setPaperTray(int paperTrayCode){
  options.put(OPTION_PAPER_TRAY,paperTrayCode);
}
Program: 67415
Project: 67415
Buggy source:
public String getPaperTray(){
  return getStringOption(OPTION_PAPER_TRAY);
}

Fixed version (ground truth):
public int getPaperTray(){
  return getIntOption(OPTION_PAPER_TRAY,IPostscriptRenderOption.TRAYCODE_AUTO);
}
Program: 67416
Project: 67416
Buggy source:
private void setPaperTray(String paperTray){
  if (paperTray != null) {
    out.println("String_Node_Str" + paperTray);
    out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
private void setPaperTray(int paperTrayCode){
  out.println("String_Node_Str");
  out.print("String_Node_Str");
  if (paperTrayCode == IPostscriptRenderOption.TRAYCODE_MANUAL) {
    out.println("String_Node_Str");
  }
 else   if (paperTrayCode == IPostscriptRenderOption.TRAYCODE_AUTO) {
    out.println("String_Node_Str");
  }
 else {
    out.println("String_Node_Str" + paperTrayCode + "String_Node_Str");
  }
  out.println("String_Node_Str");
}
Program: 67417
Project: 67417
Buggy source:
public void startRenderer(String author,String description,String paperSize,String paperTray,String duplex,int copies,boolean collate,int resolution,boolean gray,int scale) throws IOException {
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  int[] pageSize=getPaperSize(paperSize);
  int width=pageSize[0];
  int height=pageSize[1];
  setPaperSize(paperSize,width,height);
  setPaperTray(paperTray);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(gray);
  FileUtil.load("String_Node_Str",out);
  setScale(height,scale);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}

Fixed version (ground truth):
public void startRenderer(String author,String description,String paperSize,int paperTrayCode,String duplex,int copies,boolean collate,int resolution,boolean gray,int scale) throws IOException {
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  int[] pageSize=getPaperSize(paperSize);
  int width=pageSize[0];
  int height=pageSize[1];
  setPaperSize(paperSize,width,height);
  setPaperTray(paperTrayCode);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(gray);
  FileUtil.load("String_Node_Str",out);
  setScale(height,scale);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}
Program: 67418
Project: 67418
Buggy source:
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  String paperTray=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_TRAY);
  String duplex=renderOption.getStringOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  int resolution=renderOption.getIntOption(IPostscriptRenderOption.OPTION_RESOLUTION,0);
  boolean gray=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_GRAY,false);
  int scale=renderOption.getIntOption(IPostscriptRenderOption.OPTION_SCALE,100);
  writer.startRenderer(author,description,paperSize,paperTray,duplex,copies,collate,resolution,gray,scale);
}

Fixed version (ground truth):
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  int paperTrayCode=renderOption.getIntOption(PostscriptRenderOption.OPTION_PAPER_TRAY,IPostscriptRenderOption.TRAYCODE_AUTO);
  String duplex=renderOption.getStringOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  int resolution=renderOption.getIntOption(IPostscriptRenderOption.OPTION_RESOLUTION,0);
  boolean gray=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_GRAY,false);
  int scale=renderOption.getIntOption(IPostscriptRenderOption.OPTION_SCALE,100);
  writer.startRenderer(author,description,paperSize,paperTrayCode,duplex,copies,collate,resolution,gray,scale);
}
Program: 67419
Project: 67419
Buggy source:
void setPaperTray(String paperTray);

Fixed version (ground truth):
void setPaperTray(int paperTrayCode);
Program: 67420
Project: 67420
Buggy source:
String getPaperTray();

Fixed version (ground truth):
int getPaperTray();
Program: 67424
Project: 67424
Buggy source:
public void initialize() throws BirtException {
  IPageContent pageContent=(IPageContent)content;
  if (context.getEngineTaskType() == IEngineTask.TASK_RENDER) {
    if (context.isReserveDocumentPageNumbers()) {
      long number=pageContent.getPageNumber();
      if (number > 0) {
        context.setPageNumber(number);
      }
    }
 else {
      context.setPageNumber(context.getPageNumber() + 1);
      pageContent=createPageContent(pageContent);
    }
  }
 else {
    if (context.isAutoPageBreak()) {
      context.setPageNumber(context.getPageNumber() + 1);
      pageContent=createPageContent(pageContent);
    }
 else {
      long number=pageContent.getPageNumber();
      if (number > 0) {
        context.setPageNumber(number);
      }
    }
  }
  createNewPage(pageContent);
  maxAvaWidth=page.getBody().getWidth();
  width=maxAvaWidth;
}

Fixed version (ground truth):
public void initialize() throws BirtException {
  IPageContent pageContent=(IPageContent)content;
  if (context.getEngineTaskType() == IEngineTask.TASK_RENDER) {
    if (context.isFixedLayout()) {
      if (context.isReserveDocumentPageNumbers() && context.getHtmlLayoutContext() != null && context.getHtmlLayoutContext().isPaged()) {
        long number=pageContent.getPageNumber();
        if (number > 0) {
          context.setPageNumber(number);
        }
      }
 else {
        context.setPageNumber(context.getPageNumber() + 1);
        pageContent=createPageContent(pageContent);
      }
    }
 else {
      if (context.isReserveDocumentPageNumbers()) {
        long number=pageContent.getPageNumber();
        if (number > 0) {
          context.setPageNumber(number);
        }
      }
 else {
        context.setPageNumber(context.getPageNumber() + 1);
        pageContent=createPageContent(pageContent);
      }
    }
  }
 else {
    if (context.isAutoPageBreak()) {
      context.setPageNumber(context.getPageNumber() + 1);
      pageContent=createPageContent(pageContent);
    }
 else {
      long number=pageContent.getPageNumber();
      if (number > 0) {
        context.setPageNumber(number);
      }
    }
  }
  createNewPage(pageContent);
  maxAvaWidth=page.getBody().getWidth();
  width=maxAvaWidth;
}
Program: 67425
Project: 67425
Buggy source:
public void updateOKButtonStatus(boolean isEnabled){
  getOkButton().setEnabled(isEnabled);
}

Fixed version (ground truth):
public void updateOKButtonStatus(boolean isEnabled){
  if (getOkButton() != null)   getOkButton().setEnabled(isEnabled);
}
Program: 67426
Project: 67426
Buggy source:
private void recalculateAggregation(List<IAggregationResultRow> aggregationRows) throws DataException, IOException {
  Set<Integer> duplicatedIndex=new HashSet<Integer>();
  for (int i=0; i < aggregationRows.size(); i++) {
    this.calculator.start();
    List<Integer> positions=getRowsPositionInAggregationRows(i,aggregationRows);
    for (int k=0; k < positions.size(); k++) {
      this.calculator.onRow(aggregationRows.get(positions.get(k)));
      if (k != 0)       duplicatedIndex.add(positions.get(k));
    }
    this.calculator.finish(aggregationRows.get(i));
    Iterator<Integer> iter=duplicatedIndex.iterator();
    while (iter.hasNext()) {
      aggregationRows.remove(iter.next());
    }
    duplicatedIndex.clear();
  }
}

Fixed version (ground truth):
private void recalculateAggregation(List<IAggregationResultRow> aggregationRows) throws DataException, IOException {
  Set<Integer> duplicatedIndex=new HashSet<Integer>();
  for (int i=0; i < aggregationRows.size(); i++) {
    this.calculator.start();
    List<Integer> positions=getRowsPositionInAggregationRows(i,aggregationRows);
    for (int k=0; k < positions.size(); k++) {
      this.calculator.onRow(aggregationRows.get(positions.get(k)));
      if (k != 0)       duplicatedIndex.add(positions.get(k));
    }
    this.calculator.finish(aggregationRows.get(i));
    int baseIndex=0;
    Iterator<Integer> iter=duplicatedIndex.iterator();
    while (iter.hasNext()) {
      int index=iter.next().intValue();
      aggregationRows.remove(index - baseIndex);
      baseIndex++;
    }
    duplicatedIndex.clear();
  }
}
Program: 67427
Project: 67427
Buggy source:
public boolean canLeave(){
  try {
    ((OdaDataSetHandle)((DataSetEditor)getContainer()).getHandle()).setProperty(IOdaDataSetModel.RESULT_SET_NUMBER_PROP,null);
    ((OdaDataSetHandle)((DataSetEditor)getContainer()).getHandle()).setResultSetName(null);
    if (!updateResultSetSetting())     return true;
    return canLeavePage();
  }
 catch (  Exception e) {
    return true;
  }
}

Fixed version (ground truth):
public boolean canLeave(){
  try {
    ((OdaDataSetHandle)((DataSetEditor)getContainer()).getHandle()).setProperty(IOdaDataSetModel.RESULT_SET_NUMBER_PROP,null);
    ((OdaDataSetHandle)((DataSetEditor)getContainer()).getHandle()).setResultSetName(null);
    dealDataSetLocale();
    dealDataSetNullOrdering();
    if (!updateResultSetSetting())     return true;
    return canLeavePage();
  }
 catch (  Exception e) {
    return true;
  }
}