nus-yam/ex-repair huggingface dataset:
Program: 74580
Project: 74580
Buggy source:
/** 
 * @throws IOException
 * @throws BirtException
 */
public void testDimensionGetAll() throws IOException, BirtException {
  ILevelDefn[] levelDefs=new ILevelDefn[4];
  levelDefs[0]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[1]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[2]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[3]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  IDocumentManager documentManager=DocumentManagerFactory.createFileDocumentManager();
  IDimension dimension=DimensionFactory.createDimension("String_Node_Str",documentManager,new FourLevelDataset(),levelDefs,false);
  assertEquals(dimension.isTime(),false);
  IHierarchy hierarchy=dimension.getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  Dimension realDimension=(Dimension)dimension;
  IDiskArray result=realDimension.getAllRows();
  for (int i=0; i < result.size(); i++) {
    DimensionRow dimRow=(DimensionRow)(result.get(i));
    assertEquals(dimRow.getMembers()[0].getKeyValues()[0],FourLevelDataset.Level1Col[i]);
    assertEquals(dimRow.getMembers()[1].getKeyValues()[0],FourLevelDataset.Level2Col[i]);
    assertEquals(dimRow.getMembers()[2].getKeyValues()[0],FourLevelDataset.Level3Col[i]);
    assertEquals(dimRow.getMembers()[3].getKeyValues()[0],FourLevelDataset.Level4Col[i]);
  }
}

Fixed version (ground truth):
/** 
 * @throws IOException
 * @throws BirtException
 */
public void testDimensionGetAll() throws IOException, BirtException {
  ILevelDefn[] levelDefs=new ILevelDefn[4];
  levelDefs[0]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[1]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[2]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[3]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  IDocumentManager documentManager=DocumentManagerFactory.createFileDocumentManager();
  IDimension dimension=DimensionFactory.createDimension("String_Node_Str",documentManager,new FourLevelDataset(),levelDefs,false);
  assertEquals(dimension.isTime(),false);
  IHierarchy hierarchy=dimension.getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  Dimension realDimension=(Dimension)dimension;
  IDiskArray result=realDimension.getAllRows(new StopSign());
  for (int i=0; i < result.size(); i++) {
    DimensionRow dimRow=(DimensionRow)(result.get(i));
    assertEquals(dimRow.getMembers()[0].getKeyValues()[0],FourLevelDataset.Level1Col[i]);
    assertEquals(dimRow.getMembers()[1].getKeyValues()[0],FourLevelDataset.Level2Col[i]);
    assertEquals(dimRow.getMembers()[2].getKeyValues()[0],FourLevelDataset.Level3Col[i]);
    assertEquals(dimRow.getMembers()[3].getKeyValues()[0],FourLevelDataset.Level4Col[i]);
  }
}
Program: 74585
Project: 74585
Buggy source:
public String onURLImage(IImage image,Object context){
  assert(image != null);
  return image.getID();
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @deprecated
 * @see org.eclipse.birt.report.engine.api2.IHTMLImageHandler#onURLImage(org.eclipse.birt.report.engine.api2.IImage,java.lang.Object)
 */
public String onURLImage(IImage image,Object context){
  assert(image != null);
  return image.getID();
}
Program: 74586
Project: 74586
Buggy source:
public String onDocImage(IImage image,Object context){
  return null;
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @deprecated
 * @see org.eclipse.birt.report.engine.api2.IHTMLImageHandler#onDocImage(org.eclipse.birt.report.engine.api2.IImage,java.lang.Object)
 */
public String onDocImage(IImage image,Object context){
  return null;
}
Program: 74587
Project: 74587
Buggy source:
public String onCustomImage(IImage image,Object context){
  return handleImage(image,context,"String_Node_Str",false);
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @deprecated
 * @see org.eclipse.birt.report.engine.api2.IHTMLImageHandler#onCustomImage(org.eclipse.birt.report.engine.api2.IImage,java.lang.Object)
 */
public String onCustomImage(IImage image,Object context){
  return handleImage(image,context,"String_Node_Str",false);
}
Program: 74588
Project: 74588
Buggy source:
public String onDesignImage(IImage image,Object context){
  return handleImage(image,context,"String_Node_Str",true);
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @deprecated
 * @see org.eclipse.birt.report.engine.api2.IHTMLImageHandler#onDesignImage(org.eclipse.birt.report.engine.api2.IImage,java.lang.Object)
 */
public String onDesignImage(IImage image,Object context){
  return handleImage(image,context,"String_Node_Str",true);
}
Program: 74589
Project: 74589
Buggy source:
public String onFileImage(IImage image,Object context){
  return handleImage(image,context,"String_Node_Str",true);
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @deprecated
 * @see org.eclipse.birt.report.engine.api2.IHTMLImageHandler#onFileImage(org.eclipse.birt.report.engine.api2.IImage,java.lang.Object)
 */
public String onFileImage(IImage image,Object context){
  return handleImage(image,context,"String_Node_Str",true);
}
Program: 74590
Project: 74590
Buggy source:
public String onURLImage(IImage image,Object context){
  assert(image != null);
  String uri=image.getID();
  if (uri.startsWith("String_Node_Str") || uri.startsWith("String_Node_Str")) {
    return uri;
  }
  return handleImage(image,context,"String_Node_Str",true);
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @deprecated
 * @see org.eclipse.birt.report.engine.api2.IHTMLImageHandler#onURLImage(org.eclipse.birt.report.engine.api2.IImage,java.lang.Object)
 */
public String onURLImage(IImage image,Object context){
  assert(image != null);
  String uri=image.getID();
  if (uri.startsWith("String_Node_Str") || uri.startsWith("String_Node_Str")) {
    return uri;
  }
  return handleImage(image,context,"String_Node_Str",true);
}
Program: 74591
Project: 74591
Buggy source:
public String onDocImage(IImage image,Object context){
  return null;
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @deprecated
 * @see org.eclipse.birt.report.engine.api2.IHTMLImageHandler#onDocImage(org.eclipse.birt.report.engine.api2.IImage,java.lang.Object)
 */
public String onDocImage(IImage image,Object context){
  return null;
}
Program: 74592
Project: 74592
Buggy source:
public String onCustomImage(IImage image,Object context){
  return handleImage(image,context,"String_Node_Str",false);
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @deprecated
 * @see org.eclipse.birt.report.engine.api2.IHTMLImageHandler#onCustomImage(org.eclipse.birt.report.engine.api2.IImage,java.lang.Object)
 */
public String onCustomImage(IImage image,Object context){
  return handleImage(image,context,"String_Node_Str",false);
}
Program: 74593
Project: 74593
Buggy source:
public String onDesignImage(IImage image,Object context){
  return handleImage(image,context,"String_Node_Str",true);
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @deprecated
 * @see org.eclipse.birt.report.engine.api2.IHTMLImageHandler#onDesignImage(org.eclipse.birt.report.engine.api2.IImage,java.lang.Object)
 */
public String onDesignImage(IImage image,Object context){
  return handleImage(image,context,"String_Node_Str",true);
}
Program: 74594
Project: 74594
Buggy source:
public String onFileImage(IImage image,Object context){
  return handleImage(image,context,"String_Node_Str",true);
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @deprecated
 * @see org.eclipse.birt.report.engine.api2.IHTMLImageHandler#onFileImage(org.eclipse.birt.report.engine.api2.IImage,java.lang.Object)
 */
public String onFileImage(IImage image,Object context){
  return handleImage(image,context,"String_Node_Str",true);
}
Program: 74595
Project: 74595
Buggy source:
public Dimension getPreferredSize(int wHint,int hHint){
  Dimension dim=super.getPreferredSize(wHint,hHint);
  int rx=recommendSize != null ? recommendSize.width : 0;
  int ry=recommendSize != null ? recommendSize.height : 0;
  if (DesignChoiceConstants.DISPLAY_BLOCK.equals(display)) {
    return new Dimension(dim.width,Math.max(dim.height,ry));
  }
  if (DesignChoiceConstants.DISPLAY_INLINE.equals(display)) {
    return new Dimension(Math.max(dim.width,rx),Math.max(dim.height,ry));
  }
  return dim;
}

Fixed version (ground truth):
public Dimension getPreferredSize(int wHint,int hHint){
  int rx=recommendSize != null ? recommendSize.width : 0;
  int ry=recommendSize != null ? recommendSize.height : 0;
  Dimension dim=super.getPreferredSize(rx == 0 ? wHint : rx,hHint);
  return new Dimension(Math.max(dim.width,rx),Math.max(dim.height,ry));
}
Program: 74596
Project: 74596
Buggy source:
/** 
 * @param source
 * @return byte array
 * @throws BirtException
 */
public static byte[] toBytes(Object source) throws BirtException {
  if (source == null)   return null;
  if (source instanceof byte[])   return (byte[])source;
 else   throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
}

Fixed version (ground truth):
/** 
 * @param source
 * @return byte array
 * @throws BirtException
 */
public static byte[] toBytes(Object source) throws BirtException {
  if (source == null)   return null;
  if (source instanceof byte[])   return (byte[])source;
 else   if (source instanceof Blob) {
    try {
      return ((Blob)source).getBytes((long)1,(int)((Blob)source).length());
    }
 catch (    SQLException e) {
      throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
    }
  }
 else   throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
}
Program: 74597
Project: 74597
Buggy source:
/** 
 * Adapts a Model data type (string) to Data Engine data type constant (integer) on column
 */
public static int adaptModelDataType(String modelDataType){
  if (modelDataType == null)   return DataType.UNKNOWN_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_ANY))   return DataType.ANY_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER))   return DataType.INTEGER_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_STRING))   return DataType.STRING_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME))   return DataType.DATE_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL))   return DataType.DECIMAL_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT))   return DataType.DOUBLE_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_TIME))   return DataType.SQL_TIME_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DATE))   return DataType.SQL_DATE_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_BOOLEAN))   return DataType.BOOLEAN_TYPE;
  return DataType.UNKNOWN_TYPE;
}

