nus-yam/ex-repair huggingface dataset:
Program: 72807
Project: 72807
Buggy source:
/** 
 * @param handle
 */
public DeleteStyleAction(SharedStyleHandle handle){
  this.handle=handle;
  setId(ID);
  if (handle.getContainerSlotHandle().getElementHandle() instanceof ThemeHandle) {
    setText(((ThemeHandle)handle.getContainerSlotHandle().getElementHandle()).getName() + "String_Node_Str" + DEUtil.getEscapedMenuItemText(DEUtil.getDisplayLabel(handle,false)));
  }
 else {
    setText(DEUtil.getEscapedMenuItemText(DEUtil.getDisplayLabel(handle,false)));
  }
  action=new DeleteAction(handle);
}

Fixed version (ground truth):
/** 
 * @param handle
 */
public DeleteStyleAction(SharedStyleHandle handle){
  setId(ID);
  if (handle.getContainerSlotHandle() != null && handle.getContainerSlotHandle().getElementHandle() instanceof ThemeHandle) {
    setText(((ThemeHandle)handle.getContainerSlotHandle().getElementHandle()).getName() + "String_Node_Str" + DEUtil.getEscapedMenuItemText(DEUtil.getDisplayLabel(handle,false)));
  }
 else {
    setText(DEUtil.getEscapedMenuItemText(DEUtil.getDisplayLabel(handle,false)));
  }
  action=new DeleteAction(handle);
}
Program: 72808
Project: 72808
Buggy source:
public IBinding adaptBinding(ComputedColumnHandle handle) throws AdapterException {
  if (handle == null)   return null;
  Binding result=new Binding(handle.getName(),new ScriptExpression(handle.getExpression()));
  result.setDataType(org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelDataType(handle.getDataType()));
  result.setAggrFunction(org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelAggregationType(handle.getAggregateFunction()));
  result.setFilter(handle.getFilterExpression() == null ? null : new ScriptExpression(handle.getFilterExpression()));
  populateArgument(result,handle);
  populateAggregateOns(result,handle);
  return result;
}

Fixed version (ground truth):
public IBinding adaptBinding(ComputedColumnHandle handle) throws AdapterException {
  if (handle == null)   return null;
  Binding result=new Binding(handle.getName());
  if (handle.getExpression() != null)   result.setExpression(new ScriptExpression(handle.getExpression()));
  result.setDataType(org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelDataType(handle.getDataType()));
  result.setAggrFunction(org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelAggregationType(handle.getAggregateFunction()));
  result.setFilter(handle.getFilterExpression() == null ? null : new ScriptExpression(handle.getFilterExpression()));
  populateArgument(result,handle);
  populateAggregateOns(result,handle);
  return result;
}
Program: 72811
Project: 72811
Buggy source:
public int getCellWidth(int col,int cs){
  int[] cols=getCurrentTblCols();
  int w=0;
  for (int i=col; i < col + cs; i++) {
    w+=cols[i];
  }
  return w;
}

Fixed version (ground truth):
public int getCellWidth(int col,int cs){
  int[] cols=getCurrentTblCols();
  int w=0;
  int colNum=Math.min(col + cs,WordEmitter.MAX_COLUMN);
  for (int i=col; i < colNum; i++) {
    w+=cols[i];
  }
  return w;
}
Program: 72812
Project: 72812
Buggy source:
private void readjustBounds(PWA3DComputeContext context,Bounds adjustedBounds,Bounds bo) throws ChartException {
  Rectangle rectl=this.getBoundsOfAllAxisLabels();
  double new_top=adjustedBounds.getTop();
  double new_height=adjustedBounds.getHeight();
  double new_left=adjustedBounds.getLeft();
  double new_width=adjustedBounds.getWidth();
  double dYAxisTitleThickness=this.computeYAxisTitleThickness();
  double dXAxisTitleThickness=this.computeXAxisTitleThickness();
  double rect_width=rectl.width + dYAxisTitleThickness + 5;
  if (bo.getWidth() < rect_width) {
    new_left+=bo.getLeft() - rectl.x;
    new_width+=bo.getWidth() - rect_width;
  }
 else {
    new_left+=bo.getLeft() - (rect_width - bo.getWidth()) / 2 - rectl.x;
  }
  double rect_height=rectl.height + dXAxisTitleThickness + 5;
  if (bo.getHeight() < rect_height) {
    new_top+=bo.getTop() - rectl.y;
    new_height+=bo.getHeight() - rect_height;
  }
 else {
    new_top+=bo.getTop() - (rect_height - bo.getHeight()) / 2 - rectl.y;
  }
  adjustedBounds.setLeft(new_left);
  adjustedBounds.setTop(new_top);
  adjustedBounds.setWidth(new_width);
  adjustedBounds.setHeight(new_height);
}

Fixed version (ground truth):
private void readjustBounds(PWA3DComputeContext context,Bounds adjustedBounds,Bounds bo) throws ChartException {
  Rectangle rectl=this.getBoundsOfAllAxisLabels();
  double new_top=adjustedBounds.getTop();
  double new_height=adjustedBounds.getHeight();
  double new_left=adjustedBounds.getLeft();
  double new_width=adjustedBounds.getWidth();
  double dYAxisTitleThickness=this.computeYAxisTitleThickness();
  double dXAxisTitleThickness=this.computeXAxisTitleThickness();
  double rect_width=rectl.width + 2 * dYAxisTitleThickness + 5;
  if (bo.getWidth() < rect_width) {
    new_left+=bo.getLeft() - rectl.x + dYAxisTitleThickness;
    new_width+=bo.getWidth() - rect_width;
  }
 else {
    new_left+=bo.getLeft() - (rect_width - bo.getWidth()) / 2 - rectl.x;
  }
  double rect_height=rectl.height + dXAxisTitleThickness + 5;
  if (bo.getHeight() < rect_height) {
    new_top+=bo.getTop() - rectl.y;
    new_height+=bo.getHeight() - rect_height;
  }
 else {
    new_top+=bo.getTop() - (rect_height - bo.getHeight()) / 2 - rectl.y;
  }
  adjustedBounds.setLeft(new_left);
  adjustedBounds.setTop(new_top);
  adjustedBounds.setWidth(new_width);
  adjustedBounds.setHeight(new_height);
}
Program: 72814
Project: 72814
Buggy source:
/** 
 * validate on calculated member to verify whether the measure reference exist.
 * @param cube
 * @param measureDefn
 * @throws DataException
 */
