nus-yam/ex-repair huggingface dataset:
Program: 71081
Project: 71081
Buggy source:
protected void prepareDesign(){
  ReportRunnable runnable=executionContext.getRunnable();
  if (!runnable.prepared) {
    ReportDesignHandle reportDesign=executionContext.getDesign();
    ScriptedDesignSearcher searcher=new ScriptedDesignSearcher(reportDesign);
    searcher.apply(reportDesign);
    boolean hasOnprepare=searcher.hasOnPrepareScript();
    if (hasOnprepare) {
      ReportRunnable newRunnable=executionContext.getRunnable().cloneRunnable();
      ReportDesignHandle newDesign=newRunnable.designHandle;
      ScriptedDesignVisitor visitor=new ScriptedDesignHandler(newDesign,executionContext);
      visitor.apply(newDesign.getRoot());
      newRunnable.setPrepared(true);
      executionContext.updateRunnable(newRunnable);
    }
  }
}

Fixed version (ground truth):
protected void prepareDesign(){
  ReportRunnable runnable=executionContext.getRunnable();
  if (!runnable.prepared) {
    ReportDesignHandle reportDesign=executionContext.getDesign();
    ScriptedDesignSearcher searcher=new ScriptedDesignSearcher(reportDesign);
    searcher.apply(reportDesign);
    boolean hasOnprepare=searcher.hasOnPrepareScript();
    if (hasOnprepare) {
      ReportRunnable newRunnable=executionContext.getRunnable().cloneRunnable();
      executionContext.updateRunnable(newRunnable);
      ReportDesignHandle newDesign=newRunnable.designHandle;
      ScriptedDesignVisitor visitor=new ScriptedDesignHandler(newDesign,executionContext);
      visitor.apply(newDesign.getRoot());
      newRunnable.setPrepared(true);
    }
  }
}
Program: 71082
Project: 71082
Buggy source:
public void startPage(IPageContent page){
  emitter.startPage(page);
}

Fixed version (ground truth):
public void startPage(IPageContent page) throws BirtException {
  emitter.startPage(page);
}
Program: 71083
Project: 71083
Buggy source:
public void startContent(IContent content){
  emitter.startContent(content);
}

Fixed version (ground truth):
public void startContent(IContent content) throws BirtException {
  emitter.startContent(content);
}
Program: 71084
Project: 71084
Buggy source:
public void endTable(ITableContent table){
  emitter.endTable(table);
}

Fixed version (ground truth):
public void endTable(ITableContent table) throws BirtException {
  emitter.endTable(table);
}
Program: 71085
Project: 71085
Buggy source:
public void startForeign(IForeignContent foreign){
  emitter.startForeign(foreign);
}

Fixed version (ground truth):
public void startForeign(IForeignContent foreign) throws BirtException {
  emitter.startForeign(foreign);
}
Program: 71086
Project: 71086
Buggy source:
public void endListGroup(IListGroupContent group){
  emitter.endListGroup(group);
}

Fixed version (ground truth):
public void endListGroup(IListGroupContent group) throws BirtException {
  emitter.endListGroup(group);
}
Program: 71087
Project: 71087
Buggy source:
public void startGroup(IGroupContent group){
  emitter.startGroup(group);
}

Fixed version (ground truth):
public void startGroup(IGroupContent group) throws BirtException {
  emitter.startGroup(group);
}
Program: 71088
Project: 71088
Buggy source:
public void startLabel(ILabelContent label){
  emitter.startLabel(label);
}

Fixed version (ground truth):
public void startLabel(ILabelContent label) throws BirtException {
  emitter.startLabel(label);
}
Program: 71089
Project: 71089
Buggy source:
public void startTableGroup(ITableGroupContent group){
  emitter.startTableGroup(group);
}

Fixed version (ground truth):
public void startTableGroup(ITableGroupContent group) throws BirtException {
  emitter.startTableGroup(group);
}
Program: 71090
Project: 71090
Buggy source:
public void endContainer(IContainerContent container){
  emitter.endContainer(container);
}

Fixed version (ground truth):
public void endContainer(IContainerContent container) throws BirtException {
  emitter.endContainer(container);
}
Program: 71091
Project: 71091
Buggy source:
public void endContent(IContent content){
  emitter.endContent(content);
}

Fixed version (ground truth):
public void endContent(IContent content) throws BirtException {
  emitter.endContent(content);
}
Program: 71092
Project: 71092
Buggy source:
public void end(IReportContent report){
  emitter.end(report);
}

Fixed version (ground truth):
public void end(IReportContent report) throws BirtException {
  emitter.end(report);
}
Program: 71093
Project: 71093
Buggy source:
public void startImage(IImageContent image){
  emitter.startImage(image);
}

Fixed version (ground truth):
public void startImage(IImageContent image) throws BirtException {
  emitter.startImage(image);
}
Program: 71094
Project: 71094
Buggy source:
public void startTable(ITableContent table){
  emitter.startTable(table);
}

Fixed version (ground truth):
public void startTable(ITableContent table) throws BirtException {
  emitter.startTable(table);
}
Program: 71095
Project: 71095
Buggy source:
public void startContainer(IContainerContent container){
  emitter.startContainer(container);
}

Fixed version (ground truth):
public void startContainer(IContainerContent container) throws BirtException {
  emitter.startContainer(container);
}
Program: 71096
Project: 71096
Buggy source:
public void endGroup(IGroupContent group){
  emitter.endGroup(group);
}

Fixed version (ground truth):
public void endGroup(IGroupContent group) throws BirtException {
  emitter.endGroup(group);
}
Program: 71097
Project: 71097
Buggy source:
public void startData(IDataContent data){
  emitter.startData(data);
}

Fixed version (ground truth):
public void startData(IDataContent data) throws BirtException {
  emitter.startData(data);
}
Program: 71098
Project: 71098
Buggy source:
public void endTableGroup(ITableGroupContent group){
  emitter.endTableGroup(group);
}

Fixed version (ground truth):
public void endTableGroup(ITableGroupContent group) throws BirtException {
  emitter.endTableGroup(group);
}
Program: 71099
Project: 71099
Buggy source:
public void startRow(IRowContent row){
  emitter.startRow(row);
}

Fixed version (ground truth):
public void startRow(IRowContent row) throws BirtException {
  emitter.startRow(row);
}
Program: 71100
Project: 71100
Buggy source:
public void endListBand(IListBandContent listBand){
  emitter.endListBand(listBand);
}