Fixed version (ground truth):
/** 
 * Adapts a Model data type (string) to Data Engine data type constant (integer) on column
 */
public static int adaptModelDataType(String modelDataType){
  if (modelDataType == null)   return DataType.UNKNOWN_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_ANY))   return DataType.ANY_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER))   return DataType.INTEGER_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_STRING))   return DataType.STRING_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME))   return DataType.DATE_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL))   return DataType.DECIMAL_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT))   return DataType.DOUBLE_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_TIME))   return DataType.SQL_TIME_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DATE))   return DataType.SQL_DATE_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_BOOLEAN))   return DataType.BOOLEAN_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_BLOB))   return DataType.BLOB_TYPE;
  return DataType.UNKNOWN_TYPE;
}
Program: 74599
Project: 74599
Buggy source:
public Connection connect(DataSourceDesign dataSourceHandle){
  DataSourceDesign handle=(DataSourceDesign)dataSourceHandle;
  String userName=(String)handle.getPublicProperties().findProperty(Constants.ODAUser).getValue();
  String passWord=(String)handle.getPublicProperties().findProperty(Constants.ODAPassword).getValue();
  String url=(String)handle.getPublicProperties().findProperty(Constants.ODAURL).getValue();
  String driver=(String)handle.getPublicProperties().findProperty(Constants.ODADriverClass).getValue();
  jdbcConnection=connect(userName,passWord,url,driver,handle.getOdaExtensionId());
  return jdbcConnection;
}

Fixed version (ground truth):
public Connection connect(DataSourceDesign dataSourceDesign){
  Properties props;
  try {
    props=DesignSessionUtil.getEffectiveDataSourceProperties(dataSourceDesign);
  }
 catch (  OdaException e) {
    props=new Properties();
  }
  String userName=props.getProperty(Constants.ODAUser);
  String passWord=props.getProperty(Constants.ODAPassword);
  String url=props.getProperty(Constants.ODAURL);
  String driver=props.getProperty(Constants.ODADriverClass);
  jdbcConnection=connect(userName,passWord,url,driver,dataSourceDesign.getOdaExtensionId());
  return jdbcConnection;
}
Program: 74600
Project: 74600
Buggy source:
/** 
 * @param absoluteRowIndex
 * @throws IOException
 * @throws DataException
 */