static void validateCalculatedMember(ICubeQueryDefinition defn,ICube cube,CalculatedMember[] calculatedMember) throws DataException {
  boolean findMeasure=false;
  for (int i=0; i < calculatedMember.length; i++) {
    findMeasure=false;
    String measureName=calculatedMember[i].getMeasureName();
    String[] names=cube.getMeasureNames();
    if (names != null && names.length > 0) {
      for (int k=0; k < names.length; k++) {
        if (names[k].equals(measureName)) {
          findMeasure=true;
          break;
        }
      }
    }
    if (!findMeasure) {
      List computedMeasures=defn.getComputedMeasures();
      for (int k=0; k < computedMeasures.size(); k++) {
        if (((ComputedMeasureDefinition)computedMeasures.get(k)).getName().equals(measureName)) {
          findMeasure=true;
          break;
        }
      }
      final IAggrFunction aggrFunc=AggregationManager.getInstance().getAggregation(calculatedMember[i].getAggrFunction());
      if (!findMeasure && AggregationUtil.needDataField(aggrFunc))       throw new DataException(ResourceConstants.MEASURE_NAME_NOT_FOUND,new Object[]{measureName});
    }
  }
}

Fixed version (ground truth):
/** 
 * validate on calculated member to verify whether the measure reference exist.
 * @param cube
 * @param measureDefn
 * @throws DataException
 */
static void validateCalculatedMember(ICubeQueryDefinition defn,ICube cube,CalculatedMember[] calculatedMember) throws DataException {
  boolean findMeasure=false;
  for (int i=0; i < calculatedMember.length; i++) {
    findMeasure=false;
    String measureName=calculatedMember[i].getMeasureName();
    String[] names=cube.getMeasureNames();
    if (names != null && names.length > 0) {
      for (int k=0; k < names.length; k++) {
        if (names[k].equals(measureName)) {
          findMeasure=true;
          break;
        }
      }
    }
    if (!findMeasure) {
      List computedMeasures=defn.getComputedMeasures();
      for (int k=0; k < computedMeasures.size(); k++) {
        if (((ComputedMeasureDefinition)computedMeasures.get(k)).getName().equals(measureName)) {
          findMeasure=true;
          break;
        }
      }
      final IAggrFunction aggrFunc=AggregationManager.getInstance().getAggregation(calculatedMember[i].getAggrFunction());
    }
  }
}
Program: 72815
Project: 72815
Buggy source:
public DataGenerationEngine(ExecutionContext context,IDocArchiveWriter writer) throws Exception {
  super(context,writer);
  DataSessionContext dteSessionContext=new DataSessionContext(DataSessionContext.MODE_GENERATION,null,context.getSharedScope());
  dteSessionContext.setDocumentWriter(writer);
  DataEngineContext dteEngineContext=dteSessionContext.getDataEngineContext();
  dteEngineContext.setLocale(context.getLocale());
  String tempDir=getTempDir(context);
  if (tempDir != null) {
    dteEngineContext.setTmpdir(tempDir);
  }
  dteSession=DataRequestSession.newSession(dteSessionContext);
  dos=new DataOutputStream(writer.createRandomAccessStream(ReportDocumentConstants.DATA_META_STREAM));
  DteMetaInfoIOUtil.startMetaInfo(dos);
}

Fixed version (ground truth):
public DataGenerationEngine(ExecutionContext context,IDocArchiveWriter writer) throws Exception {
  super(context,writer);
  DataSessionContext dteSessionContext=new DataSessionContext(DataSessionContext.MODE_GENERATION,null,context.getSharedScope());
  dteSessionContext.setDocumentWriter(writer);
  DataEngineContext dteEngineContext=dteSessionContext.getDataEngineContext();
  dteEngineContext.setLocale(context.getLocale());
  dteEngineContext.setClassLoader(context.getApplicationClassLoader());
  String tempDir=getTempDir(context);
  if (tempDir != null) {
    dteEngineContext.setTmpdir(tempDir);
  }
  dteSession=DataRequestSession.newSession(dteSessionContext);
  dos=new DataOutputStream(writer.createRandomAccessStream(ReportDocumentConstants.DATA_META_STREAM));
  DteMetaInfoIOUtil.startMetaInfo(dos);
}
Program: 72816
Project: 72816
Buggy source:
public DataInteractiveEngine(ExecutionContext context,IDocArchiveReader reader,IDocArchiveWriter writer) throws Exception {
  super(context);
  DataSessionContext dteSessionContext=new DataSessionContext(DataSessionContext.MODE_UPDATE,null,context.getSharedScope());
  dteSessionContext.setDocumentReader(reader);
  dteSessionContext.setDocumentWriter(writer);
  DataEngineContext dteEngineContext=dteSessionContext.getDataEngineContext();
  dteEngineContext.setLocale(context.getLocale());
  String tempDir=getTempDir(context);
  if (tempDir != null) {
    dteEngineContext.setTmpdir(tempDir);
  }
  dteSession=DataRequestSession.newSession(dteSessionContext);
  loadDteMetaInfo(reader);
  if (writer != null && dos == null) {
    dos=new DataOutputStream(writer.createRandomAccessStream(ReportDocumentConstants.DATA_SNAP_META_STREAM));
    DteMetaInfoIOUtil.startMetaInfo(dos);
  }
}

Fixed version (ground truth):
public DataInteractiveEngine(ExecutionContext context,IDocArchiveReader reader,IDocArchiveWriter writer) throws Exception {
  super(context);
  DataSessionContext dteSessionContext=new DataSessionContext(DataSessionContext.MODE_UPDATE,null,context.getSharedScope());
  dteSessionContext.setDocumentReader(reader);
  dteSessionContext.setDocumentWriter(writer);
  DataEngineContext dteEngineContext=dteSessionContext.getDataEngineContext();
  dteEngineContext.setLocale(context.getLocale());
  dteEngineContext.setClassLoader(context.getApplicationClassLoader());
  String tempDir=getTempDir(context);
  if (tempDir != null) {
    dteEngineContext.setTmpdir(tempDir);
  }
  dteSession=DataRequestSession.newSession(dteSessionContext);
  loadDteMetaInfo(reader);
  if (writer != null && dos == null) {
    dos=new DataOutputStream(writer.createRandomAccessStream(ReportDocumentConstants.DATA_SNAP_META_STREAM));
    DteMetaInfoIOUtil.startMetaInfo(dos);
  }
}
Program: 72817
Project: 72817
Buggy source:
public DataPresentationEngine(ExecutionContext context,IDocArchiveReader reader) throws Exception {
  super(context);
  DataSessionContext dteSessionContext=new DataSessionContext(DataSessionContext.MODE_PRESENTATION,null,context.getSharedScope());
  dteSessionContext.setDocumentReader(reader);
  DataEngineContext dteEngineContext=dteSessionContext.getDataEngineContext();
  dteEngineContext.setLocale(context.getLocale());
  String tempDir=getTempDir(context);
  if (tempDir != null) {
    dteEngineContext.setTmpdir(tempDir);
  }
  dteSession=DataRequestSession.newSession(dteSessionContext);
  loadDteMetaInfo(reader);
}