Fixed version (ground truth):
public void endListBand(IListBandContent listBand) throws BirtException {
  emitter.endListBand(listBand);
}
Program: 71101
Project: 71101
Buggy source:
public void endTableBand(ITableBandContent band){
  emitter.endTableBand(band);
}

Fixed version (ground truth):
public void endTableBand(ITableBandContent band) throws BirtException {
  emitter.endTableBand(band);
}
Program: 71102
Project: 71102
Buggy source:
public void startListGroup(IListGroupContent group){
  emitter.startListGroup(group);
}

Fixed version (ground truth):
public void startListGroup(IListGroupContent group) throws BirtException {
  emitter.startListGroup(group);
}
Program: 71103
Project: 71103
Buggy source:
public void start(IReportContent report){
  emitter.start(report);
}

Fixed version (ground truth):
public void start(IReportContent report) throws BirtException {
  emitter.start(report);
}
Program: 71104
Project: 71104
Buggy source:
public void endRow(IRowContent row){
  emitter.endRow(row);
}

Fixed version (ground truth):
public void endRow(IRowContent row) throws BirtException {
  emitter.endRow(row);
}
Program: 71105
Project: 71105
Buggy source:
public void startCell(ICellContent cell){
  emitter.startCell(cell);
}

Fixed version (ground truth):
public void startCell(ICellContent cell) throws BirtException {
  emitter.startCell(cell);
}
Program: 71106
Project: 71106
Buggy source:
public void startAutoText(IAutoTextContent autoText){
  emitter.startAutoText(autoText);
}

Fixed version (ground truth):
public void startAutoText(IAutoTextContent autoText) throws BirtException {
  emitter.startAutoText(autoText);
}
Program: 71107
Project: 71107
Buggy source:
public void startList(IListContent list){
  emitter.startList(list);
}

Fixed version (ground truth):
public void startList(IListContent list) throws BirtException {
  emitter.startList(list);
}
Program: 71108
Project: 71108
Buggy source:
public void startTableBand(ITableBandContent band){
  emitter.startTableBand(band);
}

Fixed version (ground truth):
public void startTableBand(ITableBandContent band) throws BirtException {
  emitter.startTableBand(band);
}
Program: 71109
Project: 71109
Buggy source:
public void startListBand(IListBandContent listBand){
  emitter.startListBand(listBand);
}

Fixed version (ground truth):
public void startListBand(IListBandContent listBand) throws BirtException {
  emitter.startListBand(listBand);
}
Program: 71110
Project: 71110
Buggy source:
public void endCell(ICellContent cell){
  emitter.endCell(cell);
}

Fixed version (ground truth):
public void endCell(ICellContent cell) throws BirtException {
  emitter.endCell(cell);
}
Program: 71111
Project: 71111
Buggy source:
public void endList(IListContent list){
  emitter.endList(list);
}

Fixed version (ground truth):
public void endList(IListContent list) throws BirtException {
  emitter.endList(list);
}
Program: 71112
Project: 71112
Buggy source:
public void startText(ITextContent text){
  emitter.startText(text);
}

Fixed version (ground truth):
public void startText(ITextContent text) throws BirtException {
  emitter.startText(text);
}
Program: 71113
Project: 71113
Buggy source:
public void endPage(IPageContent page){
  emitter.endPage(page);
}

Fixed version (ground truth):
public void endPage(IPageContent page) throws BirtException {
  emitter.endPage(page);
}
Program: 71114
Project: 71114
Buggy source:
/** 
 * @throws Exception
 */
public void testNewAggregationOnComputedColumnWithFilter() throws Exception {
  ccName=new String[]{"String_Node_Str"};
  ccExpr=new String[]{"String_Node_Str"};
  List argument=new ArrayList();
  argument.add(new ScriptExpression("String_Node_Str"));
  ComputedColumn cc1=new ComputedColumn("String_Node_Str","String_Node_Str",DataType.INTEGER_TYPE,"String_Node_Str",null,argument);
  ((BaseDataSetDesign)this.dataSet).addComputedColumn(cc1);
  String[] bindingNameRow=new String[5];
  bindingNameRow[0]="String_Node_Str";
  bindingNameRow[1]="String_Node_Str";
  bindingNameRow[2]="String_Node_Str";
  bindingNameRow[3]="String_Node_Str";
  bindingNameRow[4]="String_Node_Str";
  ScriptExpression[] bindingExprRow=new ScriptExpression[]{new ScriptExpression("String_Node_Str" + "String_Node_Str",0),new ScriptExpression("String_Node_Str" + "String_Node_Str",0),new ScriptExpression("String_Node_Str" + "String_Node_Str",0),new ScriptExpression("String_Node_Str" + "String_Node_Str",0),new ScriptExpression("String_Node_Str" + ccName[0],DataType.INTEGER_TYPE)};
  FilterDefinition filter=new FilterDefinition(new ScriptExpression("String_Node_Str"));
  this.dataSet.addFilter(filter);
  IResultIterator resultIt=this.executeQuery(this.createQuery(null,null,null,null,null,null,null,null,null,bindingNameRow,bindingExprRow));
  printResult(resultIt,bindingNameRow,bindingExprRow);
  checkOutputFile();
}

Fixed version (ground truth):
/** 
 * @throws Exception
 */
public void testNewAggregationOnComputedColumnWithFilter() throws Exception {
  ccName=new String[]{"String_Node_Str"};
  ccExpr=new String[]{"String_Node_Str"};
  List argument=new ArrayList();
  argument.add(new ScriptExpression("String_Node_Str"));
  ComputedColumn cc1=new ComputedColumn("String_Node_Str","String_Node_Str",DataType.BOOLEAN_TYPE,"String_Node_Str",null,argument);
  ((BaseDataSetDesign)this.dataSet).addComputedColumn(cc1);
  String[] bindingNameRow=new String[5];
  bindingNameRow[0]="String_Node_Str";
  bindingNameRow[1]="String_Node_Str";
  bindingNameRow[2]="String_Node_Str";
  bindingNameRow[3]="String_Node_Str";
  bindingNameRow[4]="String_Node_Str";
  ScriptExpression[] bindingExprRow=new ScriptExpression[]{new ScriptExpression("String_Node_Str" + "String_Node_Str",0),new ScriptExpression("String_Node_Str" + "String_Node_Str",0),new ScriptExpression("String_Node_Str" + "String_Node_Str",0),new ScriptExpression("String_Node_Str" + "String_Node_Str",0),new ScriptExpression("String_Node_Str" + ccName[0],0)};
  FilterDefinition filter=new FilterDefinition(new ScriptExpression("String_Node_Str"));
  this.dataSet.addFilter(filter);
  IResultIterator resultIt=this.executeQuery(this.createQuery(null,null,null,null,null,null,null,null,null,bindingNameRow,bindingExprRow));
  printResult(resultIt,bindingNameRow,bindingExprRow);
  checkOutputFile();
}
Program: 71115
Project: 71115
Buggy source:
/** 
 * print resultset iterator
 * @param resultIt
 * @param bindingNameRow
 * @param bindingExprRow
 * @throws Exception
 */