private void skipTo(int absoluteRowIndex) throws IOException, DataException {
  if (currReadIndex == absoluteRowIndex)   return;
  if (this.dataSetData != null) {
    this.dataSetData.skipTo(absoluteRowIndex);
  }
  if (version == VersionManager.VERSION_2_0) {
    int exprCount;
    int gapRows=absoluteRowIndex - currReadIndex;
    for (int j=0; j < gapRows; j++) {
      exprCount=IOUtil.readInt(rowExprsDis);
      for (int i=0; i < exprCount; i++) {
        IOUtil.readObject(rowExprsDis);
      }
    }
  }
 else   if (version <= VersionManager.VERSION_2_2_1_1) {
    rowLenRAIs.seek(absoluteRowIndex * INT_LENGTH);
    int rowOffsetAbsolute=IOUtil.readInt(rowLenRAIs);
    rowExprsRAIs.seek(rowOffsetAbsolute + this.metaOffset);
    rowExprsDis=new DataInputStream(rowExprsRAIs);
  }
 else {
    rowLenRAIs.seek(absoluteRowIndex * 8);
    long rowOffsetAbsolute=IOUtil.readLong(this.rowLenDis);
    rowExprsRAIs.seek(rowOffsetAbsolute + this.metaOffset);
    rowExprsDis=new DataInputStream(rowExprsRAIs);
  }
}

Fixed version (ground truth):
/** 
 * @param absoluteRowIndex
 * @throws IOException
 * @throws DataException
 */
