nus-yam/ex-repair huggingface dataset:
Program: 73404
Project: 73404
Buggy source:
protected void initialize(){
  createRoot();
  maxAvaWidth=parent.getCurrentMaxContentWidth();
  maxAvaHeight=parent.getCurrentMaxContentHeight();
  root.setWidth(parent.getCurrentMaxContentWidth());
  setCurrentBP(0);
  if (lineCount == 1) {
    assert(parent instanceof IBlockStackingLayoutManager);
    setCurrentIP(((PDFBlockStackingLM)parent).getTextIndent());
  }
 else {
    setCurrentIP(currentPosition);
  }
  setupMinHeight();
}

Fixed version (ground truth):
protected void initialize(){
  createRoot();
  maxAvaWidth=parent.getCurrentMaxContentWidth();
  maxAvaHeight=parent.getCurrentMaxContentHeight();
  root.setWidth(parent.getCurrentMaxContentWidth());
  setCurrentBP(0);
  setupMinHeight();
}
Program: 73405
Project: 73405
Buggy source:
public PDFTextLM(PDFLayoutEngineContext context,PDFStackingLM parent,IContent content,IReportItemExecutor executor){
  super(context,parent,content,executor);
  lineLM=(ILineStackingLayoutManager)parent;
  ITextContent textContent=(ITextContent)content;
  String text=textContent.getText();
  if (text != null && text.length() != 0) {
    transform(textContent);
    this.textContent=textContent;
    comp=new Compositor();
  }
}

Fixed version (ground truth):
public PDFTextLM(PDFLayoutEngineContext context,PDFStackingLM parent,IContent content,IReportItemExecutor executor){
  super(context,parent,content,executor);
  lineLM=(ILineStackingLayoutManager)parent;
  ITextContent textContent=(ITextContent)content;
  lineLM.setTextIndent(textContent);
  String text=textContent.getText();
  if (text != null && text.length() != 0) {
    transform(textContent);
    this.textContent=textContent;
    comp=new Compositor();
  }
}
Program: 73406
Project: 73406
Buggy source:
/** 
 * need overwrite this mothod to change default behavour. For inline leaf elements, page-break is handled by this layout manager. For block leaf elements. page-break is handled by it's block container
 */