private void printResult(IResultIterator resultIt,String[] bindingNameRow,ScriptExpression[] bindingExprRow) throws Exception {
  String str="String_Node_Str";
  for (int i=0; i < bindingNameRow.length; i++) {
    str+=bindingExprRow[i].getText().replaceAll("String_Node_Str","String_Node_Str");
    str+="String_Node_Str";
  }
  testPrintln(str);
  while (resultIt.next()) {
    str="String_Node_Str";
    for (int i=0; i < bindingNameRow.length; i++) {
      str+="String_Node_Str";
      if (resultIt.getValue(bindingNameRow[i]) == null)       str+="String_Node_Str";
 else       str+=(int)Double.parseDouble(resultIt.getValue(bindingNameRow[i]).toString());
      str+="String_Node_Str";
    }
    testPrintln(str);
  }
}

Fixed version (ground truth):
/** 
 * print resultset iterator
 * @param resultIt
 * @param bindingNameRow
 * @param bindingExprRow
 * @throws Exception
 */
private void printResult(IResultIterator resultIt,String[] bindingNameRow,ScriptExpression[] bindingExprRow) throws Exception {
  String str="String_Node_Str";
  for (int i=0; i < bindingNameRow.length; i++) {
    str+=bindingExprRow[i].getText().replaceAll("String_Node_Str","String_Node_Str");
    str+="String_Node_Str";
  }
  testPrintln(str);
  while (resultIt.next()) {
    str="String_Node_Str";
    for (int i=0; i < bindingNameRow.length; i++) {
      str+="String_Node_Str";
      if (resultIt.getValue(bindingNameRow[i]) == null)       str+="String_Node_Str";
 else       str+=(resultIt.getValue(bindingNameRow[i]) instanceof Double) ? (int)Double.parseDouble(resultIt.getValue(bindingNameRow[i]).toString()) : resultIt.getValue(bindingNameRow[i]);
      str+="String_Node_Str";
    }
    testPrintln(str);
  }
}
Program: 71116
Project: 71116
Buggy source:
public boolean next() throws BirtException {
  checkStarted();
  if (this.columnValueMap == null)   return false;
  currRowIndex++;
  readCurrentRow();
  return this.columnValueMap != null && this.columnValueMap.size() > 0;
}

Fixed version (ground truth):
public boolean next() throws BirtException {
  checkStarted();
  if (this.columnValueMap == null)   return false;
  if (lastRowIndex < currRowIndex) {
    currRowIndex++;
    readCurrentRow();
  }
 else {
    lastRowIndex=currRowIndex - 1;
  }
  return this.columnValueMap != null && this.columnValueMap.size() > 0;
}
Program: 71117
Project: 71117
Buggy source:
/** 
 * @param context
 * @param queryResultID
 * @throws DataException
 */
public CacheResultIterator(String tempDir,IQueryResults queryResults) throws DataException {
  Object[] params={tempDir,queryResults.getID()};
  logger.entering(CacheResultIterator.class.getName(),"String_Node_Str",params);
  this.columnValueMap=new HashMap();
  this.currRowIndex=-1;
  this.queryResults=queryResults;
  try {
    createCacheInputStream(tempDir);
    resultClass=new ResultClass(this.metaInputStream);
    rowCount=IOUtil.readInt(rowInputStream);
    if (rowCount == -1)     rowCount=Integer.MAX_VALUE;
    int columnSize=IOUtil.readInt(rowInputStream);
    columnList=new ArrayList();
    for (int i=0; i < columnSize; i++) {
      columnList.add(IOUtil.readObject(rowInputStream,DataEngineSession.getCurrentClassLoader()));
    }
    logger.exiting(CacheResultIterator.class.getName(),"String_Node_Str");
  }
 catch (  FileNotFoundException e) {
    throw new DataException(ResourceConstants.OPEN_CACHE_TEMPFILE_ERROR);
  }
catch (  IOException e) {
    throw new DataException(ResourceConstants.READ_CACHE_TEMPFILE_ERROR);
  }
}

Fixed version (ground truth):
/** 
 * @param context
 * @param queryResultID
 * @throws DataException
 */
public CacheResultIterator(String tempDir,IQueryResults queryResults) throws DataException {
  Object[] params={tempDir,queryResults.getID()};
  logger.entering(CacheResultIterator.class.getName(),"String_Node_Str",params);
  this.columnValueMap=new HashMap();
  this.currRowIndex=-1;
  this.lastRowIndex=this.currRowIndex - 1;
  this.queryResults=queryResults;
  try {
    createCacheInputStream(tempDir);
    resultClass=new ResultClass(this.metaInputStream);
    rowCount=IOUtil.readInt(rowInputStream);
    if (rowCount == -1)     rowCount=Integer.MAX_VALUE;
    int columnSize=IOUtil.readInt(rowInputStream);
    columnList=new ArrayList();
    for (int i=0; i < columnSize; i++) {
      columnList.add(IOUtil.readObject(rowInputStream,DataEngineSession.getCurrentClassLoader()));
    }
    logger.exiting(CacheResultIterator.class.getName(),"String_Node_Str");
  }
 catch (  FileNotFoundException e) {
    throw new DataException(ResourceConstants.OPEN_CACHE_TEMPFILE_ERROR);
  }
catch (  IOException e) {
    throw new DataException(ResourceConstants.READ_CACHE_TEMPFILE_ERROR);
  }
}
Program: 71118
Project: 71118
Buggy source:
public Object getValue(String name) throws BirtException {
  return columnValueMap.get(name);
}