private void skipTo(int absoluteRowIndex) throws IOException, DataException {
  if (this.dataSetData != null) {
    this.dataSetData.skipTo(absoluteRowIndex);
  }
  if (currReadIndex == absoluteRowIndex)   return;
  if (version == VersionManager.VERSION_2_0) {
    int exprCount;
    int gapRows=absoluteRowIndex - currReadIndex;
    for (int j=0; j < gapRows; j++) {
      exprCount=IOUtil.readInt(rowExprsDis);
      for (int i=0; i < exprCount; i++) {
        IOUtil.readObject(rowExprsDis);
      }
    }
  }
 else   if (version <= VersionManager.VERSION_2_2_1_1) {
    rowLenRAIs.seek(absoluteRowIndex * INT_LENGTH);
    int rowOffsetAbsolute=IOUtil.readInt(rowLenRAIs);
    rowExprsRAIs.seek(rowOffsetAbsolute + this.metaOffset);
    rowExprsDis=new DataInputStream(rowExprsRAIs);
  }
 else {
    rowLenRAIs.seek(absoluteRowIndex * 8);
    long rowOffsetAbsolute=IOUtil.readLong(this.rowLenDis);
    rowExprsRAIs.seek(rowOffsetAbsolute + this.metaOffset);
    rowExprsDis=new DataInputStream(rowExprsRAIs);
  }
}
Program: 74601
Project: 74601
Buggy source:
public IResultObject next() throws DataException {
  initLoad();
  if (this.rowIndex == this.rowCount)   return null;
  try {
    rowIndex++;
    this.currentObject=ResultSetUtil.readResultObject(dis,rsMetaData,colCount);
    return this.currentObject;
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
}

Fixed version (ground truth):
public IResultObject next() throws DataException {
  initLoad();
  if (this.rowIndex < this.rowCount - 1) {
    try {
      rowIndex++;
      this.currentObject=ResultSetUtil.readResultObject(dis,rsMetaData,colCount);
      return this.currentObject;
    }
 catch (    IOException e) {
      throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
    }
  }
 else   return null;
}
Program: 74602
Project: 74602
Buggy source:
public int getCurrentIndex(){
  return rowIndex - 1;
}

Fixed version (ground truth):
public int getCurrentIndex(){
  return rowIndex;
}
Program: 74603
Project: 74603
Buggy source:
public void skipTo(int index) throws DataException, IOException {
  this.initLoad();
  if (this.rowIndex < this.rowCount) {
    if (this.dataSetRowLensStream != null) {
      this.dataSetRowLensStream.seek(index * 8);
      long position=IOUtil.readLong(this.disRowLensStream);
      this.rowIndex=index;
      this.inputStream.seek(position + this.initPos);
      this.dis=new DataInputStream(inputStream);
      this.currentObject=ResultSetUtil.readResultObject(dis,rsMetaData,colCount);
      return;
    }
  }
}

Fixed version (ground truth):
public void skipTo(int index) throws DataException, IOException {
  if (this.rowIndex == index)   return;
  this.initLoad();
  if (this.rowIndex < this.rowCount) {
    if (this.dataSetRowLensStream != null) {
      this.dataSetRowLensStream.seek(index * 8);
      long position=IOUtil.readLong(this.disRowLensStream);
      this.rowIndex=index;
      this.inputStream.seek(position + this.initPos);
      this.dis=new DataInputStream(inputStream);
      this.currentObject=ResultSetUtil.readResultObject(dis,rsMetaData,colCount);
      return;
    }
  }
}
Program: 74604
Project: 74604
Buggy source:
/** 
 * Converts a parameter value to a String expected by ParameterHint
 */
private String getParameterValueString(Class paramType,Object paramValue) throws DataException {
  if (paramValue instanceof String)   return (String)paramValue;
  try {
    paramValue=DataTypeUtil.convert(paramValue,paramType);
    if (paramValue instanceof Date) {
      SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
      return sdf.format((Date)paramValue);
    }
    return DataTypeUtil.toString(paramValue);
  }
 catch (  BirtException e) {
    throw new DataException(ResourceConstants.DATATYPEUTIL_ERROR,e);
  }
}

Fixed version (ground truth):
/** 
 * Converts a parameter value to a String expected by ParameterHint
 */
private String getParameterValueString(Class paramType,Object paramValue) throws DataException {
  if (paramValue instanceof String)   return (String)paramValue;
  try {
    paramValue=DataTypeUtil.convert(paramValue,paramType);
    if (paramValue instanceof Date) {
      SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
      return sdf.format((Date)paramValue);
    }
    if (paramValue != null) {
      return paramValue.toString();
    }
    return null;
  }
 catch (  BirtException e) {
    throw new DataException(ResourceConstants.DATATYPEUTIL_ERROR,e);
  }
}
Program: 74605
Project: 74605
Buggy source:
public List getModelList(){
  init();
  List list=new ArrayList();
  List columns=buildColumnArea();
  List rows=buildRowArea();
  List details=buildMeasures();
  buildModel(list,columns,rows,details);
  adjustColumn(columns,details);
  adjustRow(rows,details);
  int rowBase=((Integer)map.get(COLUMNAREA_ROW)).intValue();
  int columnBase=((Integer)map.get(ROWAREA_COLUMN)).intValue();
  CrosstabCellAdapter first=factory.createCrosstabCellAdapter(LEFT_CONNER,null,1,rowBase,1,columnBase,false);
  list.add(0,first);
  Collections.sort(list,new ModelComparator());
  oldModelList=list;
  return list;
}

Fixed version (ground truth):
public List getModelList(){
  init();
  List list=new ArrayList();
  List columns=buildColumnArea();
  List rows=buildRowArea();
  List details=buildMeasures();
  adjustDirection(columns,rows);
  buildModel(list,columns,rows,details);
  adjustColumn(columns,details);
  adjustRow(rows,details);
  int rowBase=((Integer)map.get(COLUMNAREA_ROW)).intValue();
  int columnBase=((Integer)map.get(ROWAREA_COLUMN)).intValue();
  CrosstabCellAdapter first=factory.createCrosstabCellAdapter(LEFT_CONNER,null,1,rowBase,1,columnBase,false);
  list.add(0,first);
  Collections.sort(list,new ModelComparator());
  oldModelList=list;
  return list;
}
Program: 74606
Project: 74606
Buggy source:
/** 
 * @throws Exception
 */
public void testClobAndBlob() throws Exception {
  QueryDefinition queryDefn=newReportQuery();
  prepareExpression(queryDefn);
  IResultIterator ri=executeQuery(queryDefn);
  IResultMetaData md=ri.getResultMetaData();
  while (ri.next()) {
    String str="String_Node_Str";
    for (int i=0; i < beArray.length; i++) {
      if (md.getColumnTypeName(i + 1).equals(DataType.BINARY_TYPE_NAME))       str+=new String(ri.getBytes(beName[i]));
 else       str+=ri.getValue(beName[i]);
      if (i < beArray.length - 1)       str+="String_Node_Str";
    }
    testPrintln(str);
  }
  checkOutputFile();
}

Fixed version (ground truth):
/** 
 * @throws Exception
 */
public void testClobAndBlob() throws Exception {
  QueryDefinition queryDefn=newReportQuery();
  prepareExpression(queryDefn);
  IResultIterator ri=executeQuery(queryDefn);
  IResultMetaData md=ri.getResultMetaData();
  while (ri.next()) {
    String str="String_Node_Str";
    for (int i=0; i < beArray.length; i++) {
      if (md.getColumnTypeName(i + 1).equals(DataType.BINARY_TYPE_NAME) || md.getColumnTypeName(i + 1).equals(DataType.BLOB_TYPE_NAME))       str+=new String(ri.getBytes(beName[i]));
 else       str+=ri.getValue(beName[i]);
      if (i < beArray.length - 1)       str+="String_Node_Str";
    }
    testPrintln(str);
  }
  checkOutputFile();
}
Program: 74607
Project: 74607
Buggy source:
protected void writeTxtData(Data d){
  startCell(d.span.getCol(),d.span.getColSpan(),0,d.styleId,d.url);
  writeText(d);
  endCell();
}

Fixed version (ground truth):
protected void writeTxtData(Data d){
  startCell(d.span.getCol(),d.span.getColSpan(),d.getRowSpan(),d.styleId,d.url);
  writeText(d);
  endCell();
}
Program: 74608
Project: 74608
Buggy source:
private static void overwriteProp(StyleEntry cEntry,StyleEntry entry,int id){
  if (!(StyleEntry.isNull(cEntry.getProperty(id)))) {
    entry.setProperty(id,cEntry.getProperty(id));
  }
}

Fixed version (ground truth):
private static void overwriteProp(StyleEntry cEntry,StyleEntry entry,int id){
  if (StyleEntry.isNull(entry.getProperty(id))) {
    entry.setProperty(id,cEntry.getProperty(id));
  }
}
Program: 74609
Project: 74609
Buggy source:
public static String convertBorderWeight(String weight){
  String w=StyleConstant.NULL;
  if (weight != null && !"String_Node_Str".equalsIgnoreCase(weight)) {
    weight=ExcelUtil.getValue(weight);
    if ("String_Node_Str".equalsIgnoreCase(weight)) {
      w="String_Node_Str";
    }
 else     if ("String_Node_Str".equalsIgnoreCase(weight)) {
      w="String_Node_Str";
    }
 else {
      w="String_Node_Str";
    }
  }
  return w;
}

Fixed version (ground truth):
public static String convertBorderWeight(String linestyle){
  String w=StyleConstant.NULL;
  if (linestyle != null && !"String_Node_Str".equalsIgnoreCase(linestyle)) {
    linestyle=ExcelUtil.getValue(linestyle);
    int weight=(int)Double.parseDouble(linestyle);
    if (weight >= 749 && weight < 2249) {
      w="String_Node_Str";
    }
 else     if (weight >= 2249 && weight < 3750) {
      w="String_Node_Str";
    }
 else     if (weight >= 3750) {
      w="String_Node_Str";
    }
 else {
      w="String_Node_Str";
    }
  }
  return w;
}
Program: 74610
Project: 74610
Buggy source:
private void synchronous(){
  Rule rule=getCurrentContainer().getRule();
  int start=rule.getStart();
  int end=rule.getEnd();
  int startcol=axis.getCoordinate(start);
  int endcol=axis.getCoordinate(end);
  int max=0;
  int len[]=new int[endcol - startcol];
  for (int i=startcol; i < endcol; i++) {
    int columnsize=cache.getColumnSize(i - detal);
    len[i - startcol]=columnsize;
    max=max > columnsize ? max : columnsize;
  }
  for (int i=startcol; i < endcol; i++) {
    int times=max - len[i - startcol];
    while ((times--) > 0) {
      Rule colrule=axis.getRule(i);
      Data data=new Data(EMPTY,engine.createHorizionStyle(colrule),Data.STRING);
      data.setRule(colrule);
      cache.addData(i - detal,data);
    }
  }
}

Fixed version (ground truth):
private void synchronous(){
  Rule rule=getCurrentContainer().getRule();
  int start=rule.getStart();
  int end=rule.getEnd();
  int startcol=axis.getCoordinate(start);
  int endcol=axis.getCoordinate(end);
  int max=0;
  int len[]=new int[endcol - startcol];
  for (int i=startcol; i < endcol; i++) {
    int columnsize=cache.getColumnSize(i - detal);
    len[i - startcol]=columnsize;
    max=max > columnsize ? max : columnsize;
  }
  for (int i=startcol; i < endcol; i++) {
    int rowspan=max - len[i - startcol];
    int last=len[i - startcol] - 1;
    if (rowspan > 0) {
      Object data=null;
      Object upstair=cache.getData(i - detal,last);
      if (upstair != null && upstair != waste) {
        Data predata=(Data)upstair;
        int rs=predata.getRowSpan() + rowspan;
        predata.setRowSpan(rs);
        data=predata;
      }
 else {
        data=waste;
      }
      for (int p=0; p < rowspan; p++) {
        cache.addData(i - detal,data);
      }
    }
  }
}
Program: 74611
Project: 74611
Buggy source:
public Data[] getRow(int rownum){
  Object[] row=cache.getRowData(rownum);
  List data=new ArrayList();
  int width=Math.min(row.length,MAX_CLOUMN - 1);
  for (int i=0; i < width; i++) {
    if (waste == row[i]) {
      continue;
    }
    Data d=(Data)row[i];
    HyperlinkDef def=d.getHyperlinkDef();
    if (def != null && def.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
      def.setUrl((String)links.get(def.getUrl()));
    }
    data.add(row[i]);
  }
  return (Data[])data.toArray(new Data[0]);
}

Fixed version (ground truth):
public Data[] getRow(int rownum){
  Object[] row=cache.getRowData(rownum);
  List data=new ArrayList();
  int width=Math.min(row.length,MAX_CLOUMN - 1);
  for (int i=0; i < width; i++) {
    if (waste == row[i]) {
      continue;
    }
    Data d=(Data)row[i];
    if (d.isProcessed()) {
      continue;
    }
    HyperlinkDef def=d.getHyperlinkDef();
    if (def != null && def.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
      def.setUrl((String)links.get(def.getUrl()));
    }
    d.setProcessed(true);
    data.add(row[i]);
  }
  return (Data[])data.toArray(new Data[0]);
}
Program: 74612
Project: 74612
Buggy source:
/** 
 * Override implementation of doPostService.
 */
protected String doPostService(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String className=getClass().getName().substring(getClass().getName().lastIndexOf('.') + 1);
  return JSPRootPath + "String_Node_Str" + className+ "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Override implementation of doPostService.
 */
protected String doPostService(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  request.setAttribute("String_Node_Str",request.getServletPath());
  String className=getClass().getName().substring(getClass().getName().lastIndexOf('.') + 1);
  return JSPRootPath + "String_Node_Str" + className+ "String_Node_Str";
}
Program: 74613
Project: 74613
Buggy source:
public static String formatDate(Object data){
  SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  return dateFormat.format((Date)data);
}

Fixed version (ground truth):
public static String formatDate(Object data){
  if (data == null) {
    return null;
  }
  SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  Date date=null;
  if (data instanceof com.ibm.icu.util.Calendar) {
    date=((com.ibm.icu.util.Calendar)data).getTime();
  }
 else   if (data instanceof Date) {
    date=(Date)data;
  }
 else {
    return null;
  }
  return dateFormat.format(date);
}
Program: 74614
Project: 74614
Buggy source:
public boolean equals(Object other){
  if (other == null || !(other instanceof ColumnReferenceExpression))   return false;
  ColumnReferenceExpression expr2=(ColumnReferenceExpression)other;
  if (m_columnName != null)   return (m_columnName.equals(expr2.m_columnName));
 else   return m_columnIndex == expr2.m_columnIndex;
}

Fixed version (ground truth):
public boolean equals(Object other){
  if (other == null || !(other instanceof ColumnReferenceExpression))   return false;
  ColumnReferenceExpression expr2=(ColumnReferenceExpression)other;
  if (dataType != expr2.dataType)   return false;
  if (m_columnName != null)   return (m_columnName.equals(expr2.m_columnName));
 else   return m_columnIndex == expr2.m_columnIndex;
}
Program: 74615
Project: 74615
Buggy source:
public void writeText(Data d){
  writer.openTag("String_Node_Str");
  if (d.getDatatype().equals(Data.NUMBER) && ExcelUtil.isNumber(d.getText())) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
 else   if (d.getDatatype().equals(Data.DATE)) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
 else {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
  writer.text(d.getText());
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
public void writeText(Data d){
  writer.openTag("String_Node_Str");
  if (d.getDatatype().equals(Data.NUMBER) && ExcelUtil.isNumber(d.getText())) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
 else   if (d.getDatatype().equals(Data.DATE)) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
 else {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
  String txt=d.getText();
  if (CSSConstants.CSS_CAPITALIZE_VALUE.equalsIgnoreCase(d.getStyleEntry().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=capitalize(txt);
  }
 else   if (CSSConstants.CSS_UPPERCASE_VALUE.equalsIgnoreCase(d.getStyleEntry().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=txt.toUpperCase();
  }
 else   if (CSSConstants.CSS_LOWERCASE_VALUE.equalsIgnoreCase(d.getStyleEntry().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=txt.toLowerCase();
  }
  writer.text(txt);
  writer.closeTag("String_Node_Str");
}
Program: 74619
Project: 74619
Buggy source:
public void startData(IDataContent data){
  super.startData(data);
  HyperlinkDef url=parseHyperLink(data);
  engine.addData(data,data.getComputedStyle(),url);
}

Fixed version (ground truth):
public void startData(IDataContent data){
  super.startData(data);
  HyperlinkDef url=parseHyperLink(data);
  if (((StyledElementDesign)data.getGenerateBy()).getMap() != null && ((StyledElementDesign)data.getGenerateBy()).getMap().getRuleCount() > 0) {
    engine.addData(data.getText().trim(),data.getComputedStyle(),url);
  }
 else   if (!ExcelUtil.getType(data.getValue()).equals(Data.NUMBER) && !ExcelUtil.getType(data.getValue()).equals(Data.DATE)) {
    engine.addData(data.getText(),data.getComputedStyle(),url);
  }
 else {
    engine.addData(data.getValue(),data.getComputedStyle(),url);
  }
}
Program: 74620
Project: 74620
Buggy source:
public Data createData(Object txt,StyleEntry entry){
  if (txt instanceof IDataContent) {
    IDataContent dataContent=(IDataContent)txt;
    Object value=dataContent.getValue();
    String text=dataContent.getText();
    if (((DataItemDesign)dataContent.getGenerateBy()).getMap() != null && ((DataItemDesign)dataContent.getGenerateBy()).getMap().getRuleCount() > 0) {
      entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.STRING);
      return new Data(text.trim(),entry,Data.STRING);
    }
 else     if (ExcelUtil.getType(value).equals(Data.NUMBER)) {
      String format=ExcelUtil.getPattern(value,entry.getProperty(StyleConstant.NUMBER_FORMAT_PROP));
      entry.setProperty(StyleConstant.NUMBER_FORMAT_PROP,format);
      entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.NUMBER);
      return new Data(value,entry,Data.NUMBER);
    }
 else     if (ExcelUtil.getType(value).equals(Data.DATE)) {
      String format=ExcelUtil.getPattern(value,entry.getProperty(StyleConstant.DATE_FORMAT_PROP));
      entry.setProperty(StyleConstant.DATE_FORMAT_PROP,format);
      entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.DATE);
      return new Data(value,entry,Data.DATE);
    }
    entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.STRING);
    return new Data(text.trim(),entry,Data.STRING);
  }
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.STRING);
  return new Data(txt,entry,Data.STRING);
}

Fixed version (ground truth):
public Data createData(Object txt,StyleEntry entry){
  if (ExcelUtil.getType(txt).equals(Data.NUMBER)) {
    String format=ExcelUtil.getPattern(txt,entry.getProperty(StyleConstant.NUMBER_FORMAT_PROP));
    entry.setProperty(StyleConstant.NUMBER_FORMAT_PROP,format);
    entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.NUMBER);
    return new Data(txt,entry,Data.NUMBER);
  }
 else   if (ExcelUtil.getType(txt).equals(Data.DATE)) {
    String format=ExcelUtil.getPattern(txt,entry.getProperty(StyleConstant.DATE_FORMAT_PROP));
    entry.setProperty(StyleConstant.DATE_FORMAT_PROP,format);
    entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.DATE);
    return new Data(txt,entry,Data.DATE);
  }
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.STRING);
  return new Data(txt,entry,Data.STRING);
}
Program: 74621
Project: 74621
Buggy source:
public String getText(){
  if (txt == null) {
    return "String_Node_Str";
  }
 else   if (datatype.equals(Data.DATE)) {
    return ExcelUtil.formatDate(txt);
  }
 else {
    return txt.toString();
  }
}