Fixed version (ground truth):
public DataPresentationEngine(ExecutionContext context,IDocArchiveReader reader) throws Exception {
  super(context);
  DataSessionContext dteSessionContext=new DataSessionContext(DataSessionContext.MODE_PRESENTATION,null,context.getSharedScope());
  dteSessionContext.setDocumentReader(reader);
  DataEngineContext dteEngineContext=dteSessionContext.getDataEngineContext();
  dteEngineContext.setLocale(context.getLocale());
  dteEngineContext.setClassLoader(context.getApplicationClassLoader());
  String tempDir=getTempDir(context);
  if (tempDir != null) {
    dteEngineContext.setTmpdir(tempDir);
  }
  dteSession=DataRequestSession.newSession(dteSessionContext);
  loadDteMetaInfo(reader);
}
Program: 72818
Project: 72818
Buggy source:
protected void closeLayout(){
  if (root != null) {
    root.setContentHeight(childHeight);
    IStyle areaStyle=root.getStyle();
    int width=getCurrentIP() + getOffsetX() + getDimensionValue(areaStyle.getProperty(StyleConstants.STYLE_PADDING_RIGHT))+ getDimensionValue(areaStyle.getProperty(StyleConstants.STYLE_BORDER_RIGHT_WIDTH));
    root.setWidth(width);
    int height=0;
    Iterator iter=root.getChildren();
    while (iter.hasNext()) {
      AbstractArea child=(AbstractArea)iter.next();
      height=Math.max(height,child.getAllocatedHeight());
    }
    root.setContentHeight(height);
  }
}