Fixed version (ground truth):
public Object getValue(String name) throws BirtException {
  if (isBeforeFirst()) {
    this.next();
    this.lastRowIndex=this.currRowIndex;
  }
  return columnValueMap.get(name);
}
Program: 71119
Project: 71119
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)) {
      String bidiOrientation=DesignChoiceConstants.BIDI_DIRECTION_RTL;
      try {
        handle.setBidiOrientation(bidiOrientation);
        updateBidiStyle(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);
    if (Boolean.TRUE.equals(bidiFlag)) {
      if (!handle.isDirectionRTL()) {
        updateBidiStyle(true);
      }
    }
 else     if (Boolean.FALSE.equals(bidiFlag)) {
      if (handle.isDirectionRTL()) {
        updateBidiStyle(false);
      }
    }
  }
}
Program: 71120
Project: 71120
Buggy source:
protected void updateBidiStyle(String bidiOrientation){
}

Fixed version (ground truth):
private void updateBidiStyle(boolean isRtl){
  Report report=executionContext.getReport();
  AbstractStyle rootStyle=(AbstractStyle)report.getStyles().get(report.getRootStyleName());
  if (rootStyle != null) {
    rootStyle.setDirection(isRtl ? DesignChoiceConstants.BIDI_DIRECTION_RTL : DesignChoiceConstants.BIDI_DIRECTION_LTR);
  }
}
Program: 71124
Project: 71124
Buggy source:
public void testSourceQueryIV1withDistinct() throws Exception {
  this.genNotDistinctBasicIV();
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_PRESENTATION,fileName,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  QueryDefinition baseQuery=new QueryDefinition();
  baseQuery.setQueryResultsID(this.queryResultID);
  QueryDefinition query=new QueryDefinition();
  query.setSourceQuery(baseQuery);
  query.setDistinctValue(true);
  query.setStartingRow(1);
  ScriptExpression filterExpr=new ScriptExpression("String_Node_Str");
  query.addFilter(new FilterDefinition(filterExpr));
  SortDefinition sd=new SortDefinition();
  sd.setExpression("String_Node_Str");
  sd.setSortDirection(ISortDefinition.SORT_ASC);
  query.addSort(sd);
  _preBasicIV2(query);
  this.closeArchiveReader();
  this.checkOutputFile();
}