protected boolean handlePageBreakBefore(){
  if (content != null) {
    if (PropertyUtil.isInlineElement(content)) {
      return super.handlePageBreakBefore();
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * need overwrite this method to change default behavior. For inline leaf elements, page-break is handled by this layout manager. For block leaf elements, page-break is handled by it's block container
 */
protected boolean handlePageBreakBefore(){
  if (content != null) {
    if (PropertyUtil.isInlineElement(content)) {
      return super.handlePageBreakBefore();
    }
  }
  return false;
}
Program: 73409
Project: 73409
Buggy source:
/** 
 */
private void getMetaUsingPolicy0(){
  java.sql.ResultSetMetaData resultmd;
  try {
    resultmd=preStat.getMetaData();
    if (resultmd != null)     this.cachedResultMetaData=new ResultSetMetaData(resultmd);
  }
 catch (  Throwable e) {
  }
}

Fixed version (ground truth):
/** 
 */
private void getMetaUsingPolicy0(){
  java.sql.ResultSetMetaData resultmd;
  try {
    resultmd=preStat.getMetaData();
    if (resultmd != null && resultmd.getColumnCount() > 0)     this.cachedResultMetaData=new ResultSetMetaData(resultmd);
  }
 catch (  Throwable e) {
  }
}
Program: 73410
Project: 73410
Buggy source:
protected void loadDesign(){
  if (runnable != null) {
    ReportDesignHandle reportDesign=executionContext.getDesign();
    Iterator iter=reportDesign.includeScriptsIterator();
    while (iter.hasNext()) {
      IncludeScriptHandle includeScript=(IncludeScriptHandle)iter.next();
      String fileName=includeScript.getFileName();
      executionContext.loadScript(fileName);
    }
    ReportScriptExecutor.handleInitialize(reportDesign,executionContext);
  }
}

Fixed version (ground truth):
protected void loadDesign(){
  if (runnable != null) {
    ReportDesignHandle reportDesign=executionContext.getDesign();
    Iterator iter=reportDesign.includeLibraryScriptsIterator();
    while (iter.hasNext()) {
      IncludeScriptHandle includeScript=(IncludeScriptHandle)iter.next();
      String fileName=includeScript.getFileName();
      executionContext.loadScript(fileName);
    }
    iter=reportDesign.includeScriptsIterator();
    while (iter.hasNext()) {
      IncludeScriptHandle includeScript=(IncludeScriptHandle)iter.next();
      String fileName=includeScript.getFileName();
      executionContext.loadScript(fileName);
    }
    ReportScriptExecutor.handleInitialize(reportDesign,executionContext);
  }
}
Program: 73411
Project: 73411
Buggy source:
/** 
 * @param itemType the type of the extended item, i.e., "chart"
 * @return an object that extended items use to handle java event 
 */
public IReportEventHandler createEventHandler(String itemType){
  IConfigurationElement config=(IConfigurationElement)queryExtensions.get(itemType);
  if (config != null) {
    Object object=createObject(config,"String_Node_Str");
    if (object instanceof IReportItemQuery) {
      return (IReportEventHandler)object;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param itemType the type of the extended item, i.e., "chart"
 * @return an object that extended items use to handle java event 
 */
public IReportEventHandler createEventHandler(String itemType){
  IConfigurationElement config=(IConfigurationElement)queryExtensions.get(itemType);
  if (config != null) {
    Object object=createObject(config,"String_Node_Str");
    if (object instanceof IReportEventHandler) {
      return (IReportEventHandler)object;
    }
  }
  return null;
}
Program: 73413
Project: 73413
Buggy source:
public void switchView(AggregationCellHandle cell){
  try {
    Object content=getFirstContent(cell);
    String exprMeasure=ExpressionUtil.createJSDataExpression(ChartXTabUtil.generateComputedColumnName(cell));
    if (content instanceof DesignElementHandle) {
      ((DesignElementHandle)content).dropAndClear();
    }
    String nameDimRow=null;
    content=getFirstContent(ChartXTabUtil.getInnermostLevelCell(cell.getCrosstab(),ICrosstabConstants.ROW_AXIS_TYPE));
    if (content instanceof DataItemHandle) {
      DataItemHandle dataItemHandle=(DataItemHandle)content;
      nameDimRow=dataItemHandle.getResultSetColumn();
    }
    String nameDimColumn=null;
    content=getFirstContent(ChartXTabUtil.getInnermostLevelCell(cell.getCrosstab(),ICrosstabConstants.COLUMN_AXIS_TYPE));
    if (content instanceof DataItemHandle) {
      DataItemHandle dataItemHandle=(DataItemHandle)content;
      nameDimColumn=dataItemHandle.getResultSetColumn();
    }
    String name=ReportPlugin.getDefault().getCustomName(ChartReportItemConstants.CHART_EXTENSION_NAME);
    ExtendedItemHandle chartHandle=cell.getCrosstabHandle().getElementFactory().newExtendedItem(name,ChartReportItemConstants.CHART_EXTENSION_NAME);
    ChartReportItemImpl reportItem=(ChartReportItemImpl)chartHandle.getReportItem();
    ChartWithAxes cm=createDefaultChart(exprMeasure,new String[]{nameDimRow,nameDimColumn});
    reportItem.setModel(cm);
    cell.addContent(chartHandle,0);
    if (cm.isTransposed()) {
      ChartXTabUIUtil.addAxisChartInXTab(cell,ICrosstabConstants.ROW_AXIS_TYPE,chartHandle);
    }
 else {
      ChartXTabUIUtil.addAxisChartInXTab(cell,ICrosstabConstants.COLUMN_AXIS_TYPE,chartHandle);
    }
  }
 catch (  BirtException e) {
    ExceptionHandler.handle(e);
  }
}

Fixed version (ground truth):
public void switchView(AggregationCellHandle cell){
  try {
    Object content=getFirstContent(cell);
    if (content instanceof DesignElementHandle) {
      ((DesignElementHandle)content).dropAndClear();
    }
    String name=ReportPlugin.getDefault().getCustomName(ChartReportItemConstants.CHART_EXTENSION_NAME);
    ExtendedItemHandle chartHandle=cell.getCrosstabHandle().getElementFactory().newExtendedItem(name,ChartReportItemConstants.CHART_EXTENSION_NAME);
    ChartReportItemImpl reportItem=(ChartReportItemImpl)chartHandle.getReportItem();
    ChartWithAxes cm=createDefaultChart(cell);
    reportItem.setModel(cm);
    cell.addContent(chartHandle,0);
    if (cm.isTransposed()) {
      ChartXTabUIUtil.addAxisChartInXTab(cell,ICrosstabConstants.ROW_AXIS_TYPE,chartHandle);
    }
 else {
      ChartXTabUIUtil.addAxisChartInXTab(cell,ICrosstabConstants.COLUMN_AXIS_TYPE,chartHandle);
    }
  }
 catch (  BirtException e) {
    ExceptionHandler.handle(e);
  }
}
Program: 73414
Project: 73414
Buggy source:
protected void initCubeCursor() throws OLAPException {
  ICubeCursor parent=(ICubeCursor)rs.getCubeCursor();
  cubeCursor=parent;
  try {
    AggregationCellHandle cellHandle=ChartXTabUtil.getXtabContainerCell(handle);
    LevelHandle levelAggColumn=cellHandle.getAggregationOnColumn();
    LevelHandle levelAggRow=cellHandle.getAggregationOnRow();
    Chart cm=ChartReportItemUtil.getChartFromHandle(handle);
    bTransposed=((ChartWithAxes)cm).isTransposed();
    if (!bTransposed) {
      if (levelAggColumn != null && levelAggRow != null) {
        List edges=cubeCursor.getOrdinateEdge();
        this.mainEdgeCursor=(EdgeCursor)edges.get(1);
        this.subEdgeCursor=(EdgeCursor)edges.get(0);
        bSubCursor=true;
      }
 else {
        cubeCursor=parent;
      }
    }
 else     if (cellHandle.getSpanOverOnRow() != null) {
      if (levelAggColumn != null && levelAggRow != null) {
        List edges=cubeCursor.getOrdinateEdge();
        this.mainEdgeCursor=(EdgeCursor)edges.get(0);
        this.subEdgeCursor=(EdgeCursor)edges.get(1);
        bSubCursor=true;
      }
 else {
        cubeCursor=parent;
      }
    }
 else {
      cubeCursor=parent;
    }
  }
 catch (  BirtException e) {
    logger.log(e);
    cubeCursor=parent;
  }
  if (!bSubCursor) {
    List edges=cubeCursor.getOrdinateEdge();
    this.mainEdgeCursor=(EdgeCursor)edges.get(0);
    this.subEdgeCursor=null;
  }
}

Fixed version (ground truth):
protected void initCubeCursor() throws OLAPException {
  ICubeCursor parent=(ICubeCursor)rs.getCubeCursor();
  cubeCursor=parent;
  try {
    AggregationCellHandle cellHandle=ChartXTabUtil.getXtabContainerCell(handle);
    LevelHandle levelAggColumn=cellHandle.getAggregationOnColumn();
    LevelHandle levelAggRow=cellHandle.getAggregationOnRow();
    Chart cm=ChartReportItemUtil.getChartFromHandle(handle);
    bTransposed=((ChartWithAxes)cm).isTransposed();
    if (!bTransposed) {
      if (levelAggColumn != null && levelAggRow != null) {
        List edges=cubeCursor.getOrdinateEdge();
        this.mainEdgeCursor=(EdgeCursor)edges.get(1);
        this.subEdgeCursor=(EdgeCursor)edges.get(0);
        bSubCursor=true;
      }
 else {
        cubeCursor=parent;
      }
    }
 else     if (cellHandle.getSpanOverOnRow() != null) {
      if (levelAggColumn != null && levelAggRow != null) {
        List edges=cubeCursor.getOrdinateEdge();
        this.mainEdgeCursor=(EdgeCursor)edges.get(0);
        this.subEdgeCursor=(EdgeCursor)edges.get(1);
        bSubCursor=true;
      }
 else {
        cubeCursor=parent;
      }
    }
 else {
      cubeCursor=parent;
    }
  }
 catch (  BirtException e) {
    logger.log(e);
    cubeCursor=parent;
  }
  if (!bSubCursor) {
    List edges=cubeCursor.getOrdinateEdge();
    if (edges.size() == 1) {
      this.mainEdgeCursor=(EdgeCursor)edges.get(0);
    }
 else     if (edges.size() > 1) {
      this.mainEdgeCursor=(EdgeCursor)edges.get(bTransposed ? 1 : 0);
    }
    this.subEdgeCursor=null;
  }
}
Program: 73415
Project: 73415
Buggy source:
/** 
 * compares two row indexes, actually compares two rows pointed by the two row indexes
 */
public int compare(Object obj1,Object obj2){
  IResultObject row1=(IResultObject)obj1;
  IResultObject row2=(IResultObject)obj2;
  for (int i=0; i < sortKeyIndexes.length; i++) {
    int colIndex=sortKeyIndexes[i];
    String colName=sortKeyColumns[i];
    try {
      Object colObj1=null;
      Object colObj2=null;
      if (eventHandler != null) {
        colObj1=eventHandler.getValue(row1,colIndex,colName);
        colObj2=eventHandler.getValue(row2,colIndex,colName);
      }
 else {
        colObj1=row1.getFieldValue(colIndex);
        colObj2=row2.getFieldValue(colIndex);
      }
      int result=CompareUtil.compare(colObj1,colObj2);
      if (result != 0) {
        return sortAscending[i] ? result : -result;
      }
    }
 catch (    DataException e) {
    }
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * compares two row indexes, actually compares two rows pointed by the two row indexes
 */
public int compare(Object obj1,Object obj2){
  IResultObject row1=(IResultObject)obj1;
  IResultObject row2=(IResultObject)obj2;
  for (int i=0; i < sortKeyIndexes.length; i++) {
    int colIndex=sortKeyIndexes[i];
    String colName=sortKeyColumns[i];
    try {
      Object colObj1=null;
      Object colObj2=null;
      if (eventHandler != null) {
        colObj1=eventHandler.getValue(row1,colIndex,colName);
        colObj2=eventHandler.getValue(row2,colIndex,colName);
      }
 else {
        colObj1=row1.getFieldValue(colIndex);
        colObj2=row2.getFieldValue(colIndex);
      }
      int result=ScriptEvalUtil.compare(colObj1,colObj2,comparators[i]);
      if (result != 0) {
        return sortAscending[i] ? result : -result;
      }
    }
 catch (    DataException e) {
    }
  }
  return 0;
}
Program: 73417
Project: 73417
Buggy source:
/** 
 * @param rsMeta
 * @return
 */
private static SortSpec getSortSpec(IResultClass rsMeta){
  int fieldCount=rsMeta.getFieldCount();
  int[] sortKeyIndexs=new int[fieldCount];
  String[] sortKeyNames=new String[fieldCount];
  boolean[] ascending=new boolean[fieldCount];
  for (int i=0; i < fieldCount; i++) {
    sortKeyIndexs[i]=i + 1;
    ascending[i]=true;
  }
  return new SortSpec(sortKeyIndexs,sortKeyNames,ascending);
}

Fixed version (ground truth):
/** 
 * @param rsMeta
 * @return
 */
private static SortSpec getSortSpec(IResultClass rsMeta){
  int fieldCount=rsMeta.getFieldCount();
  int[] sortKeyIndexs=new int[fieldCount];
  String[] sortKeyNames=new String[fieldCount];
  boolean[] ascending=new boolean[fieldCount];
  Comparator[] comparator=new Comparator[fieldCount];
  for (int i=0; i < fieldCount; i++) {
    sortKeyIndexs[i]=i + 1;
    ascending[i]=true;
  }
  return new SortSpec(sortKeyIndexs,sortKeyNames,ascending,comparator);
}
Program: 73418
Project: 73418
Buggy source:
/** 
 * @return
 */
public int length(){
  if (sortAscending != null)   return sortAscending.length;
 else   return 0;
}

Fixed version (ground truth):
/** 
 * @return
 */
public int length(){
  if (getSortAscending() != null)   return getSortAscending().length;
 else   return 0;
}
Program: 73419
Project: 73419
Buggy source:
/** 
 * @param sortKeyIndexes
 * @param sortKeyColumns
 * @param sortAscending
 */
public SortSpec(int[] sortKeyIndexes,String[] sortKeyColumns,boolean[] sortAscending){
  this.sortKeyIndexes=sortKeyIndexes;
  this.sortKeyColumns=sortKeyColumns;
  this.sortAscending=sortAscending;
}

Fixed version (ground truth):
/** 
 * @param sortKeyIndexes
 * @param sortKeyColumns
 * @param sortAscending
 */
public SortSpec(int[] sortKeyIndexes,String[] sortKeyColumns,boolean[] sortAscending,Comparator[] comparator){
  this.setSortKeyIndexes(sortKeyIndexes);
  this.setSortKeyColumns(sortKeyColumns);
  this.setSortAscending(sortAscending);
  this.setComparator(comparator);
}
Program: 73420
Project: 73420
Buggy source:
/** 
 * @param stopSign
 * @throws DataException
 */
private void doRowSorting(StopSign stopSign) throws DataException {
  this.populator.getQuery().setOrdering(this.cachedSort);
  if (this.populator.getGroupProcessorManager().getGroupCalculationUtil().getSortSpec() != null && this.populator.getGroupProcessorManager().getGroupCalculationUtil().getSortSpec().length() > 0) {
    PassUtil.pass(this.populator,new OdiResultSetWrapper(populator.getResultIterator()),true,stopSign);
    this.groupingDone=true;
  }
}

Fixed version (ground truth):
/** 
 * @param stopSign
 * @throws DataException
 */
private void doRowSorting(StopSign stopSign) throws DataException {
  this.populator.getQuery().setOrdering(this.cachedSort);
  SortSpec spec=this.populator.getGroupProcessorManager().getGroupCalculationUtil().getSortSpec();
  if (spec != null && spec.length() > 0) {
    PassUtil.pass(this.populator,new OdiResultSetWrapper(populator.getResultIterator()),true,stopSign);
    this.groupingDone=true;
  }
}
Program: 73421
Project: 73421
Buggy source:
private static String toString_SortDefinition(Object source){
  SortDefinition sort=(SortDefinition)source;
  StringBuffer stringBuffer=new StringBuffer("String_Node_Str");
  if (!isEmpty(sort.getColumn()))   stringBuffer.append("String_Node_Str" + sort.getColumn() + "String_Node_Str");
  if (!isEmpty(sort.getExpression()))   stringBuffer.append("String_Node_Str" + sort.getExpression() + "String_Node_Str");
  stringBuffer.append("String_Node_Str" + sort.getSortDirection() + "String_Node_Str");
  return stringBuffer.toString();
}

Fixed version (ground truth):
private static String toString_SortDefinition(Object source){
  SortDefinition sort=(SortDefinition)source;
  StringBuffer stringBuffer=new StringBuffer("String_Node_Str");
  if (!isEmpty(sort.getColumn()))   stringBuffer.append("String_Node_Str" + sort.getColumn() + "String_Node_Str");
  if (!isEmpty(sort.getExpression()))   stringBuffer.append("String_Node_Str" + sort.getExpression() + "String_Node_Str");
  stringBuffer.append("String_Node_Str" + sort.getSortDirection() + "String_Node_Str");
  stringBuffer.append("String_Node_Str" + sort.getSortStrength() + "String_Node_Str");
  return stringBuffer.toString();
}
Program: 73422
Project: 73422
Buggy source:
/** 
 * Populate the sortings in a query.
 * @throws DataException
 */
private void populateSorting() throws DataException {
  List sorts=this.baseQueryDefn.getSorts();
  if (sorts != null && !sorts.isEmpty()) {
    IQuery.SortSpec[] sortSpecs=new IQuery.SortSpec[sorts.size()];
    Iterator it=sorts.iterator();
    for (int i=0; it.hasNext(); i++) {
      ISortDefinition src=(ISortDefinition)it.next();
      int sortIndex=-1;
      String sortKey=src.getColumn();
      if (sortKey == null)       sortKey=src.getExpression().getText();
 else {
        sortKey=getColumnRefExpression(sortKey);
      }
      temporaryComputedColumns.add(new ComputedColumn("String_Node_Str" + i + "String_Node_Str",sortKey,DataType.ANY_TYPE));
      sortIndex=-1;
      sortKey=String.valueOf("String_Node_Str" + i + "String_Node_Str");
      IQuery.SortSpec dest=new IQuery.SortSpec(sortIndex,sortKey,src.getSortDirection() == ISortDefinition.SORT_ASC);
      sortSpecs[i]=dest;
    }
    odiQuery.setOrdering(Arrays.asList(sortSpecs));
  }
}

Fixed version (ground truth):
/** 
 * Populate the sortings in a query.
 * @throws DataException
 */
private void populateSorting() throws DataException {
  List sorts=this.baseQueryDefn.getSorts();
  if (sorts != null && !sorts.isEmpty()) {
    IQuery.SortSpec[] sortSpecs=new IQuery.SortSpec[sorts.size()];
    Iterator it=sorts.iterator();
    for (int i=0; it.hasNext(); i++) {
      ISortDefinition src=(ISortDefinition)it.next();
      int sortIndex=-1;
      String sortKey=src.getColumn();
      if (sortKey == null)       sortKey=src.getExpression().getText();
 else {
        sortKey=getColumnRefExpression(sortKey);
      }
      temporaryComputedColumns.add(new ComputedColumn("String_Node_Str" + i + "String_Node_Str",sortKey,DataType.ANY_TYPE));
      sortIndex=-1;
      sortKey=String.valueOf("String_Node_Str" + i + "String_Node_Str");
      IQuery.SortSpec dest=new IQuery.SortSpec(sortIndex,sortKey,src.getSortDirection() == ISortDefinition.SORT_ASC,src.getSortStrength() == -1 ? null : Collator.getInstance());
      sortSpecs[i]=dest;
    }
    odiQuery.setOrdering(Arrays.asList(sortSpecs));
  }
}
Program: 73423
Project: 73423
Buggy source:
/** 
 * Convert IGroupDefn to IQuery.GroupSpec
 * @param cx
 * @param src
 * @return
 * @throws DataException
 */
static IQuery.GroupSpec groupDefnToSpec(Context cx,IGroupDefinition src,String expr,String columnName,int index) throws DataException {
  ColumnInfo groupKeyInfo=new ColumnInfo(index,columnName);
  int groupIndex=groupKeyInfo.getColumnIndex();
  String groupKey=groupKeyInfo.getColumnName();
  boolean isComplexExpression=true;
  IQuery.GroupSpec dest=new IQuery.GroupSpec(groupIndex,groupKey);
  dest.setName(src.getName());
  dest.setInterval(src.getInterval());
  dest.setIntervalRange(src.getIntervalRange());
  dest.setIntervalStart(src.getIntervalStart());
  dest.setSortDirection(src.getSortDirection() != ISortDefinition.SORT_DESC ? ISortDefinition.SORT_ASC : ISortDefinition.SORT_DESC);
  dest.setFilters(src.getFilters());
  if (src.getSorts().size() != 0) {
    dest.setSorts(src.getSorts());
  }
  dest.setIsComplexExpression(isComplexExpression);
  return dest;
}

Fixed version (ground truth):
/** 
 * Convert IGroupDefn to IQuery.GroupSpec
 * @param cx
 * @param src
 * @return
 * @throws DataException
 */
static IQuery.GroupSpec groupDefnToSpec(Context cx,IGroupDefinition src,String expr,String columnName,int index) throws DataException {
  ColumnInfo groupKeyInfo=new ColumnInfo(index,columnName);
  int groupIndex=groupKeyInfo.getColumnIndex();
  String groupKey=groupKeyInfo.getColumnName();
  boolean isComplexExpression=true;
  IQuery.GroupSpec dest=new IQuery.GroupSpec(groupIndex,groupKey);
  dest.setName(src.getName());
  dest.setInterval(src.getInterval());
  dest.setIntervalRange(src.getIntervalRange());
  dest.setIntervalStart(src.getIntervalStart());
  dest.setSortDirection(src.getSortDirection());
  dest.setFilters(src.getFilters());
  if (src.getSorts().size() != 0) {
    dest.setSorts(src.getSorts());
  }
  dest.setIsComplexExpression(isComplexExpression);
  return dest;
}
Program: 73424
Project: 73424
Buggy source:
/** 
 * @param inputStream
 * @return
 * @throws DataException 
 */
static List loadGroupDefn(InputStream inputStream,IBaseQueryDefinition parent,int version) throws DataException {
  List groupList=new ArrayList();
  DataInputStream dis=new DataInputStream(inputStream);
  try {
    int size=IOUtil.readInt(inputStream);
    for (int i=0; i < size; i++) {
      GroupDefinition groupDefn=new GroupDefinition(IOUtil.readString(dis));
      String keyColumn=IOUtil.readString(dis);
      String keyExpr=IOUtil.readString(dis);
      if (keyColumn != null)       groupDefn.setKeyColumn(keyColumn);
 else       groupDefn.setKeyExpression(keyExpr);
      groupDefn.setInterval(IOUtil.readInt(dis));
      groupDefn.setIntervalRange(IOUtil.readDouble(dis));
      groupDefn.setSortDirection(IOUtil.readInt(dis));
      groupDefn.getFilters().addAll(FilterDefnUtil.loadFilterDefn(dis));
      groupDefn.getSorts().addAll(QueryDefnIOUtil.loadSorts(dis));
      groupDefn.getSubqueries().addAll(QueryDefnIOUtil.loadSubQuery(dis,parent,version));
      groupList.add(groupDefn);
    }
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e);
  }
  return groupList;
}

Fixed version (ground truth):
/** 
 * @param inputStream
 * @return
 * @throws DataException 
 */
static List loadGroupDefn(InputStream inputStream,IBaseQueryDefinition parent,int version) throws DataException {
  List groupList=new ArrayList();
  DataInputStream dis=new DataInputStream(inputStream);
  try {
    int size=IOUtil.readInt(inputStream);
    for (int i=0; i < size; i++) {
      GroupDefinition groupDefn=new GroupDefinition(IOUtil.readString(dis));
      String keyColumn=IOUtil.readString(dis);
      String keyExpr=IOUtil.readString(dis);
      if (keyColumn != null)       groupDefn.setKeyColumn(keyColumn);
 else       groupDefn.setKeyExpression(keyExpr);
      groupDefn.setInterval(IOUtil.readInt(dis));
      groupDefn.setIntervalRange(IOUtil.readDouble(dis));
      groupDefn.setSortDirection(IOUtil.readInt(dis));
      groupDefn.getFilters().addAll(FilterDefnUtil.loadFilterDefn(dis));
      groupDefn.getSorts().addAll(QueryDefnIOUtil.loadSorts(dis,version));
      groupDefn.getSubqueries().addAll(QueryDefnIOUtil.loadSubQuery(dis,parent,version));
      groupList.add(groupDefn);
    }
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e);
  }
  return groupList;
}
Program: 73425
Project: 73425
Buggy source:
/** 
 * @param outputStream
 * @param filterList
 * @throws DataException
 */
static void saveGroupDefn(OutputStream outputStream,List groupList,int version) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  int size=groupList == null ? 0 : groupList.size();
  try {
    IOUtil.writeInt(dos,size);
    for (int i=0; i < size; i++) {
      IGroupDefinition groupDefn=(IGroupDefinition)groupList.get(i);
      IOUtil.writeString(dos,groupDefn.getName());
      IOUtil.writeString(dos,groupDefn.getKeyColumn());
      IOUtil.writeString(dos,groupDefn.getKeyExpression());
      IOUtil.writeInt(dos,groupDefn.getInterval());
      IOUtil.writeDouble(dos,groupDefn.getIntervalRange());
      IOUtil.writeInt(dos,groupDefn.getSortDirection());
      FilterDefnUtil.saveFilterDefn(dos,groupDefn.getFilters());
      QueryDefnIOUtil.saveSorts(dos,groupDefn.getSorts());
      QueryDefnIOUtil.saveSubQuery(dos,groupDefn.getSubqueries(),version);
    }
    dos.flush();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
/** 
 * @param outputStream
 * @param filterList
 * @throws DataException
 */
static void saveGroupDefn(OutputStream outputStream,List groupList,int version) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  int size=groupList == null ? 0 : groupList.size();
  try {
    IOUtil.writeInt(dos,size);
    for (int i=0; i < size; i++) {
      IGroupDefinition groupDefn=(IGroupDefinition)groupList.get(i);
      IOUtil.writeString(dos,groupDefn.getName());
      IOUtil.writeString(dos,groupDefn.getKeyColumn());
      IOUtil.writeString(dos,groupDefn.getKeyExpression());
      IOUtil.writeInt(dos,groupDefn.getInterval());
      IOUtil.writeDouble(dos,groupDefn.getIntervalRange());
      IOUtil.writeInt(dos,groupDefn.getSortDirection());
      FilterDefnUtil.saveFilterDefn(dos,groupDefn.getFilters());
      QueryDefnIOUtil.saveSorts(dos,groupDefn.getSorts(),version);
      QueryDefnIOUtil.saveSubQuery(dos,groupDefn.getSubqueries(),version);
    }
    dos.flush();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 73426
Project: 73426
Buggy source:
/** 
 * @param context
 * @param queryResultID
 * @param resultMetaData
 * @param subQueryName
 * @param currParentIndex
 */
QueryResults(String tempDir,DataEngineContext context,String baseResultID,String queryResultID,IResultMetaData resultMetaData,String subQueryName,int currParentIndex){
}

Fixed version (ground truth):
/** 
 * @param context
 * @param queryResultID
 * @param resultMetaData
 * @param subQueryName
 * @param currParentIndex
 */
QueryResults(String tempDir,DataEngineContext context,String baseResultID,String queryResultID,IResultMetaData resultMetaData,String subQueryName,int currParentIndex,IBaseQueryResults parentQueryResults){
}
Program: 73427
Project: 73427
Buggy source:
public IResultIterator getSecondaryIterator(String subQueryName,Scriptable scope) throws DataException {
  String parentQueryResultsID=null;
  if (this.subQueryName == null) {
    parentQueryResultsID=queryResultID;
  }
 else {
    parentQueryResultsID=queryResultID + "String_Node_Str" + this.subQueryName+ "String_Node_Str"+ this.subQueryIndex;
  }
  QueryResults queryResults=null;
  try {
    queryResults=new QueryResults(tempDir,context,queryResultID,parentQueryResultsID,this.getResultMetaData(),subQueryName,this.exprResultSet.getCurrentIndex());
  }
 catch (  Exception e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
  try {
    ResultIterator ri=(ResultIterator)queryResults.getResultIterator();
    ri.setSubQueryName(subQueryName);
    return ri;
  }
 catch (  BirtException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
}

Fixed version (ground truth):
public IResultIterator getSecondaryIterator(String subQueryName,Scriptable scope) throws DataException {
  String parentQueryResultsID=null;
  if (this.subQueryName == null) {
    parentQueryResultsID=queryResultID;
  }
 else {
    parentQueryResultsID=queryResultID + "String_Node_Str" + this.subQueryName+ "String_Node_Str"+ this.subQueryIndex;
  }
  QueryResults queryResults=null;
  try {
    queryResults=new QueryResults(tempDir,context,queryResultID,parentQueryResultsID,this.getResultMetaData(),subQueryName,this.exprResultSet.getCurrentIndex(),this.queryResults);
  }
 catch (  Exception e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
  try {
    ResultIterator ri=(ResultIterator)queryResults.getResultIterator();
    ri.setSubQueryName(subQueryName);
    return ri;
  }
 catch (  BirtException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
}
Program: 73428
Project: 73428
Buggy source:
protected IBaseResultSet doExecuteQuery(IBaseResultSet parentResult,IQueryDefinition query,boolean useCache) throws BirtException {
  String queryID=(String)queryIDMap.get(query);
  String resultSetID=loadResultSetID(parentResult,queryID);
  if (resultSetID == null) {
    throw new EngineException("String_Node_Str" + queryID);
  }
  IBaseQueryResults queryResults=dteSession.getQueryResults(resultSetID);
  QueryResultSet resultSet=null;
  if (parentResult == null) {
    resultSet=new QueryResultSet(this,context,query,(IQueryResults)queryResults);
  }
 else {
    resultSet=new QueryResultSet(this,context,parentResult,query,(IQueryResults)queryResults);
  }
  return resultSet;
}

Fixed version (ground truth):
protected IBaseResultSet doExecuteQuery(IBaseResultSet parentResult,IQueryDefinition query,boolean useCache) throws BirtException {
  String queryID=(String)queryIDMap.get(query);
  String resultSetID=loadResultSetID(parentResult,queryID);
  if (resultSetID == null) {
    throw new EngineException("String_Node_Str" + queryID);
  }
  ((QueryDefinition)query).setQueryResultsID(resultSetID);
  IPreparedQuery pq=dteSession.prepare(query);
  IBaseQueryResults queryResults=pq.execute(parentResult == null ? null : parentResult.getQueryResults(),context.getScope());
  QueryResultSet resultSet=null;
  if (parentResult == null) {
    resultSet=new QueryResultSet(this,context,query,(IQueryResults)queryResults);
  }
 else {
    resultSet=new QueryResultSet(this,context,parentResult,query,(IQueryResults)queryResults);
  }
  return resultSet;
}
Program: 73429
Project: 73429
Buggy source:
protected void okPressed(){
  expression=sourceViewer.getTextWidget().getText().trim();
  super.okPressed();
}

Fixed version (ground truth):
protected void okPressed(){
  if (!validateScript()) {
    MessageDialog dialog=new MessageDialog(getShell(),Messages.getString("String_Node_Str"),null,Messages.getString("String_Node_Str"),MessageDialog.WARNING,new String[]{IDialogConstants.OK_LABEL,IDialogConstants.CANCEL_LABEL},1);
    if (dialog.open() != 0) {
      return;
    }
  }
  expression=sourceViewer.getTextWidget().getText().trim();
  super.okPressed();
}
Program: 73430
Project: 73430
Buggy source:
/** 
 * get the sub cube query result from the current query.
 * @param parent
 * @param query
 * @return
 * @throws BirtException
 */
protected IBaseResultSet doExecuteSubCubeQuery(ICubeResultSet parent,ISubCubeQueryDefinition query) throws BirtException {
  Scriptable scope=context.getSharedScope();
  IBasePreparedQuery pQuery=(IBasePreparedQuery)queryMap.get(query);
  if (pQuery == null) {
    throw new EngineException("String_Node_Str" + query);
  }
  ICubeQueryResults dteResults=(ICubeQueryResults)dteSession.execute(pQuery,parent.getQueryResults(),scope);
  IBaseResultSet resultSet=new CubeResultSet(this,context,parent,query,(ICubeQueryResults)dteResults);
  return resultSet;
}

Fixed version (ground truth):
/** 
 * get the sub cube query result from the current query.
 * @param parent
 * @param query
 * @return
 * @throws BirtException
 */
protected IBaseResultSet doExecuteSubCubeQuery(ICubeResultSet parent,ISubCubeQueryDefinition query) throws BirtException {
  Scriptable scope=context.getSharedScope();
  IBasePreparedQuery pQuery=dteSession.prepare(query,appContext);
  ICubeQueryResults dteResults=(ICubeQueryResults)dteSession.execute(pQuery,parent.getQueryResults(),scope);
  IBaseResultSet resultSet=new CubeResultSet(this,context,parent,query,(ICubeQueryResults)dteResults);
  return resultSet;
}
Program: 73431
Project: 73431
Buggy source:
/** 
 * Gets the parameter
 * @param params
 * @return
 */
private boolean getParameterValues(List params){
  if (params != null && params.size() > 0) {
    InputParameterDialog dialog=new InputParameterDialog(DebugUI.getShell(),params,paramValues);
    if (dialog.open() == Window.OK) {
      paramValues=dialog.getParameters();
      return true;
    }
 else {
      return false;
    }
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
/** 
 * Gets the parameter
 * @param params
 * @return
 */
private static boolean getParameterValues(List params,Map paramValues){
  if (params != null && params.size() > 0) {
    InputParameterDialog dialog=new InputParameterDialog(DebugUI.getShell(),params,paramValues);
    if (dialog.open() == Window.OK) {
      paramValues.clear();
      paramValues.putAll(dialog.getParameters());
      return true;
    }
 else {
      return false;
    }
  }
 else {
    return true;
  }
}
Program: 73432
Project: 73432
Buggy source:
protected static int findFreePort(){
  ServerSocket socket=null;
  try {
    socket=new ServerSocket(0);
    return socket.getLocalPort();
  }
 catch (  IOException e) {
  }
 finally {
    if (socket != null) {
      try {
        socket.close();
      }
 catch (      IOException e) {
      }
    }
  }
  return -1;
}

Fixed version (ground truth):
private static int findFreePort(){
  ServerSocket socket=null;
  try {
    socket=new ServerSocket(0);
    return socket.getLocalPort();
  }
 catch (  IOException e) {
  }
 finally {
    if (socket != null) {
      try {
        socket.close();
      }
 catch (      IOException e) {
      }
    }
  }
  return -1;
}
Program: 73433
Project: 73433
Buggy source:
void init(ILaunchConfiguration configuration){
  engineConfig=new LauncherEngineConfig();
  IReportEngineFactory factory=(IReportEngineFactory)Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
  engine=factory.createReportEngine(engineConfig);
  engine.changeLogLevel(Level.WARNING);
  configEngine();
  try {
    fileName=covertVariables(configuration.getAttribute(ATTR_REPORT_FILE_NAME,"String_Node_Str"));
    engineHome=covertVariables(configuration.getAttribute(ATTR_ENGINE_HOME,"String_Node_Str"));
    tempFolder=covertVariables(configuration.getAttribute(ATTR_TEMP_FOLDER,"String_Node_Str"));
    useDefaultEngineHome=configuration.getAttribute(ATTR_USE_DEFULT_ENGINE_HOME,true);
    targetFormat=configuration.getAttribute(ATTR_TARGET_FORMAT,DEFAULT_TARGET_FORMAT);
    isOpenTargetFile=configuration.getAttribute(ATTR_OPEN_TARGET,false);
    debugType=configuration.getAttribute(ATTR_DEBUG_TYPE,DEFAULT_DEBUG_TYPE);
    taskType=configuration.getAttribute(ATTR_TASK_TYPE,DEFAULT_TASK_TYPE);
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
void init(ILaunchConfiguration configuration) throws CoreException {
  fileName=covertVariables(configuration.getAttribute(ATTR_REPORT_FILE_NAME,"String_Node_Str"));
  engineHome=covertVariables(configuration.getAttribute(ATTR_ENGINE_HOME,"String_Node_Str"));
  tempFolder=covertVariables(configuration.getAttribute(ATTR_TEMP_FOLDER,"String_Node_Str"));
  useDefaultEngineHome=configuration.getAttribute(ATTR_USE_DEFULT_ENGINE_HOME,true);
  targetFormat=configuration.getAttribute(ATTR_TARGET_FORMAT,DEFAULT_TARGET_FORMAT);
  isOpenTargetFile=configuration.getAttribute(ATTR_OPEN_TARGET,false);
  debugType=configuration.getAttribute(ATTR_DEBUG_TYPE,DEFAULT_DEBUG_TYPE);
  taskType=configuration.getAttribute(ATTR_TASK_TYPE,DEFAULT_TASK_TYPE);
}
Program: 73434
Project: 73434
Buggy source:
private String convertClassPath(String[] cp){
  int pathCount=0;
  StringBuffer buf=new StringBuffer();
  if (cp == null || cp.length == 0) {
    return "String_Node_Str";
  }
  for (int i=0; i < cp.length; i++) {
    if (pathCount > 0) {
      buf.append(File.pathSeparator);
    }
    buf.append(cp[i]);
    pathCount++;
  }
  return buf.toString();
}

Fixed version (ground truth):
private static String convertClassPath(String[] cp){
  int pathCount=0;
  StringBuffer buf=new StringBuffer();
  if (cp == null || cp.length == 0) {
    return "String_Node_Str";
  }
  for (int i=0; i < cp.length; i++) {
    if (pathCount > 0) {
      buf.append(File.pathSeparator);
    }
    buf.append(cp[i]);
    pathCount++;
  }
  return buf.toString();
}
Program: 73435
Project: 73435
Buggy source:
private List getInputParameters(String reportDesignFile){
  try {
    IGetParameterDefinitionTask task;
    if (taskType == TASK_TYPE_RENDER) {
      task=engine.createGetParameterDefinitionTask(engine.openReportDocument(reportDesignFile).getReportRunnable());
    }
 else {
      task=engine.createGetParameterDefinitionTask(engine.openReportDesign(reportDesignFile));
    }
    ParameterFactory factory=new ParameterFactory(task);
    List parameters=factory.getRootChildren();
    task.close();
    task=null;
    return parameters;
  }
 catch (  EngineException e) {
  }
  return null;
}

Fixed version (ground truth):
private static List getInputParameters(String reportDesignFile,int taskType,IReportEngine engine){
  IGetParameterDefinitionTask task=null;
  try {
    if (taskType == TASK_TYPE_RENDER) {
      task=engine.createGetParameterDefinitionTask(engine.openReportDocument(reportDesignFile).getReportRunnable());
    }
 else {
      task=engine.createGetParameterDefinitionTask(engine.openReportDesign(reportDesignFile));
    }
    ParameterFactory factory=new ParameterFactory(task);
    List parameters=factory.getRootChildren();
    task.close();
    task=null;
    return parameters;
  }
 catch (  EngineException e) {
    if (task != null) {
      task.close();
    }
  }
  return null;
}
Program: 73436
Project: 73436
Buggy source:
public void run(){
  result[0]=new Boolean(getParameterValues(getInputParameters(fileName)));
}

Fixed version (ground truth):
public void run(){
  result[0]=new Boolean(getParameterValues(getInputParameters(fileName,taskType,engine),paramValues));
}
Program: 73437
Project: 73437
Buggy source:
private void configEngine(){
  HTMLRenderOption emitterConfig=new HTMLRenderOption();
  emitterConfig.setActionHandler(new HTMLActionHandler(){
    public String getURL(    IAction actionDefn,    Object context){
      if (actionDefn.getType() == IAction.ACTION_DRILLTHROUGH)       return "String_Node_Str" + URLEncoder.encode(super.getURL(actionDefn,context));
      return super.getURL(actionDefn,context);
    }
  }
);
  engineConfig.getEmitterConfigs().put(RenderOption.OUTPUT_FORMAT_HTML,emitterConfig);
}

Fixed version (ground truth):
private static void configEngine(EngineConfig engineConfig){
  HTMLRenderOption emitterConfig=new HTMLRenderOption();
  emitterConfig.setActionHandler(new HTMLActionHandler(){
    public String getURL(    IAction actionDefn,    Object context){
      if (actionDefn.getType() == IAction.ACTION_DRILLTHROUGH)       return "String_Node_Str" + URLEncoder.encode(super.getURL(actionDefn,context));
      return super.getURL(actionDefn,context);
    }
  }
);
  engineConfig.getEmitterConfigs().put(RenderOption.OUTPUT_FORMAT_HTML,emitterConfig);
}
Program: 73438
Project: 73438
Buggy source:
private String[] getUserClasspath(ILaunchConfiguration configuration){
  try {
    ScriptDebugClasspathProvider provider=new ScriptDebugClasspathProvider();
    IRuntimeClasspathEntry[] entries=provider.computeUserClasspath(configuration);
    entries=JavaRuntime.resolveRuntimeClasspath(entries,configuration);
    List userEntries=new ArrayList();
    Set set=new HashSet(entries.length);
    for (int i=0; i < entries.length; i++) {
      if (entries[i].getClasspathProperty() == IRuntimeClasspathEntry.USER_CLASSES) {
        String location=entries[i].getLocation();
        if (location != null) {
          if (!set.contains(location)) {
            userEntries.add(location);
            set.add(location);
          }
        }
      }
    }
    return (String[])userEntries.toArray(new String[userEntries.size()]);
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
private static String[] getUserClasspath(ILaunchConfiguration configuration){
  try {
    ScriptDebugClasspathProvider provider=new ScriptDebugClasspathProvider();
    IRuntimeClasspathEntry[] entries=provider.computeUserClasspath(configuration);
    entries=JavaRuntime.resolveRuntimeClasspath(entries,configuration);
    List userEntries=new ArrayList();
    Set set=new HashSet(entries.length);
    for (int i=0; i < entries.length; i++) {
      if (entries[i].getClasspathProperty() == IRuntimeClasspathEntry.USER_CLASSES) {
        String location=entries[i].getLocation();
        if (location != null) {
          if (!set.contains(location)) {
            userEntries.add(location);
            set.add(location);
          }
        }
      }
    }
    return (String[])userEntries.toArray(new String[userEntries.size()]);
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
  return null;
}
Program: 73439
Project: 73439
Buggy source:
private String covertVariables(String str){
  try {
    return ScriptDebugUtil.getSubstitutedString(str);
  }
 catch (  CoreException e) {
    return str;
  }
}

Fixed version (ground truth):
private static String covertVariables(String str){
  try {
    return ScriptDebugUtil.getSubstitutedString(str);
  }
 catch (  CoreException e) {
    return str;
  }
}
Program: 73440
Project: 73440
Buggy source:
boolean finalLaunchCheck(final ILaunchConfiguration configuration,String mode,IProgressMonitor monitor) throws CoreException {
  if (engine == null) {
    init(configuration);
  }
  Display display=DebugUI.getStandardDisplay();
  if (display.getThread().equals(Thread.currentThread())) {
    return getParameterValues(getInputParameters(fileName));
  }
  final Object[] result=new Object[]{Boolean.FALSE};
  Runnable r=new Runnable(){
    public void run(){
      result[0]=new Boolean(getParameterValues(getInputParameters(fileName)));
    }
  }
;
  DebugUI.getStandardDisplay().syncExec(r);
  return ((Boolean)result[0]).booleanValue();
}

Fixed version (ground truth):
boolean finalLaunchCheck(final ILaunchConfiguration configuration,String mode,IProgressMonitor monitor) throws CoreException {
  paramValues=new HashMap();
  LauncherEngineConfig engineConfig=new LauncherEngineConfig();
  IReportEngineFactory factory=(IReportEngineFactory)Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
  final IReportEngine engine=factory.createReportEngine(engineConfig);
  engine.changeLogLevel(Level.WARNING);
  configEngine(engineConfig);
  final String fileName=covertVariables(configuration.getAttribute(ATTR_REPORT_FILE_NAME,"String_Node_Str"));
  final int taskType=configuration.getAttribute(ATTR_TASK_TYPE,DEFAULT_TASK_TYPE);
  Display display=DebugUI.getStandardDisplay();
  if (display.getThread().equals(Thread.currentThread())) {
    return getParameterValues(getInputParameters(fileName,taskType,engine),paramValues);
  }
  final Object[] result=new Object[]{Boolean.FALSE};
  Runnable r=new Runnable(){
    public void run(){
      result[0]=new Boolean(getParameterValues(getInputParameters(fileName,taskType,engine),paramValues));
    }
  }
;
  DebugUI.getStandardDisplay().syncExec(r);
  return ((Boolean)result[0]).booleanValue();
}
Program: 73441
Project: 73441
Buggy source:
/** 
 * Read a Map from an input stream
 * @param dos
 * @return
 * @throws IOException
 * @throws BirtException
 */
public final static Map readMap(DataInputStream dis) throws IOException {
  if (readInt(dis) == TYPE_NULL)   return null;
  Map dataMap=new HashMap();
  int size=readInt(dis);
  if (size == 0)   return dataMap;
  for (int i=0; i < size; i++) {
    Object key=readObject(dis);
    Object value=readObject(dis);
    dataMap.put(key,value);
  }
  return dataMap;
}

Fixed version (ground truth):
/** 
 * Read a Map from an input stream
 * @param dos
 * @return
 * @throws IOException
 * @throws BirtException
 */
public final static Map readMap(DataInputStream dis,ClassLoader loader) throws IOException {
  if (readInt(dis) == TYPE_NULL)   return null;
  Map dataMap=new HashMap();
  int size=readInt(dis);
  if (size == 0)   return dataMap;
  for (int i=0; i < size; i++) {
    Object key=readObject(dis,loader);
    Object value=readObject(dis,loader);
    dataMap.put(key,value);
  }
  return dataMap;
}
Program: 73442
Project: 73442
Buggy source:
/** 
 * Read a list from an input stream
 * @param dos
 * @return
 * @throws IOException
 * @throws BirtException
 */
public final static List readList(DataInputStream dis) throws IOException {
  if (readInt(dis) == TYPE_NULL)   return null;
  List dataList=new ArrayList();
  int size=readInt(dis);
  if (size == 0)   return dataList;
  for (int i=0; i < size; i++)   dataList.add(readObject(dis));
  return dataList;
}

Fixed version (ground truth):
/** 
 * Read a list from an input stream
 * @param dos
 * @return
 * @throws IOException
 * @throws BirtException
 */
public final static List readList(DataInputStream dis,ClassLoader classLoader) throws IOException {
  if (readInt(dis) == TYPE_NULL)   return null;
  List dataList=new ArrayList();
  int size=readInt(dis);
  if (size == 0)   return dataList;
  for (int i=0; i < size; i++)   dataList.add(readObject(dis,classLoader));
  return dataList;
}
Program: 73443
Project: 73443
Buggy source:
/** 
 * Currently these data types are supported. Integer Float Double BigDecimal Date Time Timestamp Boolean String byte[] List Map
 * @return
 * @throws IOException
 */
public final static Object readObject(DataInputStream dis) throws IOException {
}

Fixed version (ground truth):
/** 
 * Currently these data types are supported. Integer Float Double BigDecimal Date Time Timestamp Boolean String byte[] List Map
 * @return
 * @throws IOException
 */
public final static Object readObject(DataInputStream dis,ClassLoader classLoader) throws IOException {
}
Program: 73444
Project: 73444
Buggy source:
public void testParameterWithDataSet() throws SemanticException, EngineException {
  IReportRunnable report=engine.openReportDesign(REPORT_DESIGN);
  ReportDesignHandle design=(ReportDesignHandle)report.getDesignHandle().getModuleHandle();
  ScalarParameterHandle parameter1=(ScalarParameterHandle)design.findParameter("String_Node_Str");
  parameter1.setDataSetName("String_Node_Str");
  ScalarParameterHandle parameter2=(ScalarParameterHandle)design.findParameter("String_Node_Str");
  parameter2.setDataSetName("String_Node_Str");
  GetParameterDefinitionTask task=new GetParameterDefinitionTask(engine,report);
  Collection list=task.getSelectionListForCascadingGroup("String_Node_Str",new Object[0]);
  Object[] content=list.toArray();
  assertEquals("String_Node_Str",(SelectionChoiceUtil.getValue(content[0])));
  list=task.getSelectionListForCascadingGroup("String_Node_Str",new Object[]{"String_Node_Str"});
  content=list.toArray();
  assertEquals("String_Node_Str",(SelectionChoiceUtil.getValue(content[0])));
}

Fixed version (ground truth):
public void testParameterWithDataSet() throws SemanticException, EngineException {
  IReportRunnable report=engine.openReportDesign(REPORT_DESIGN);
  ReportDesignHandle design=(ReportDesignHandle)report.getDesignHandle().getModuleHandle();
  ScalarParameterHandle parameter1=(ScalarParameterHandle)design.findParameter("String_Node_Str");
  parameter1.setDataSetName("String_Node_Str");
  ScalarParameterHandle parameter2=(ScalarParameterHandle)design.findParameter("String_Node_Str");
  parameter2.setDataSetName("String_Node_Str");
  IGetParameterDefinitionTask task=engine.createGetParameterDefinitionTask(report);
  Collection list=task.getSelectionListForCascadingGroup("String_Node_Str",new Object[0]);
  Object[] content=list.toArray();
  assertEquals("String_Node_Str",(SelectionChoiceUtil.getValue(content[0])));
  list=task.getSelectionListForCascadingGroup("String_Node_Str",new Object[]{"String_Node_Str"});
  content=list.toArray();
  assertEquals("String_Node_Str",(SelectionChoiceUtil.getValue(content[0])));
}