Fixed version (ground truth):
public String getText(){
  if (txt == null) {
    return "String_Node_Str";
  }
 else   if (datatype.equals(Data.DATE)) {
    return ExcelUtil.formatDate(txt);
  }
 else   if (datatype.equals(Data.NUMBER) && txt.toString().length() > 31) {
    return ExcelUtil.formatNumber(txt);
  }
 else {
    return txt.toString();
  }
}
Program: 74622
Project: 74622
Buggy source:
public static String formatDate(Object date){
  SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  return dateFormat.format((Date)date);
}

Fixed version (ground truth):
public static String formatDate(Object data){
  SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  return dateFormat.format((Date)data);
}
Program: 74625
Project: 74625
Buggy source:
/** 
 * Remember before requesting any service, this function must be called in advance to make sure using current data source and data set.
 * @param dataSourceDesign
 * @param datasetDesign
 */
public void setDataSourceAndDataSet(IBaseDataSourceDesign dataSourceDesign,IBaseDataSetDesign dataSetDesign,Collection parameterHints,Map appContext){
  this.dataSourceDesign=dataSourceDesign;
  this.dataSetDesign=dataSetDesign;
  this.parameterHints=parameterHints;
  this.appContext=appContext;
}

Fixed version (ground truth):
/** 
 * Remember before requesting any service, this function must be called in advance to make sure using current data source and data set.
 * @param dataSourceDesign
 * @param datasetDesign
 */