Fixed version (ground truth):
public void testSourceQueryIV1withDistinct() throws Exception {
  this.genNotDistinctBasicIV();
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_PRESENTATION,fileName,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  QueryDefinition baseQuery=new QueryDefinition();
  baseQuery.setQueryResultsID(this.queryResultID);
  QueryDefinition query=new QueryDefinition();
  query.setSourceQuery(baseQuery);
  query.setDistinctValue(true);
  query.setStartingRow(1);
  ScriptExpression filterExpr=new ScriptExpression("String_Node_Str");
  query.addFilter(new FilterDefinition(filterExpr));
  SortDefinition sd=new SortDefinition();
  sd.setExpression("String_Node_Str");
  sd.setSortDirection(ISortDefinition.SORT_ASC);
  query.addSort(sd);
  _preBasicIV3(query,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  this.closeArchiveReader();
  this.checkOutputFile();
}
Program: 71125
Project: 71125
Buggy source:
public void testSourceQueryIV1withDistinct1() throws Exception {
  this.genNotDistinctBasicIV();
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_PRESENTATION,fileName,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  QueryDefinition baseQuery=new QueryDefinition();
  baseQuery.setQueryResultsID(this.queryResultID);
  QueryDefinition query=new QueryDefinition();
  query.setSourceQuery(baseQuery);
  query.setDistinctValue(true);
  query.setMaxRows(3);
  ScriptExpression filterExpr=new ScriptExpression("String_Node_Str");
  query.addFilter(new FilterDefinition(filterExpr));
  SortDefinition sd=new SortDefinition();
  sd.setExpression("String_Node_Str");
  sd.setSortDirection(ISortDefinition.SORT_ASC);
  query.addSort(sd);
  _preBasicIV2(query);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  baseQuery=new QueryDefinition();
  baseQuery.setQueryResultsID(this.queryResultID);
  query=new QueryDefinition();
  query.setSourceQuery(baseQuery);
  query.setDistinctValue(false);
  query.setMaxRows(3);
  filterExpr=new ScriptExpression("String_Node_Str");
  query.addFilter(new FilterDefinition(filterExpr));
  sd=new SortDefinition();
  sd.setExpression("String_Node_Str");
  sd.setSortDirection(ISortDefinition.SORT_ASC);
  query.addSort(sd);
  _preBasicIV2(query);
  this.closeArchiveReader();
  this.checkOutputFile();
}

Fixed version (ground truth):
public void testSourceQueryIV1withDistinct1() throws Exception {
  this.genNotDistinctBasicIV();
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_PRESENTATION,fileName,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  QueryDefinition baseQuery=new QueryDefinition();
  baseQuery.setQueryResultsID(this.queryResultID);
  QueryDefinition query=new QueryDefinition();
  query.setSourceQuery(baseQuery);
  query.setDistinctValue(true);
  query.setMaxRows(3);
  ScriptExpression filterExpr=new ScriptExpression("String_Node_Str");
  query.addFilter(new FilterDefinition(filterExpr));
  SortDefinition sd=new SortDefinition();
  sd.setExpression("String_Node_Str");
  sd.setSortDirection(ISortDefinition.SORT_ASC);
  query.addSort(sd);
  _preBasicIV3(query,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  baseQuery=new QueryDefinition();
  baseQuery.setQueryResultsID(this.queryResultID);
  query=new QueryDefinition();
  query.setSourceQuery(baseQuery);
  query.setDistinctValue(false);
  query.setMaxRows(3);
  filterExpr=new ScriptExpression("String_Node_Str");
  query.addFilter(new FilterDefinition(filterExpr));
  sd=new SortDefinition();
  sd.setExpression("String_Node_Str");
  sd.setSortDirection(ISortDefinition.SORT_ASC);
  query.addSort(sd);
  _preBasicIV3(query,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  this.closeArchiveReader();
  this.checkOutputFile();
}
Program: 71126
Project: 71126
Buggy source:
public void testSourceQueryIV1withDistinct2() throws Exception {
  this.genNotDistinctBasicIV();
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_PRESENTATION,fileName,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  QueryDefinition baseQuery=new QueryDefinition();
  baseQuery.setQueryResultsID(this.queryResultID);
  QueryDefinition query=new QueryDefinition();
  query.setSourceQuery(baseQuery);
  query.setDistinctValue(true);
  query.setStartingRow(1);
  ScriptExpression filterExpr=new ScriptExpression("String_Node_Str");
  query.addFilter(new FilterDefinition(filterExpr));
  SortDefinition sd=new SortDefinition();
  sd.setExpression("String_Node_Str");
  sd.setSortDirection(ISortDefinition.SORT_ASC);
  query.addSort(sd);
  _preBasicIV2(query);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  baseQuery=new QueryDefinition();
  baseQuery.setQueryResultsID(this.queryResultID);
  query=new QueryDefinition();
  query.setSourceQuery(baseQuery);
  query.setDistinctValue(true);
  query.setStartingRow(1);
  query.setMaxRows(4);
  filterExpr=new ScriptExpression("String_Node_Str");
  query.addFilter(new FilterDefinition(filterExpr));
  sd=new SortDefinition();
  sd.setExpression("String_Node_Str");
  sd.setSortDirection(ISortDefinition.SORT_ASC);
  query.addSort(sd);
  _preBasicIV2(query);
  this.closeArchiveReader();
  this.checkOutputFile();
}

Fixed version (ground truth):
public void testSourceQueryIV1withDistinct2() throws Exception {
  this.genNotDistinctBasicIV();
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_PRESENTATION,fileName,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  QueryDefinition baseQuery=new QueryDefinition();
  baseQuery.setQueryResultsID(this.queryResultID);
  QueryDefinition query=new QueryDefinition();
  query.setSourceQuery(baseQuery);
  query.setDistinctValue(true);
  query.setStartingRow(1);
  ScriptExpression filterExpr=new ScriptExpression("String_Node_Str");
  query.addFilter(new FilterDefinition(filterExpr));
  SortDefinition sd=new SortDefinition();
  sd.setExpression("String_Node_Str");
  sd.setSortDirection(ISortDefinition.SORT_ASC);
  query.addSort(sd);
  _preBasicIV3(query,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  baseQuery=new QueryDefinition();
  baseQuery.setQueryResultsID(this.queryResultID);
  query=new QueryDefinition();
  query.setSourceQuery(baseQuery);
  query.setDistinctValue(true);
  query.setStartingRow(1);
  query.setMaxRows(4);
  filterExpr=new ScriptExpression("String_Node_Str");
  query.addFilter(new FilterDefinition(filterExpr));
  sd=new SortDefinition();
  sd.setExpression("String_Node_Str");
  sd.setSortDirection(ISortDefinition.SORT_ASC);
  query.addSort(sd);
  _preBasicIV3(query,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  this.closeArchiveReader();
  this.checkOutputFile();
}
Program: 71127
Project: 71127
Buggy source:
/** 
 */
public void test_regression_146787(){
  MetaDataDictionary instance=MetaDataDictionary.getInstance();
  PredefinedStyle dataStyle=instance.getPredefinedStyle("String_Node_Str");
  assertNotNull(dataStyle);
  boolean data=false;
  List list=instance.getPredefinedStyles();
  for (int i=0; i < list.size(); i++) {
    PredefinedStyle style=(PredefinedStyle)list.get(i);
    if (style.getName().equals("String_Node_Str"))     data=true;
  }
  assertTrue(data);
}

Fixed version (ground truth):
/** 
 */
public void test_regression_146787(){
  MetaDataDictionary instance=MetaDataDictionary.getInstance();
  PredefinedStyle dataStyle=(PredefinedStyle)instance.getPredefinedStyle("String_Node_Str");
  assertNotNull(dataStyle);
  boolean data=false;
  List list=instance.getPredefinedStyles();
  for (int i=0; i < list.size(); i++) {
    PredefinedStyle style=(PredefinedStyle)list.get(i);
    if (style.getName().equals("String_Node_Str"))     data=true;
  }
  assertTrue(data);
}
Program: 71128
Project: 71128
Buggy source:
public void startTableGroup(ITableGroupContent group){
  writeGroupToc(group);
}

Fixed version (ground truth):
public void startTableGroup(ITableGroupContent group){
  setGroupToc(group);
}
Program: 71129
Project: 71129
Buggy source:
public void startTable(ITableContent table){
  adjustInline();
  styles.push(table.getComputedStyle());
  writeBookmark(table);
  writeToc(table);
  increaseTOCLevel(table);
  String caption=table.getCaption();
  if (caption != null) {
    wordWriter.writeCaption(caption);
  }
  if (context.isLastTable()) {
    wordWriter.insertHiddenParagraph();
  }
  int width=WordUtil.convertTo(table.getWidth(),context.getCurrentWidth());
  width=Math.min(width,context.getCurrentWidth());
  wordWriter.startTable(table.getComputedStyle(),width);
  int[] cols=computeTblColumnWidths(table,width);
  wordWriter.writeColumn(cols);
  context.addTable(cols,table.getComputedStyle());
}

Fixed version (ground truth):
public void startTable(ITableContent table){
  adjustInline();
  styles.push(table.getComputedStyle());
  writeBookmark(table);
  Object tableToc=table.getTOC();
  if (tableToc != null) {
    tableTocs.add(new TocInfo(tableToc.toString(),tocLevel));
  }
  increaseTOCLevel(table);
  String caption=table.getCaption();
  if (caption != null) {
    wordWriter.writeCaption(caption);
  }
  if (context.isLastTable()) {
    wordWriter.insertHiddenParagraph();
  }
  int width=WordUtil.convertTo(table.getWidth(),context.getCurrentWidth());
  width=Math.min(width,context.getCurrentWidth());
  wordWriter.startTable(table.getComputedStyle(),width);
  int[] cols=computeTblColumnWidths(table,width);
  wordWriter.writeColumn(cols);
  context.addTable(cols,table.getComputedStyle());
}
Program: 71130
Project: 71130
Buggy source:
public void startListGroup(IListGroupContent group){
  writeGroupToc(group);
}

Fixed version (ground truth):
public void startListGroup(IListGroupContent group){
  setGroupToc(group);
}
Program: 71131
Project: 71131
Buggy source:
public void startList(IListContent list){
  adjustInline();
  styles.push(list.getComputedStyle());
  writeBookmark(list);
  writeToc(list);
  increaseTOCLevel(list);
  if (context.isLastTable()) {
    wordWriter.insertHiddenParagraph();
  }
  wordWriter.startTable(list.getComputedStyle(),context.getCurrentWidth());
}

Fixed version (ground truth):
public void startList(IListContent list){
  adjustInline();
  styles.push(list.getComputedStyle());
  writeBookmark(list);
  Object listToc=list.getTOC();
  if (listToc != null) {
    tableTocs.add(new TocInfo(listToc.toString(),tocLevel));
  }
  increaseTOCLevel(list);
  if (context.isLastTable()) {
    wordWriter.insertHiddenParagraph();
  }
  wordWriter.startTable(list.getComputedStyle(),context.getCurrentWidth());
}
Program: 71132
Project: 71132
Buggy source:
public void startListBand(IListBandContent listBand){
  context.startCell();
  wordWriter.startTableRow(-1);
  IStyle style=computeStyle(listBand.getComputedStyle());
  wordWriter.startTableCell(context.getCurrentWidth(),style,null);
}

Fixed version (ground truth):
public void startListBand(IListBandContent listBand){
  context.startCell();
  wordWriter.startTableRow(-1);
  IStyle style=computeStyle(listBand.getComputedStyle());
  wordWriter.startTableCell(context.getCurrentWidth(),style,null);
  writeTableToc();
}
Program: 71133
Project: 71133
Buggy source:
public void startGroup(IGroupContent group){
  writeGroupToc(group);
}

Fixed version (ground truth):
public void startGroup(IGroupContent group){
  setGroupToc(group);
}
Program: 71134
Project: 71134
Buggy source:
public void startCell(ICellContent cell){
  rowFilledFlag=true;
  context.startCell();
  int columnId=cell.getColumn();
  List<SpanInfo> spans=context.getSpans(columnId);
  if (spans != null) {
    for (int i=0; i < spans.size(); i++) {
      wordWriter.writeSpanCell(spans.get(i));
    }
  }
  int columnSpan=cell.getColSpan();
  int rowSpan=cell.getRowSpan();
  int cellWidth=context.getCellWidth(columnId,columnSpan);
  IStyle style=computeStyle(cell.getComputedStyle());
  if (rowSpan > 1) {
    context.addSpan(columnId,columnSpan,cellWidth,rowSpan,style);
  }
  SpanInfo info=null;
  if (columnSpan > 1 || rowSpan > 1) {
    info=new SpanInfo(columnId,columnSpan,cellWidth,true,style);
  }
  wordWriter.startTableCell(cellWidth,style,info);
  context.addWidth(getCellWidth(cellWidth,style));
}

Fixed version (ground truth):
public void startCell(ICellContent cell){
  rowFilledFlag=true;
  context.startCell();
  int columnId=cell.getColumn();
  List<SpanInfo> spans=context.getSpans(columnId);
  if (spans != null) {
    for (int i=0; i < spans.size(); i++) {
      wordWriter.writeSpanCell(spans.get(i));
    }
  }
  int columnSpan=cell.getColSpan();
  int rowSpan=cell.getRowSpan();
  int cellWidth=context.getCellWidth(columnId,columnSpan);
  IStyle style=computeStyle(cell.getComputedStyle());
  if (rowSpan > 1) {
    context.addSpan(columnId,columnSpan,cellWidth,rowSpan,style);
  }
  SpanInfo info=null;
  if (columnSpan > 1 || rowSpan > 1) {
    info=new SpanInfo(columnId,columnSpan,cellWidth,true,style);
  }
  wordWriter.startTableCell(cellWidth,style,info);
  context.addWidth(getCellWidth(cellWidth,style));
  writeTableToc();
}
Program: 71135
Project: 71135
Buggy source:
public void startForeign(IForeignContent foreign) throws BirtException {
  if (IForeignContent.HTML_TYPE.equalsIgnoreCase(foreign.getRawType())) {
    inForeign=true;
    boolean inlineBrother=!context.isFirstInline();
    context.endInline();
    writeToc(foreign);
    HTML2Content.html2Content(foreign);
    context.startCell();
    if (context.isLastTable()) {
      wordWriter.insertHiddenParagraph();
    }
    wordWriter.startTable(foreign.getComputedStyle(),context.getCurrentWidth());
    wordWriter.startTableRow(-1);
    wordWriter.startTableCell(context.getCurrentWidth(),foreign.getComputedStyle(),null);
    contentVisitor.visitChildren(foreign,null);
    adjustInline();
    wordWriter.endTableCell(context.needEmptyP());
    context.endCell();
    wordWriter.endTableRow();
    wordWriter.endTable();
    context.setLastIsTable(true);
    context.addContainer(true);
    hasPInside=false;
    if (inlineBrother) {
      context.startInline();
    }
    inForeign=false;
  }
 else {
    Object rawValue=foreign.getRawValue();
    String text=rawValue == null ? "String_Node_Str" : rawValue.toString();
    writeContent(DocEmitterImpl.NORMAL,text,foreign);
  }
}

Fixed version (ground truth):
public void startForeign(IForeignContent foreign) throws BirtException {
  if (IForeignContent.HTML_TYPE.equalsIgnoreCase(foreign.getRawType())) {
    inForeign=true;
    boolean inlineBrother=!context.isFirstInline();
    context.endInline();
    HTML2Content.html2Content(foreign);
    context.startCell();
    if (context.isLastTable()) {
      wordWriter.insertHiddenParagraph();
    }
    wordWriter.startTable(foreign.getComputedStyle(),context.getCurrentWidth());
    wordWriter.startTableRow(-1);
    wordWriter.startTableCell(context.getCurrentWidth(),foreign.getComputedStyle(),null);
    writeToc(foreign);
    contentVisitor.visitChildren(foreign,null);
    adjustInline();
    wordWriter.endTableCell(context.needEmptyP());
    context.endCell();
    wordWriter.endTableRow();
    wordWriter.endTable();
    context.setLastIsTable(true);
    context.addContainer(true);
    hasPInside=false;
    if (inlineBrother) {
      context.startInline();
    }
    inForeign=false;
  }
 else {
    Object rawValue=foreign.getRawValue();
    String text=rawValue == null ? "String_Node_Str" : rawValue.toString();
    writeContent(DocEmitterImpl.NORMAL,text,foreign);
  }
}
Program: 71137
Project: 71137
Buggy source:
/** 
 * Test accept() method.
 */
public void testAccept(){
  Object value=new Object();
  IContentVisitor visitor=new ContentVisitorAdapter();
  Object value1=content.accept(visitor,value);
  assertEquals(value,value1);
  value1=content.accept(visitor,null);
  assertNull(value1);
}

Fixed version (ground truth):
/** 
 * Test accept() method.
 * @throws BirtException 
 */
public void testAccept() throws BirtException {
  Object value=new Object();
  IContentVisitor visitor=new ContentVisitorAdapter();
  Object value1=content.accept(visitor,value);
  assertEquals(value,value1);
  value1=content.accept(visitor,null);
  assertNull(value1);
}
Program: 71138
Project: 71138
Buggy source:
public Chart fromXml(ByteArrayInputStream byais,boolean bStripHeaders) throws IOException {
  ResourceSet rsChart=new ResourceSetImpl();
  rsChart.getResourceFactoryRegistry().getExtensionToFactoryMap().put("String_Node_Str",new ModelResourceFactoryImpl());
  Resource rChart=rsChart.createResource(URI.createFileURI("String_Node_Str"));
  Map<String,Object> options=new HashMap<String,Object>();
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  if (bStripHeaders) {
    options.put(XMLResource.OPTION_DECLARE_XML,Boolean.FALSE);
  }
  rChart.load(byais,options);
  return (Chart)rChart.getContents().get(0);
}

Fixed version (ground truth):
public Chart fromXml(ByteArrayInputStream byais,boolean bStripHeaders) throws IOException {
  ResourceSet rsChart=new ResourceSetImpl();
  rsChart.getResourceFactoryRegistry().getExtensionToFactoryMap().put("String_Node_Str",new ModelResourceFactoryImpl());
  Resource rChart=rsChart.createResource(URI.createFileURI("String_Node_Str"));
  Map<String,Object> options=new HashMap<String,Object>();
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  if (bStripHeaders) {
    options.put(XMLResource.OPTION_DECLARE_XML,Boolean.FALSE);
  }
  try {
    rChart.load(byais,options);
  }
 catch (  IOWrappedException e) {
    if (rChart.getContents() == null || rChart.getContents().isEmpty()) {
      throw e;
    }
  }
  return (Chart)rChart.getContents().get(0);
}
Program: 71142
Project: 71142
Buggy source:
private boolean checkGif() throws IOException {
  final byte[] GIF_MAGIC_87A={0x46,0x38,0x37,0x61};
  final byte[] GIF_MAGIC_89A={0x46,0x38,0x39,0x61};
  byte[] array=new byte[11];
  if (read(array) != array.length)   return false;
  if ((!equals(array,0,GIF_MAGIC_89A,0,4)) && (!equals(array,0,GIF_MAGIC_87A,0,4)))   return false;
  format=FORMAT_GIF;
  width=getShortLittleEndian(array,4);
  height=getShortLittleEndian(array,6);
  int flags=array[8] & 0xff;
  if ((flags & 0x80) != 0) {
    int tableSize=(1 << ((flags & 7) + 1)) * 3;
    skip(tableSize);
  }
  int blockType;
  do {
    blockType=read();
switch (blockType) {
case (0x2c):
      if (read(array,0,9) != 9) {
        return false;
      }
    flags=array[8] & 0xff;
  int localBitsPerPixel=(flags & 0x07) + 1;
if ((flags & 0x80) != 0) {
  skip((1 << localBitsPerPixel) * 3);
}
skip(1);
case (0x21):
int n;
do {
n=read();
if (n > 0) {
skip(n);
}
 else if (n == -1) {
return false;
}
}
 while (n > 0);
break;
case (0x3b):
break;
default :
return false;
}
}
 while (blockType != 0x3b);
return true;
}

Fixed version (ground truth):
private boolean checkGif() throws IOException {
  final byte[] GIF_MAGIC_87A={0x46,0x38,0x37,0x61};
  final byte[] GIF_MAGIC_89A={0x46,0x38,0x39,0x61};
  byte[] array=new byte[11];
  if (read(array) != array.length)   return false;
  if ((!equals(array,0,GIF_MAGIC_89A,0,4)) && (!equals(array,0,GIF_MAGIC_87A,0,4)))   return false;
  format=FORMAT_GIF;
  width=getShortLittleEndian(array,4);
  height=getShortLittleEndian(array,6);
  int flags=array[8] & 0xff;
  bitsPerPixel=((flags >> 4) & 0x07) + 1;
  if ((flags & 0x80) != 0) {
    int tableSize=(1 << ((flags & 7) + 1)) * 3;
    skip(tableSize);
  }
  int blockType;
  do {
    blockType=read();
switch (blockType) {
case (0x2c):
      if (read(array,0,9) != 9) {
        return false;
      }
    flags=array[8] & 0xff;
  progressive=(flags & 0x40) != 0;
int localBitsPerPixel=(flags & 0x07) + 1;
if (localBitsPerPixel > bitsPerPixel) {
bitsPerPixel=localBitsPerPixel;
}
if ((flags & 0x80) != 0) {
skip((1 << localBitsPerPixel) * 3);
}
skip(1);
int n;
do {
n=read();
if (n > 0) {
skip(n);
}
 else if (n == -1) {
return false;
}
}
 while (n > 0);
break;
case (0x21):
int extensionType=read();
if (collectComments && extensionType == 0xfe) {
StringBuffer sb=new StringBuffer();
int n1;
do {
n1=read();
if (n1 == -1) {
return false;
}
if (n1 > 0) {
for (int i=0; i < n1; i++) {
int ch=read();
if (ch == -1) {
return false;
}
sb.append((char)ch);
}
}
}
 while (n1 > 0);
}
 else {
int m;
do {
m=read();
if (m > 0) {
skip(m);
}
 else if (m == -1) {
return false;
}
}
 while (m > 0);
}
break;
case (0x3b):
break;
default :
return false;
}
}
 while (blockType != 0x3b);
return true;
}
Program: 71143
Project: 71143
Buggy source:
private boolean checkBmp() throws IOException {
  byte[] array=new byte[44];
  if (read(array) != array.length)   return false;
  width=getIntLittleEndian(array,16);
  height=getIntLittleEndian(array,20);
  if (width < 1 || height < 1)   return false;
  int bitsPerPixel=getShortLittleEndian(array,26);
  if (bitsPerPixel != 1 && bitsPerPixel != 4 && bitsPerPixel != 8 && bitsPerPixel != 16 && bitsPerPixel != 24 && bitsPerPixel != 32)   return false;
  int physicalWidthDpi=(int)(getIntLittleEndian(array,36) * 0.0254);
  if (physicalWidthDpi > 0)   setPhysicalWidthDpi(physicalWidthDpi);
  int physicalHeightDpi=(int)(getIntLittleEndian(array,40) * 0.0254);
  if (physicalHeightDpi > 0)   setPhysicalHeightDpi(physicalHeightDpi);
  format=FORMAT_BMP;
  return true;
}

Fixed version (ground truth):
private boolean checkBmp() throws IOException {
  byte[] array=new byte[44];
  if (read(array) != array.length)   return false;
  width=getIntLittleEndian(array,16);
  height=getIntLittleEndian(array,20);
  if (width < 1 || height < 1)   return false;
  bitsPerPixel=getShortLittleEndian(array,26);
  if (bitsPerPixel != 1 && bitsPerPixel != 4 && bitsPerPixel != 8 && bitsPerPixel != 16 && bitsPerPixel != 24 && bitsPerPixel != 32)   return false;
  int physicalWidthDpi=(int)(getIntLittleEndian(array,36) * 0.0254);
  if (physicalWidthDpi > 0)   setPhysicalWidthDpi(physicalWidthDpi);
  int physicalHeightDpi=(int)(getIntLittleEndian(array,40) * 0.0254);
  if (physicalHeightDpi > 0)   setPhysicalHeightDpi(physicalHeightDpi);
  format=FORMAT_BMP;
  return true;
}
Program: 71144
Project: 71144
Buggy source:
private boolean checkPng() throws IOException {
  final byte[] PNG_MAGIC={0x4e,0x47,0x0d,0x0a,0x1a,0x0a};
  byte[] array=new byte[27];
  if (read(array) != array.length) {
    return false;
  }
  if (!equals(array,0,PNG_MAGIC,0,6)) {
    return false;
  }
  format=FORMAT_PNG;
  width=getIntBigEndian(array,14);
  height=getIntBigEndian(array,18);
  return true;
}

Fixed version (ground truth):
private boolean checkPng() throws IOException {
  final byte[] PNG_MAGIC={0x4e,0x47,0x0d,0x0a,0x1a,0x0a};
  byte[] array=new byte[27];
  if (read(array) != array.length) {
    return false;
  }
  if (!equals(array,0,PNG_MAGIC,0,6)) {
    return false;
  }
  format=FORMAT_PNG;
  width=getIntBigEndian(array,14);
  height=getIntBigEndian(array,18);
  bitsPerPixel=array[22] & 0xff;
  int colorType=array[23] & 0xff;
  if (colorType == 2 || colorType == 6) {
    bitsPerPixel*=3;
  }
  progressive=(array[26] & 0xff) != 0;
  return true;
}
Program: 71145
Project: 71145
Buggy source:
public String getMimeType(){
  if (format >= 0 && format < MIME_TYPE_STRINGS.length) {
    return format == FORMAT_JPEG ? "String_Node_Str" : MIME_TYPE_STRINGS[format];
  }
  return null;
}

Fixed version (ground truth):
public String getMimeType(){
  if (format >= 0 && format < MIME_TYPE_STRINGS.length) {
    if (format == FORMAT_JPEG && progressive) {
      return "String_Node_Str";
    }
    return MIME_TYPE_STRINGS[format];
  }
 else {
    return null;
  }
}
Program: 71146
Project: 71146
Buggy source:
public boolean check(){
  format=-1;
  width=-1;
  height=-1;
  heightDpi=-1;
  widthDpi=-1;
  try {
    int byte1=read() & 0xff;
    int byte2=read() & 0xff;
    if (byte1 == 0x47 && byte2 == 0x49)     return checkGif();
 else     if (byte1 == 0x89 && byte2 == 0x50)     return checkPng();
 else     if (byte1 == 0xff && byte2 == 0xd8)     return checkJpeg();
 else     if (byte1 == 0x42 && byte2 == 0x4d)     return checkBmp();
 else     return false;
  }
 catch (  IOException ioe) {
    return false;
  }
}

Fixed version (ground truth):
public boolean check(){
  format=-1;
  width=-1;
  height=-1;
  bitsPerPixel=-1;
  heightDpi=-1;
  widthDpi=-1;
  try {
    int byte1=read() & 0xff;
    int byte2=read() & 0xff;
    if (byte1 == 0x47 && byte2 == 0x49)     return checkGif();
 else     if (byte1 == 0x89 && byte2 == 0x50)     return checkPng();
 else     if (byte1 == 0xff && byte2 == 0xd8)     return checkJpeg();
 else     if (byte1 == 0x42 && byte2 == 0x4d)     return checkBmp();
 else     return false;
  }
 catch (  IOException ioe) {
    return false;
  }
}
Program: 71149
Project: 71149
Buggy source:
public void endPage(IPageContent page){
  logger.log(Level.FINE,"String_Node_Str");
  writer.closeTag(HTMLTags.TAG_TD);
  if (page != null && outputMasterPageContent && outputMasterPageMargins) {
    outputHMargin(page.getMarginRight());
  }
  writer.closeTag(HTMLTags.TAG_TR);
  if (page != null && outputMasterPageContent) {
    if (showPageFooter(page)) {
      writer.openTag(HTMLTags.TAG_TR);
      if (outputMasterPageMargins) {
        outputHMargin(page.getMarginLeft());
      }
      outputPageBand(page,page.getPageFooter());
      if (outputMasterPageMargins) {
        outputHMargin(page.getMarginRight());
      }
      writer.closeTag(HTMLTags.TAG_TR);
    }
    if (outputMasterPageMargins) {
      outputVMargin(page.getMarginBottom());
    }
  }
  writer.closeTag(HTMLTags.TAG_TABLE);
}

Fixed version (ground truth):
public void endPage(IPageContent page) throws BirtException {
  logger.log(Level.FINE,"String_Node_Str");
  writer.closeTag(HTMLTags.TAG_TD);
  if (page != null && outputMasterPageContent && outputMasterPageMargins) {
    outputHMargin(page.getMarginRight());
  }
  writer.closeTag(HTMLTags.TAG_TR);
  if (page != null && outputMasterPageContent) {
    if (showPageFooter(page)) {
      writer.openTag(HTMLTags.TAG_TR);
      if (outputMasterPageMargins) {
        outputHMargin(page.getMarginLeft());
      }
      outputPageBand(page,page.getPageFooter());
      if (outputMasterPageMargins) {
        outputHMargin(page.getMarginRight());
      }
      writer.closeTag(HTMLTags.TAG_TR);
    }
    if (outputMasterPageMargins) {
      outputVMargin(page.getMarginBottom());
    }
  }
  writer.closeTag(HTMLTags.TAG_TABLE);
}
Program: 71150
Project: 71150
Buggy source:
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);
}

Fixed version (ground truth):
private void outputPageBand(IPageContent page,IContent band) throws BirtException {
  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: 71152
Project: 71152
Buggy source:
public PageDeviceRender createRender(IEmitterServices services){
  return new PDFRender(services);
}

Fixed version (ground truth):
public PageDeviceRender createRender(IEmitterServices services) throws EngineException {
  return new PDFRender(services);
}