Fixed version (ground truth):
protected void closeLayout(){
  if (root != null) {
    root.setContentHeight(childHeight);
    IStyle areaStyle=root.getStyle();
    int width=getCurrentIP() + getOffsetX() + getDimensionValue(areaStyle.getProperty(StyleConstants.STYLE_PADDING_RIGHT))+ getDimensionValue(areaStyle.getProperty(StyleConstants.STYLE_BORDER_RIGHT_WIDTH));
    root.setWidth(width);
    int height=0;
    Iterator iter=root.getChildren();
    while (iter.hasNext()) {
      AbstractArea child=(AbstractArea)iter.next();
      height=Math.max(height,child.getAllocatedHeight());
    }
    root.setContentHeight(height);
  }
  verticalAlign();
}
Program: 72819
Project: 72819
Buggy source:
protected void align(boolean lastLine){
  if (root == null) {
    return;
  }
  assert(parent instanceof PDFBlockStackingLM);
  String align=((PDFBlockStackingLM)parent).getTextAlign();
  if ((CSSConstants.CSS_RIGHT_VALUE.equalsIgnoreCase(align) || CSSConstants.CSS_CENTER_VALUE.equalsIgnoreCase(align))) {
    int spacing=root.getContentWidth() - getCurrentIP();
    Iterator iter=root.getChildren();
    while (iter.hasNext()) {
      AbstractArea area=(AbstractArea)iter.next();
      if (spacing > 0) {
        if (CSSConstants.CSS_RIGHT_VALUE.equalsIgnoreCase(align)) {
          area.setAllocatedPosition(spacing + area.getAllocatedX(),area.getAllocatedY());
        }
 else         if (CSSConstants.CSS_CENTER_VALUE.equalsIgnoreCase(align)) {
          area.setAllocatedPosition(spacing / 2 + area.getAllocatedX(),area.getAllocatedY());
        }
      }
    }
  }
 else   if (CSSConstants.CSS_JUSTIFY_VALUE.equalsIgnoreCase(align) && !lastLine) {
    justify();
  }
  Iterator iter=root.getChildren();
  int height=root.getHeight();
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    IStyle childStyle=child.getStyle();
    String vAlign=childStyle.getVerticalAlign();
    if (childStyle != null) {
      int spacing=height - child.getAllocatedHeight();
      if (spacing < 0) {
        spacing=0;
      }
      if (CSSConstants.CSS_BOTTOM_VALUE.equalsIgnoreCase(vAlign)) {
        child.setPosition(child.getX(),spacing + child.getY());
      }
 else       if (CSSConstants.CSS_MIDDLE_VALUE.equalsIgnoreCase(vAlign) || CSSConstants.CSS_BASELINE_VALUE.equalsIgnoreCase(vAlign)) {
        child.setPosition(child.getX(),spacing / 2 + child.getY());
      }
 else {
        int lineHeight=((PDFBlockStackingLM)parent).getLineHeight();
        if (lineHeight > 0) {
          child.setPosition(child.getX(),spacing / 2 + child.getY());
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void align(boolean lastLine){
  if (root == null) {
    return;
  }
  assert(parent instanceof PDFBlockStackingLM);
  String align=((PDFBlockStackingLM)parent).getTextAlign();
  if ((CSSConstants.CSS_RIGHT_VALUE.equalsIgnoreCase(align) || CSSConstants.CSS_CENTER_VALUE.equalsIgnoreCase(align))) {
    int spacing=root.getContentWidth() - getCurrentIP();
    Iterator iter=root.getChildren();
    while (iter.hasNext()) {
      AbstractArea area=(AbstractArea)iter.next();
      if (spacing > 0) {
        if (CSSConstants.CSS_RIGHT_VALUE.equalsIgnoreCase(align)) {
          area.setAllocatedPosition(spacing + area.getAllocatedX(),area.getAllocatedY());
        }
 else         if (CSSConstants.CSS_CENTER_VALUE.equalsIgnoreCase(align)) {
          area.setAllocatedPosition(spacing / 2 + area.getAllocatedX(),area.getAllocatedY());
        }
      }
    }
  }
 else   if (CSSConstants.CSS_JUSTIFY_VALUE.equalsIgnoreCase(align) && !lastLine) {
    justify();
  }
  verticalAlign();
}
Program: 72820
Project: 72820
Buggy source:
/** 
 * convert a object to given class Classes supported: Integer.class BigDecimal.class Boolean.class Time.class Date.class Double.class String.class Blob.class
 * @param source
 * @param toTypeClass
 * @return
 * @throws BirtException
 */
public static Object convert(Object source,Class toTypeClass) throws BirtException {
  if (toTypeClass == DataType.getClass(DataType.ANY_TYPE))   return source;
  if (toTypeClass == Integer.class)   return toInteger(source);
  if (toTypeClass == BigDecimal.class)   return toBigDecimal(source);
  if (toTypeClass == Boolean.class)   return toBoolean(source);
  if (toTypeClass == Time.class)   return toSqlTime(source);
  if (toTypeClass == java.sql.Date.class)   return toSqlDate(source);
  if (toTypeClass == java.sql.Timestamp.class)   return toDate(source);
  if (toTypeClass == Date.class)   return toDate(source);
  if (toTypeClass == Double.class)   return toDouble(source);
  if (toTypeClass == String.class)   return toString(source);
  if (toTypeClass == Blob.class) {
    if (source instanceof byte[])     return source;
 else     return toBlob(source);
  }
  if (toTypeClass == byte[].class)   return source;
  throw new CoreException(ResourceConstants.INVALID_TYPE,resourceBundle);
}

Fixed version (ground truth):
/** 
 * convert a object to given class Classes supported: Integer.class BigDecimal.class Boolean.class Time.class Date.class Double.class String.class Blob.class
 * @param source
 * @param toTypeClass
 * @return
 * @throws BirtException
 */
public static Object convert(Object source,Class toTypeClass) throws BirtException {
  if (source != null && source.getClass() == toTypeClass) {
    return source;
  }
  if (toTypeClass == DataType.getClass(DataType.ANY_TYPE))   return source;
  if (toTypeClass == Integer.class)   return toInteger(source);
  if (toTypeClass == BigDecimal.class)   return toBigDecimal(source);
  if (toTypeClass == Boolean.class)   return toBoolean(source);
  if (toTypeClass == Time.class)   return toSqlTime(source);
  if (toTypeClass == java.sql.Date.class)   return toSqlDate(source);
  if (toTypeClass == java.sql.Timestamp.class)   return toDate(source);
  if (toTypeClass == Date.class)   return toDate(source);
  if (toTypeClass == Double.class)   return toDouble(source);
  if (toTypeClass == String.class)   return toString(source);
  if (toTypeClass == Blob.class) {
    if (source instanceof byte[])     return source;
 else     return toBlob(source);
  }
  if (toTypeClass == byte[].class)   return source;
  throw new CoreException(ResourceConstants.INVALID_TYPE,resourceBundle);
}
Program: 72821
Project: 72821
Buggy source:
List getMeasures();

Fixed version (ground truth):
List<IMeasure> getMeasures();
Program: 72822
Project: 72822
Buggy source:
List getColumnLevels();

Fixed version (ground truth):
List<ILevel> getColumnLevels();
Program: 72823
Project: 72823
Buggy source:
List getRowLevels();

Fixed version (ground truth):
List<ILevel> getRowLevels();
Program: 72824
Project: 72824
Buggy source:
List getSortConditions();

Fixed version (ground truth):
List<ISortElement> getSortConditions();
Program: 72825
Project: 72825
Buggy source:
List getFilterConditions();

Fixed version (ground truth):
List<IFilterConditionElement> getFilterConditions();
Program: 72826
Project: 72826
Buggy source:
public CrosstabCellInstanceImpl(ICellContent content,ExtendedItemHandle modelHandle){
  this.content=content;
  this.modelHandle=modelHandle;
  if (modelHandle != null) {
    id=modelHandle.getID();
  }
  try {
    IReportItem item=modelHandle.getReportItem();
    if (item instanceof AggregationCellHandle) {
      type=TYPE_AGGREGATION;
    }
  }
 catch (  ExtendedElementException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public CrosstabCellInstanceImpl(ICellContent content,ExtendedItemHandle modelHandle,IReportContext context){
  this.content=content;
  this.modelHandle=modelHandle;
  this.context=context;
  if (modelHandle != null) {
    id=modelHandle.getID();
  }
  try {
    IReportItem item=modelHandle.getReportItem();
    if (item instanceof AggregationCellHandle) {
      type=TYPE_AGGREGATION;
    }
  }
 catch (  ExtendedElementException e) {
    e.printStackTrace();
  }
}
Program: 72827
Project: 72827
Buggy source:
public List getMeasures(){
  List ms=new ArrayList();
  for (int i=0; i < crh.getMeasureCount(); i++) {
    ms.add(new MeasureImpl(crh.getMeasure(i)));
  }
  return Collections.unmodifiableList(ms);
}

Fixed version (ground truth):
public List<IMeasure> getMeasures(){
  List<IMeasure> ms=new ArrayList<IMeasure>();
  for (int i=0; i < crh.getMeasureCount(); i++) {
    ms.add(new MeasureImpl(crh.getMeasure(i)));
  }
  return Collections.unmodifiableList(ms);
}
Program: 72828
Project: 72828
Buggy source:
public List getColumnLevels(){
  List ms=new ArrayList();
  for (int i=0; i < crh.getDimensionCount(COLUMN_AXIS_TYPE); i++) {
    DimensionViewHandle dv=crh.getDimension(COLUMN_AXIS_TYPE,i);
    for (int j=0; j < dv.getLevelCount(); j++) {
      ms.add(new LevelImpl(dv.getLevel(j)));
    }
  }
  return Collections.unmodifiableList(ms);
}

Fixed version (ground truth):
public List<ILevel> getColumnLevels(){
  List<ILevel> ms=new ArrayList<ILevel>();
  for (int i=0; i < crh.getDimensionCount(COLUMN_AXIS_TYPE); i++) {
    DimensionViewHandle dv=crh.getDimension(COLUMN_AXIS_TYPE,i);
    for (int j=0; j < dv.getLevelCount(); j++) {
      ms.add(new LevelImpl(dv.getLevel(j)));
    }
  }
  return Collections.unmodifiableList(ms);
}
Program: 72829
Project: 72829
Buggy source:
public List getRowLevels(){
  List ms=new ArrayList();
  for (int i=0; i < crh.getDimensionCount(ROW_AXIS_TYPE); i++) {
    DimensionViewHandle dv=crh.getDimension(ROW_AXIS_TYPE,i);
    for (int j=0; j < dv.getLevelCount(); j++) {
      ms.add(new LevelImpl(dv.getLevel(j)));
    }
  }
  return Collections.unmodifiableList(ms);
}

Fixed version (ground truth):
public List<ILevel> getRowLevels(){
  List<ILevel> ms=new ArrayList<ILevel>();
  for (int i=0; i < crh.getDimensionCount(ROW_AXIS_TYPE); i++) {
    DimensionViewHandle dv=crh.getDimension(ROW_AXIS_TYPE,i);
    for (int j=0; j < dv.getLevelCount(); j++) {
      ms.add(new LevelImpl(dv.getLevel(j)));
    }
  }
  return Collections.unmodifiableList(ms);
}
Program: 72830
Project: 72830
Buggy source:
public List getFilterConditions(){
  List filters=new ArrayList();
  ISimpleElementFactory factory=SimpleElementFactory.getInstance();
  for (Iterator itr=lv.filtersIterator(); itr.hasNext(); ) {
    FilterConditionElementHandle feh=(FilterConditionElementHandle)itr.next();
    filters.add(factory.getElement(feh));
  }
  if (filters.size() > 0) {
    return filters;
  }
  return Collections.EMPTY_LIST;
}

Fixed version (ground truth):
public List<IFilterConditionElement> getFilterConditions(){
  List<IFilterConditionElement> filters=new ArrayList<IFilterConditionElement>();
  ISimpleElementFactory factory=SimpleElementFactory.getInstance();
  for (Iterator itr=lv.filtersIterator(); itr.hasNext(); ) {
    FilterConditionElementHandle feh=(FilterConditionElementHandle)itr.next();
    filters.add((IFilterConditionElement)factory.getElement(feh));
  }
  if (filters.size() > 0) {
    return filters;
  }
  return Collections.EMPTY_LIST;
}
Program: 72831
Project: 72831
Buggy source:
public List getSortConditions(){
  List sorts=new ArrayList();
  ISimpleElementFactory factory=SimpleElementFactory.getInstance();
  for (Iterator itr=lv.sortsIterator(); itr.hasNext(); ) {
    SortElementHandle seh=(SortElementHandle)itr.next();
    sorts.add(factory.getElement(seh));
  }
  if (sorts.size() > 0) {
    return sorts;
  }
  return Collections.EMPTY_LIST;
}

Fixed version (ground truth):
public List<ISortElement> getSortConditions(){
  List<ISortElement> sorts=new ArrayList<ISortElement>();
  ISimpleElementFactory factory=SimpleElementFactory.getInstance();
  for (Iterator itr=lv.sortsIterator(); itr.hasNext(); ) {
    SortElementHandle seh=(SortElementHandle)itr.next();
    sorts.add((ISortElement)factory.getElement(seh));
  }
  if (sorts.size() > 0) {
    return sorts;
  }
  return Collections.EMPTY_LIST;
}
Program: 72832
Project: 72832
Buggy source:
public void handleCell(CrosstabCellHandle cell,ICellContent content,IReportContext context) throws BirtException {
  if (handler == null || cell == null) {
    return;
  }
  ICrosstabCellInstance cellInst=new CrosstabCellInstanceImpl(content,(ExtendedItemHandle)cell.getModelHandle());
  handler.callFunction(CrosstabScriptHandler.ON_CREATE_CELL,cellInst,context);
}

Fixed version (ground truth):
public void handleCell(CrosstabCellHandle cell,ICellContent content,IReportContext context) throws BirtException {
  if (handler == null || cell == null) {
    return;
  }
  ICrosstabCellInstance cellInst=new CrosstabCellInstanceImpl(content,(ExtendedItemHandle)cell.getModelHandle(),context);
  handler.callFunction(CrosstabScriptHandler.ON_CREATE_CELL,cellInst,context);
}
Program: 72833
Project: 72833
Buggy source:
public void handleCell(CrosstabCellHandle cell,ICellContent content,IReportContext context) throws BirtException {
  if (handler == null || cell == null) {
    return;
  }
  ICrosstabCellInstance cellInst=new CrosstabCellInstanceImpl(content,(ExtendedItemHandle)cell.getModelHandle());
  handler.callFunction(CrosstabScriptHandler.ON_RENDER_CELL,cellInst,context);
}

Fixed version (ground truth):
public void handleCell(CrosstabCellHandle cell,ICellContent content,IReportContext context) throws BirtException {
  if (handler == null || cell == null) {
    return;
  }
  ICrosstabCellInstance cellInst=new CrosstabCellInstanceImpl(content,(ExtendedItemHandle)cell.getModelHandle(),context);
  handler.callFunction(CrosstabScriptHandler.ON_RENDER_CELL,cellInst,context);
}
Program: 72834
Project: 72834
Buggy source:
/** 
 * Checks possible extends references to element in the given Library. If extends reference is unresolve, virtual elements are removed. And local property values of virtual elements are returned.
 * @param library the library instance
 * @return the map containing local values of virtual elements. Each key isthe id of extends child. Each value is another map of which the key is the base id of virtual element and the value is property name/value pair.
 * @throws LibraryException if there is any extends reference.
 */
private Map dealAllElementDecendents(Library library,int actionCode) throws SemanticException {
  Map overriddenValues=new HashMap();
  LevelContentIterator contentIter=new LevelContentIterator(library,library,1);
  while (contentIter.hasNext()) {
    DesignElement tmpElement=(DesignElement)contentIter.next();
    if (!tmpElement.getDefn().canExtend())     continue;
    Map values=dealElementDecendents(library,tmpElement,actionCode);
    if (actionCode == RELOAD_ACTION)     overriddenValues.putAll(values);
  }
  return overriddenValues;
}

Fixed version (ground truth):
/** 
 * Checks possible extends references to element in the given Library. If extends reference is unresolved, virtual elements are removed. And local property values of virtual elements are returned.
 * @param library the library instance
 * @return the map containing local values of virtual elements. Each key isthe id of extends child. Each value is another map of which the key is the base id of virtual element and the value is property name/value pair.
 * @throws LibraryException if there is any extends reference.
 */
private Map dealAllElementDecendents(Library library,int actionCode) throws SemanticException {
  Map overriddenValues=new HashMap();
  LevelContentIterator contentIter=new LevelContentIterator(library,library,1);
  while (contentIter.hasNext()) {
    DesignElement tmpElement=(DesignElement)contentIter.next();
    if (!tmpElement.getDefn().canExtend())     continue;
    Map values=dealElementDecendents(library,tmpElement,actionCode);
    if (actionCode == RELOAD_ACTION)     overriddenValues.putAll(values);
  }
  return overriddenValues;
}
Program: 72836
Project: 72836
Buggy source:
private HyperlinkDef parseHyperLink(IContent content){
  IHyperlinkAction linkaction=content.getHyperlinkAction();
  if (linkaction != null) {
    if (linkaction.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
      String bookmark=linkaction.getBookmark();
      if (ExcelUtil.isValidBookmarkName(bookmark)) {
        return new HyperlinkDef(linkaction.getBookmark(),IHyperlinkAction.ACTION_BOOKMARK,null);
      }
 else {
        return null;
      }
    }
 else     if (linkaction.getType() == IHyperlinkAction.ACTION_HYPERLINK) {
      return new HyperlinkDef(linkaction.getHyperlink(),IHyperlinkAction.ACTION_HYPERLINK,null);
    }
 else     if (linkaction.getType() == IHyperlinkAction.ACTION_DRILLTHROUGH) {
      Action act=new Action(linkaction);
      IHTMLActionHandler actionHandler=null;
      Object ac=service.getOption(IRenderOption.ACTION_HANDLER);
      if (ac != null && ac instanceof IHTMLActionHandler) {
        actionHandler=(IHTMLActionHandler)ac;
        return new HyperlinkDef(actionHandler.getURL(act,service.getReportContext()),IHyperlinkAction.ACTION_DRILLTHROUGH,null);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private HyperlinkDef parseHyperLink(IContent content){
  IHyperlinkAction linkaction=content.getHyperlinkAction();
  if (linkaction != null) {
    String toolTip=linkaction.getTooltip();
    if (linkaction.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
      String bookmark=linkaction.getBookmark();
      if (ExcelUtil.isValidBookmarkName(bookmark)) {
        return new HyperlinkDef(linkaction.getBookmark(),IHyperlinkAction.ACTION_BOOKMARK,null,toolTip);
      }
 else {
        return null;
      }
    }
 else     if (linkaction.getType() == IHyperlinkAction.ACTION_HYPERLINK) {
      return new HyperlinkDef(linkaction.getHyperlink(),IHyperlinkAction.ACTION_HYPERLINK,null,toolTip);
    }
 else     if (linkaction.getType() == IHyperlinkAction.ACTION_DRILLTHROUGH) {
      Action act=new Action(linkaction);
      IHTMLActionHandler actionHandler=null;
      Object ac=service.getOption(IRenderOption.ACTION_HANDLER);
      if (ac != null && ac instanceof IHTMLActionHandler) {
        actionHandler=(IHTMLActionHandler)ac;
        return new HyperlinkDef(actionHandler.getURL(act,service.getReportContext()),IHyperlinkAction.ACTION_DRILLTHROUGH,null,toolTip);
      }
    }
  }
  return null;
}
Program: 72837
Project: 72837
Buggy source:
protected void writeTxtData(Data d){
  startCell(d.span.getCol(),d.span.getColSpan(),d.getRowSpan(),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);
  if (d.url != null && d.url.getToolTip() != null) {
    writeComments(d.url);
  }
  endCell();
}
Program: 72838
Project: 72838
Buggy source:
public HyperlinkDef(String url,int type,String bookmark){
  this.url=url;
  this.type=type;
  this.bookmark=bookmark;
}

Fixed version (ground truth):
public HyperlinkDef(String url,int type,String bookmark,String toolTip){
  this.url=url;
  this.type=type;
  this.bookmark=bookmark;
  this.toolTip=toolTip;
}
Program: 72839
Project: 72839
Buggy source:
HyperlinkInfo(int type,String url,String bookmark){
  this.type=type;
  this.url=url;
  this.mark=bookmark;
}

Fixed version (ground truth):
HyperlinkInfo(int type,String url,String bookmark,String toolTip){
  this.type=type;
  this.url=url;
  this.mark=bookmark;
  this.toolTip=toolTip;
}
Program: 72841
Project: 72841
Buggy source:
/** 
 * saveEditorContentsDE - saves the current editor contents to ROM using DE API
 * @param desHdl
 * @return true if updated else false.
 */
private boolean saveEditorContentsDE(DesignElementHandle desHdl){
  if (desHdl != null && getEditorText() != null) {
    try {
      if (cmbItemLastSelected != null) {
        desHdl.setStringProperty(cmbItemLastSelected.getName(),getEditorText());
      }
      selectionMap.put(getModel(),cmbExprListViewer.getSelection());
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * saveEditorContentsDE - saves the current editor contents to ROM using DE API
 * @param desHdl
 * @return true if updated else false.
 */
private boolean saveEditorContentsDE(DesignElementHandle desHdl){
  if (desHdl != null && getEditorText() != null) {
    try {
      if (cmbItemLastSelected != null) {
        String name=cmbItemLastSelected.getName();
        desHdl.setStringProperty(name,getEditorText());
        setEditorText(desHdl.getStringProperty(name));
      }
      selectionMap.put(getModel(),cmbExprListViewer.getSelection());
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
      return false;
    }
  }
  return true;
}
Program: 72842
Project: 72842
Buggy source:
public IParameterMetaData getParameterMetaData() throws OdaException {
  assertNotNull(callStat);
  if (this.cachedParameterMetaData != null)   return this.cachedParameterMetaData;
  int[] positionArray=paramUtil.getParameterPositions();
  List paramMetaList1=this.getCallableParamMetaData();
  List paramMetaList2=new ArrayList();
  for (int i=0; i < positionArray.length; i++) {
    int index=positionArray[i];
    if (paramMetaList1.size() >= index)     paramMetaList2.add(paramMetaList1.get(index - 1));
  }
  cachedParameterMetaData=new SPParameterMetaData(paramMetaList2);
  return cachedParameterMetaData;
}

Fixed version (ground truth):
public IParameterMetaData getParameterMetaData() throws OdaException {
  assertNotNull(callStat);
  if (this.cachedParameterMetaData != null)   return this.cachedParameterMetaData;
  int[] positionArray=paramUtil.getParameterPositions();
  List paramMetaList1=this.getCallableParamMetaData();
  List paramMetaList2=new ArrayList();
  for (int i=0; i < positionArray.length; i++) {
    int index=positionArray[i];
    if (paramMetaList1.size() >= index)     paramMetaList2.add(paramMetaList1.get(index - 1));
 else     throw new OdaException(ResourceConstants.PREPARESTATEMENT_PARAMETER_METADATA_CANNOT_GET);
  }
  cachedParameterMetaData=new SPParameterMetaData(paramMetaList2);
  return cachedParameterMetaData;
}
Program: 72843
Project: 72843
Buggy source:
public DesignElementHandle getHandle(ModuleHandle handle){
  return copy.getHandle(handle.getModule());
}

Fixed version (ground truth):
public DesignElementHandle getHandle(ModuleHandle handle){
  return getCopy().getHandle(handle.getModule());
}
Program: 72844
Project: 72844
Buggy source:
public void onRow(Object[] args){
  ++count;
}

Fixed version (ground truth):
public void onRow(Object[] args){
  if (!countByColumn || args == null || args.length == 0) {
    if (countByColumn) {
      countByColumn=false;
    }
    ++count;
  }
 else   if (args.length > 0 && args[0] != null) {
    ++count;
  }
}
Program: 72845
Project: 72845
Buggy source:
public IParameterDefn[] getParameterDefn(){
  return new IParameterDefn[]{};
}

Fixed version (ground truth):
public IParameterDefn[] getParameterDefn(){
  return new IParameterDefn[]{new ParameterDefn(Constants.DATA_FIELD_NAME,Constants.DATA_FIELD_DISPLAY_NAME,true,true,SupportedDataTypes.INTEGER_DOUBLE,"String_Node_Str")};
}
Program: 72846
Project: 72846
Buggy source:
public void testTotalCount() throws Exception {
  IAggrFunction ag=buildInAggrFactory.getAggregation("String_Node_Str");
  Accumulator ac=ag.newAccumulator();
  assertEquals(IBuildInAggregation.TOTAL_COUNT_FUNC,ag.getName());
  assertEquals(IAggrFunction.SUMMARY_AGGR,ag.getType());
  assertEquals(0,ag.getParameterDefn().length);
  ac.start();
  for (int i=0; i < doubleArray1.length; i++) {
    ac.onRow(new Object[]{});
  }
  ac.finish();
  assertEquals(new Integer(15),ac.getValue());
  ac.start();
  for (int i=0; i < doubleArray2.length; i++) {
    ac.onRow(new Object[]{});
  }
  ac.finish();
  assertEquals(new Integer(14),ac.getValue());
  ac.start();
  for (int i=0; i < str1.length; i++) {
    ac.onRow(new Object[]{});
  }
  ac.finish();
  assertEquals(new Integer(14),ac.getValue());
  ac.start();
  ac.finish();
  assertEquals(new Integer(0),ac.getValue());
  ac.start();
  try {
    ac.getValue();
    assertTrue(false);
  }
 catch (  RuntimeException e) {
    assertTrue(true);
  }
}

Fixed version (ground truth):
public void testTotalCount() throws Exception {
  IAggrFunction ag=buildInAggrFactory.getAggregation("String_Node_Str");
  Accumulator ac=ag.newAccumulator();
  assertEquals(IBuildInAggregation.TOTAL_COUNT_FUNC,ag.getName());
  assertEquals(IAggrFunction.SUMMARY_AGGR,ag.getType());
  assertEquals(1,ag.getParameterDefn().length);
  ac.start();
  for (int i=0; i < anyObjectArray.length; i++) {
    ac.onRow(new Object[]{anyObjectArray[i]});
  }
  ac.finish();
  assertEquals(new Integer(5),ac.getValue());
  ac.start();
  for (int i=0; i < anyObjectArray.length; i++) {
    ac.onRow(null);
  }
  ac.finish();
  assertEquals(new Integer(8),ac.getValue());
  ac.start();
  for (int i=0; i < doubleArray1.length; i++) {
    ac.onRow(new Object[]{});
  }
  ac.finish();
  assertEquals(new Integer(15),ac.getValue());
  ac.start();
  for (int i=0; i < doubleArray2.length; i++) {
    ac.onRow(new Object[]{});
  }
  ac.finish();
  assertEquals(new Integer(14),ac.getValue());
  ac.start();
  for (int i=0; i < str1.length; i++) {
    ac.onRow(new Object[]{});
  }
  ac.finish();
  assertEquals(new Integer(14),ac.getValue());
  ac.start();
  ac.finish();
  assertEquals(new Integer(0),ac.getValue());
  ac.start();
  try {
    ac.getValue();
    assertTrue(false);
  }
 catch (  RuntimeException e) {
    assertTrue(true);
  }
}
Program: 72849
Project: 72849
Buggy source:
public BasicCachedListExt(String tempDir){
  super(tempDir);
}

Fixed version (ground truth):
public BasicCachedListExt(String tempDir){
  super(tempDir,null);
}
Program: 72850
Project: 72850
Buggy source:
/** 
 * When mode is MODE_GENERATION, the writer stream of archive will be used. When mode is MODE_PRESENTATION, the reader stream of archive will be used. When mode is DIRECT_PRESENTATION, the archive will not be used. When mode is PRESENTATION_AND_GENERATION, both the write stream and the read  steram of archive will be used. 
 * @param mode
 * @param scope
 * @param reader
 * @param writer
 * @return an instance of DataEngineContext
 */
public static DataEngineContext newInstance(int mode,Scriptable scope,IDocArchiveReader reader,IDocArchiveWriter writer) throws BirtException {
  return new DataEngineContext(mode,scope,reader,writer);
}

Fixed version (ground truth):
/** 
 * @param mode
 * @param scope
 * @param reader
 * @param writer
 * @return
 * @throws BirtException
 * @deprecated
 */
public static DataEngineContext newInstance(int mode,Scriptable scope,IDocArchiveReader reader,IDocArchiveWriter writer) throws BirtException {
  return new DataEngineContext(mode,scope,reader,writer,null);
}
Program: 72851
Project: 72851
Buggy source:
/** 
 * @param mode
 * @param scope
 * @param reader
 * @param writer
 * @throws BirtException
 */
private DataEngineContext(int mode,Scriptable scope,IDocArchiveReader reader,IDocArchiveWriter writer) throws BirtException {
  Object[] params={new Integer(mode),scope,reader,writer};
  logger.entering(DataEngineContext.class.getName(),"String_Node_Str",params);
  if (!(mode == MODE_GENERATION || mode == MODE_PRESENTATION || mode == DIRECT_PRESENTATION || mode == MODE_UPDATE))   throw new DataException(ResourceConstants.RD_INVALID_MODE);
  if (writer == null && mode == MODE_GENERATION)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  if (reader == null && mode == MODE_PRESENTATION)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  if (reader == null && mode == MODE_UPDATE)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  this.mode=mode;
  this.scope=scope;
  this.reader=reader;
  this.writer=writer;
  this.cacheOption=CACHE_USE_DEFAULT;
  logger.exiting(DataEngineContext.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param mode
 * @param scope
 * @param reader
 * @param writer
 * @throws BirtException
 */
private DataEngineContext(int mode,Scriptable scope,IDocArchiveReader reader,IDocArchiveWriter writer,ClassLoader classLoader) throws BirtException {
  Object[] params={new Integer(mode),scope,reader,writer,classLoader};
  logger.entering(DataEngineContext.class.getName(),"String_Node_Str",params);
  if (!(mode == MODE_GENERATION || mode == MODE_PRESENTATION || mode == DIRECT_PRESENTATION || mode == MODE_UPDATE))   throw new DataException(ResourceConstants.RD_INVALID_MODE);
  if (writer == null && mode == MODE_GENERATION)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  if (reader == null && mode == MODE_PRESENTATION)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  if (reader == null && mode == MODE_UPDATE)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  this.classLoader=classLoader;
  this.mode=mode;
  this.scope=scope;
  this.reader=reader;
  this.writer=writer;
  this.cacheOption=CACHE_USE_DEFAULT;
  logger.exiting(DataEngineContext.class.getName(),"String_Node_Str");
}
Program: 72852
Project: 72852
Buggy source:
/** 
 * @param initialCapacity
 */
public BasicCachedArray(String tempDir,int initialCapacity){
  if (initialCapacity < 0)   throw new IllegalArgumentException("String_Node_Str" + initialCapacity);
  this.cachedList=new BasicCachedList(tempDir);
  this.initialCapacity=initialCapacity;
}

Fixed version (ground truth):
/** 
 * @param initialCapacity
 */
public BasicCachedArray(String tempDir,int initialCapacity){
  if (initialCapacity < 0)   throw new IllegalArgumentException("String_Node_Str" + initialCapacity);
  this.cachedList=new BasicCachedList(tempDir,DataEngineSession.getCurrentClassLoader());
  this.initialCapacity=initialCapacity;
}
Program: 72853
Project: 72853
Buggy source:
/** 
 * @param list
 */
public BasicCachedList(String tempDir,List list){
  this(tempDir);
  if (list == null)   return;
  for (int i=0; i < list.size(); i++) {
    this.add(list.get(i));
  }
}

Fixed version (ground truth):
/** 
 * @param list
 */
public BasicCachedList(String tempDir,ClassLoader loader,List list){
  this(tempDir,loader);
  if (list == null)   return;
  for (int i=0; i < list.size(); i++) {
    this.add(list.get(i));
  }
}
Program: 72854
Project: 72854
Buggy source:
/** 
 * Read one object from disk.
 * @param oos
 * @param object
 * @throws IOException
 */
protected Object readObject(DataInputStream dis) throws IOException {
  int fieldCount=IOUtil.readInt(dis);
  if (fieldCount == NULL_VALUE) {
    return null;
  }
  return IOUtil.readObject(dis);
}

Fixed version (ground truth):
/** 
 * Read one object from disk.
 * @param oos
 * @param object
 * @throws IOException
 */
protected Object readObject(DataInputStream dis) throws IOException {
  int fieldCount=IOUtil.readInt(dis);
  if (fieldCount == NULL_VALUE) {
    return null;
  }
  return IOUtil.readObject(dis,DataEngineSession.getCurrentClassLoader());
}
Program: 72855
Project: 72855
Buggy source:
/** 
 * @param list
 */
public CachedList(String tempDir,ICachedObjectCreator creator,List list){
  super(tempDir,list);
  this.creator=creator;
}

Fixed version (ground truth):
/** 
 * @param list
 */
public CachedList(String tempDir,ClassLoader loader,ICachedObjectCreator creator,List list){
  super(tempDir,loader,list);
  this.creator=creator;
}
Program: 72856
Project: 72856
Buggy source:
protected Object readObject(DataInputStream dis) throws IOException {
  int fieldCount=IOUtil.readInt(dis);
  if (fieldCount == NULL_VALUE) {
    return null;
  }
  Object[] objects=new Object[fieldCount];
  for (int i=0; i < objects.length; i++) {
    objects[i]=IOUtil.readObject(dis);
  }
  return creator.createInstance(objects);
}

Fixed version (ground truth):
protected Object readObject(DataInputStream dis) throws IOException {
  int fieldCount=IOUtil.readInt(dis);
  if (fieldCount == NULL_VALUE) {
    return null;
  }
  Object[] objects=new Object[fieldCount];
  for (int i=0; i < objects.length; i++) {
    objects[i]=IOUtil.readObject(dis,DataEngineSession.getCurrentClassLoader());
  }
  return creator.createInstance(objects);
}
Program: 72857
Project: 72857
Buggy source:
private void populateAggregations(String tempDir) throws DataException {
  this.currentAggrCount=manager.getAggrCount();
  if (currentAggrCount > 0) {
    currentRoundAggrValue=new List[currentAggrCount];
    aggrArgs=new Object[currentAggrCount][];
    for (int i=0; i < this.currentAggrCount; i++) {
      currentRoundAggrValue[i]=new BasicCachedList(tempDir);
      IAggrInfo aggrInfo=this.manager.getAggrDefn(i);
      aggrArgs[i]=new Object[aggrInfo.getAggregation().getParameterDefn().length];
    }
    accumulatorManagers=new AccumulatorManager[currentAggrCount];
  }
  this.calculate();
}

Fixed version (ground truth):
private void populateAggregations(String tempDir) throws DataException {
  this.currentAggrCount=manager.getAggrCount();
  if (currentAggrCount > 0) {
    currentRoundAggrValue=new List[currentAggrCount];
    aggrArgs=new Object[currentAggrCount][];
    for (int i=0; i < this.currentAggrCount; i++) {
      currentRoundAggrValue[i]=new BasicCachedList(tempDir,DataEngineSession.getCurrentClassLoader());
      IAggrInfo aggrInfo=this.manager.getAggrDefn(i);
      aggrArgs[i]=new Object[aggrInfo.getAggregation().getParameterDefn().length];
    }
    accumulatorManagers=new AccumulatorManager[currentAggrCount];
  }
  this.calculate();
}
Program: 72858
Project: 72858
Buggy source:
/** 
 * @param dis
 * @param rsMeta
 * @param count
 * @return
 * @throws IOException
 */
public static IResultObject readResultObject(DataInputStream dis,IResultClass rsMeta,int count) throws IOException {
  Object[] obs=new Object[count];
  for (int i=0; i < count; i++)   obs[i]=IOUtil.readObject(dis);
  return new ResultObject(rsMeta,obs);
}

Fixed version (ground truth):
/** 
 * @param dis
 * @param rsMeta
 * @param count
 * @return
 * @throws IOException
 */
public static IResultObject readResultObject(DataInputStream dis,IResultClass rsMeta,int count) throws IOException {
  Object[] obs=new Object[count];
  for (int i=0; i < count; i++)   obs[i]=IOUtil.readObject(dis,DataEngineSession.getCurrentClassLoader());
  return new ResultObject(rsMeta,obs);
}