public void setDataSourceAndDataSet(IBaseDataSourceDesign dataSourceDesign,IBaseDataSetDesign dataSetDesign,Collection parameterHints,Map appContext){
  this.dataSourceDesign=dataSourceDesign;
  this.dataSetDesign=dataSetDesign;
  this.parameterHints=parameterHints;
  this.appContext=appContext;
  setRowFetchLimit();
}
Program: 74627
Project: 74627
Buggy source:
/** 
 */
private void setRowFetchLimit(){
  Object rowLimit=appContext.get(DataEngine.DATA_SET_CACHE_ROW_LIMIT);
  if (rowLimit != null) {
    try {
      this.dataSetDesign.setRowFetchLimit(Integer.parseInt(rowLimit.toString()));
    }
 catch (    NumberFormatException e) {
    }
  }
}

Fixed version (ground truth):
/** 
 */
private void setRowFetchLimit(){
  if (appContext != null) {
    Object rowLimit=appContext.get(DataEngine.DATA_SET_CACHE_ROW_LIMIT);
    if (rowLimit != null) {
      try {
        this.dataSetDesign.setRowFetchLimit(Integer.parseInt(rowLimit.toString()));
      }
 catch (      NumberFormatException e) {
      }
    }
  }
}
Program: 74628
Project: 74628
Buggy source:
public IBlob getBlob(int index) throws OdaException {
  assertNotNull(rs);
  try {
    java.sql.Blob blob=rs.getBlob(index);
    return new Blob(blob);
  }
 catch (  UnsupportedOperationException e1) {
    try {
      InputStream inputStream=rs.getBinaryStream(index);
      return new Blob(SqlBlobUtil.newBlob(inputStream));
    }
 catch (    SQLException e2) {
      throw new JDBCException(ResourceConstants.RESULTSET_CANNOT_GET_BLOB_VALUE,e2);
    }
  }
catch (  SQLException e) {
    try {
      byte[] bytes=rs.getBytes(index);
      return new Blob(SqlBlobUtil.newBlob(new ByteArrayInputStream(bytes)));
    }
 catch (    SQLException e2) {
      throw new JDBCException(ResourceConstants.RESULTSET_CANNOT_GET_BLOB_VALUE,e2);
    }
  }
}

Fixed version (ground truth):
public IBlob getBlob(int index) throws OdaException {
  assertNotNull(rs);
  try {
    java.sql.Blob blob=rs.getBlob(index);
    return new Blob(blob);
  }
 catch (  UnsupportedOperationException e1) {
    try {
      InputStream inputStream=rs.getBinaryStream(index);
      return new Blob(SqlBlobUtil.newBlob(inputStream));
    }
 catch (    SQLException e2) {
      throw new JDBCException(ResourceConstants.RESULTSET_CANNOT_GET_BLOB_VALUE,e2);
    }
  }
catch (  SQLException e) {
    try {
      byte[] bytes=rs.getBytes(index);
      if (bytes == null)       return null;
      return new Blob(SqlBlobUtil.newBlob(new ByteArrayInputStream(bytes)));
    }
 catch (    SQLException e2) {
      throw new JDBCException(ResourceConstants.RESULTSET_CANNOT_GET_BLOB_VALUE,e2);
    }
  }
}
Program: 74630
Project: 74630
Buggy source:
/** 
 * @throws IOException
 * @throws DataException 
 */
private Map getValueMap() throws IOException, DataException {
  Map valueMap=new HashMap();
  int exprCount=IOUtil.readInt(rowExprsDis);
  for (int i=0; i < exprCount; i++) {
    String exprID=this.exprKeys.get(i).toString();
    Object exprValue=IOUtil.readObject(rowExprsDis);
    if (RowSaveUtil.EXCEPTION_INDICATOR.equals(exprValue)) {
      valueMap.put(exprID,new DataException(ResourceConstants.READ_COLUMN_VALUE_FROM_DOCUMENT_ERROR,exprID));
      continue;
    }
    valueMap.put(exprID,exprValue);
  }
  java.util.Iterator it=this.dataSetExprKeys.keySet().iterator();
  while (it.hasNext()) {
    String key=it.next().toString();
    String value=(String)this.dataSetExprKeys.get(key);
    IResultObject o=this.dataSetData.getResultObject();
    try {
      valueMap.put(key,o == null ? null : DataTypeUtil.convert(o.getFieldValue(value),((Integer)this.bindingNameTypeMap.get(key)).intValue()));
    }
 catch (    BirtException e) {
      e.printStackTrace();
    }
  }
  return valueMap;
}

Fixed version (ground truth):
/** 
 * @throws IOException
 * @throws DataException 
 */
private Map getValueMap() throws IOException, DataException {
  Map valueMap=new HashMap();
  int exprCount=IOUtil.readInt(rowExprsDis);
  for (int i=0; i < exprCount; i++) {
    String exprID=this.exprKeys.get(i).toString();
    Object exprValue=IOUtil.readObject(rowExprsDis);
    if (RowSaveUtil.EXCEPTION_INDICATOR.equals(exprValue)) {
      valueMap.put(exprID,new DataException(ResourceConstants.READ_COLUMN_VALUE_FROM_DOCUMENT_ERROR,exprID));
      continue;
    }
    valueMap.put(exprID,exprValue);
  }
  java.util.Iterator it=this.dataSetExprKeys.keySet().iterator();
  while (it.hasNext()) {
    String key=it.next().toString();
    String value=(String)this.dataSetExprKeys.get(key);
    IResultObject o=this.dataSetData.getResultObject();
    try {
      valueMap.put(key,o == null ? null : DataTypeUtil.convert(o.getFieldValue(value),((Integer)this.bindingNameTypeMap.get(key)).intValue()));
    }
 catch (    BirtException e) {
    }
  }
  return valueMap;
}
Program: 74631
Project: 74631
Buggy source:
/** 
 * @return
 */
public static int computeMemoryBufferSize(Map appContext){
  if (appContext == null)   return 10 * 1024 * 1024* 8;
  if (appContext.get(TEST_MEM_BUFFER_SIZE) != null) {
    return populateMemBufferSize(appContext.get(TEST_MEM_BUFFER_SIZE));
  }
  return populateMemBufferSize(appContext.get(DataEngine.MEMORY_BUFFER_SIZE)) * 1024 * 1024* 8;
}

Fixed version (ground truth):
/** 
 * @return
 */
public static long computeMemoryBufferSize(Map appContext){
  if (appContext == null)   return 10 * 1024 * 1024;
  if (appContext.get(TEST_MEM_BUFFER_SIZE) != null) {
    return populateMemBufferSize(appContext.get(TEST_MEM_BUFFER_SIZE));
  }
  return populateMemBufferSize(appContext.get(DataEngine.MEMORY_BUFFER_SIZE)) * 1024 * 1024;
}
Program: 74632
Project: 74632
Buggy source:
/** 
 * @param propValue
 * @return
 */
private static int populateMemBufferSize(Object propValue){
  String targetBufferSize=propValue == null ? "String_Node_Str" : propValue.toString();
  int memoryCacheSize=10;
  if (targetBufferSize != null)   memoryCacheSize=Integer.parseInt(targetBufferSize);
  return memoryCacheSize;
}

Fixed version (ground truth):
/** 
 * @param propValue
 * @return
 */
private static long populateMemBufferSize(Object propValue){
  String targetBufferSize=propValue == null ? "String_Node_Str" : propValue.toString();
  long memoryCacheSize=10;
  if (targetBufferSize != null)   memoryCacheSize=Long.parseLong(targetBufferSize);
  return memoryCacheSize == 0 ? 1 : memoryCacheSize;
}
Program: 74634
Project: 74634
Buggy source:
/** 
 * @param dataSet
 * @param queryDefn
 * @param useColumnHints
 * @return
 * @throws BirtException
 */
public IQueryResults execute(DataSetHandle dataSet,QueryDefinition queryDefn,boolean useColumnHints,boolean useFilters,boolean clearCache,DataRequestSession session) throws BirtException {
  IBaseDataSetDesign dataSetDesign=session.getModelAdaptor().adaptDataSet(dataSet);
  if (clearCache) {
    IBaseDataSourceDesign dataSourceDesign=session.getModelAdaptor().adaptDataSource(dataSet.getDataSource());
    session.clearCache(dataSourceDesign,dataSetDesign);
  }
  if (!useColumnHints) {
    dataSetDesign.getResultSetHints().clear();
  }
  if (!useFilters) {
    dataSetDesign.getFilters().clear();
  }
  IQueryResults resultSet=executeQuery(session,queryDefn);
  saveResultToDataItems(dataSet,resultSet);
  return resultSet;
}

Fixed version (ground truth):
/** 
 * @param dataSet
 * @param queryDefn
 * @param useColumnHints
 * @return
 * @throws BirtException
 */
public IQueryResults execute(DataSetHandle dataSet,IQueryDefinition queryDefn,boolean useColumnHints,boolean useFilters,boolean clearCache,DataRequestSession session) throws BirtException {
  IBaseDataSetDesign dataSetDesign=session.getModelAdaptor().adaptDataSet(dataSet);
  if (clearCache) {
    IBaseDataSourceDesign dataSourceDesign=session.getModelAdaptor().adaptDataSource(dataSet.getDataSource());
    session.clearCache(dataSourceDesign,dataSetDesign);
  }
  if (!useColumnHints) {
    dataSetDesign.getResultSetHints().clear();
  }
  if (!useFilters) {
    dataSetDesign.getFilters().clear();
  }
  IQueryResults resultSet=executeQuery(session,queryDefn);
  saveResultToDataItems(dataSet,resultSet);
  return resultSet;
}
Program: 74635
Project: 74635
Buggy source:
/** 
 * @param session
 * @param queryDefn
 * @return
 * @throws BirtException
 */
private IQueryResults executeQuery(DataRequestSession session,QueryDefinition queryDefn) throws BirtException {
  IQueryResults resultSet=session.executeQuery(queryDefn,null,null,null);
  return resultSet;
}

Fixed version (ground truth):
/** 
 * @param session
 * @param queryDefn
 * @return
 * @throws BirtException
 */
private IQueryResults executeQuery(DataRequestSession session,IQueryDefinition queryDefn) throws BirtException {
  IQueryResults resultSet=session.executeQuery(queryDefn,null,null,null);
  return resultSet;
}
Program: 74637
Project: 74637
Buggy source:
/** 
 * Use a default data engine to execute a query. Since Data Engine needs to know the data source and data set definition, the moduleHandle needs to be passed to let DtE get these necessary information.
 * @param queryDefn
 * @param paramBindingIt
 * @param filterIt
 * @param bindingIt
 * @return query results of specified query definition
 * @exception BirtException any error in execute query to get the query results
 */
public abstract IQueryResults executeQuery(QueryDefinition queryDefn,Iterator inputParamBindings,Iterator filterIt,Iterator columnBindings) throws BirtException ;

Fixed version (ground truth):
/** 
 * Use a default data engine to execute a query. Since Data Engine needs to know the data source and data set definition, the moduleHandle needs to be passed to let DtE get these necessary information.
 * @param queryDefn
 * @param paramBindingIt
 * @param filterIt
 * @param bindingIt
 * @return query results of specified query definition
 * @exception BirtException any error in execute query to get the query results
 */
public abstract IQueryResults executeQuery(IQueryDefinition queryDefn,Iterator inputParamBindings,Iterator filterIt,Iterator columnBindings) throws BirtException ;
Program: 74638
Project: 74638
Buggy source:
public IQueryResults executeQuery(QueryDefinition queryDefn,Iterator paramBindingIt,Iterator filterIt,Iterator bindingIt) throws BirtException {
  return new QueryExecutionHelper(this.dataEngine,this.modelAdaptor,this.sessionContext).executeQuery(queryDefn,paramBindingIt,filterIt,bindingIt);
}

Fixed version (ground truth):
public IQueryResults executeQuery(IQueryDefinition queryDefn,Iterator paramBindingIt,Iterator filterIt,Iterator bindingIt) throws BirtException {
  return new QueryExecutionHelper(this.dataEngine,this.modelAdaptor,this.sessionContext).executeQuery(queryDefn,paramBindingIt,filterIt,bindingIt);
}
Program: 74639
Project: 74639
Buggy source:
/** 
 * @param queryDefn
 * @throws AdapterException
 * @throws BirtException
 */
private void defineDataSourceDataSet(QueryDefinition queryDefn) throws AdapterException, BirtException {
  String dataSetName=queryDefn.getDataSetName();
  ModuleHandle module=sessionContext.getModuleHandle();
  if (module != null) {
    List l=module.getAllDataSets();
    DataSetHandle handle=null;
    for (int i=0; i < l.size(); i++) {
      if (((DataSetHandle)l.get(i)).getQualifiedName() != null && ((DataSetHandle)l.get(i)).getQualifiedName().equals(dataSetName)) {
        handle=(DataSetHandle)l.get(i);
      }
    }
    major=handle;
    defineDataSet(handle);
  }
}

Fixed version (ground truth):
/** 
 * @param queryDefn
 * @throws AdapterException
 * @throws BirtException
 */
private void defineDataSourceDataSet(IQueryDefinition queryDefn) throws AdapterException, BirtException {
  String dataSetName=queryDefn.getDataSetName();
  ModuleHandle module=sessionContext.getModuleHandle();
  if (module != null) {
    List l=module.getAllDataSets();
    DataSetHandle handle=null;
    for (int i=0; i < l.size(); i++) {
      if (((DataSetHandle)l.get(i)).getQualifiedName() != null && ((DataSetHandle)l.get(i)).getQualifiedName().equals(dataSetName)) {
        handle=(DataSetHandle)l.get(i);
      }
    }
    major=handle;
    defineDataSet(handle);
  }
}