nus-yam/ex-repair huggingface dataset:
Program: 72903
Project: 72903
Buggy source:
public void visitCascadingParameterGroup(CascadingParameterGroupHandle handle){
  CascadingParameterGroupDefn paramGroup=new CascadingParameterGroupDefn();
  paramGroup.setHandle(handle);
  paramGroup.setParameterType(IParameterDefnBase.CASCADING_PARAMETER_GROUP);
  paramGroup.setName(handle.getName());
  paramGroup.setDisplayName(handle.getDisplayName());
  paramGroup.setDisplayNameKey(handle.getDisplayNameKey());
  paramGroup.setHelpText(handle.getHelpText());
  paramGroup.setHelpTextKey(handle.getHelpTextKey());
  paramGroup.setPromptText(handle.getPromptText());
  paramGroup.setPromptTextKey(handle.getPromptTextKey());
  DataSetHandle dset=handle.getDataSet();
  if (dset != null) {
    paramGroup.setDataSet(dset.getName());
  }
  SlotHandle parameters=handle.getParameters();
  List properties=handle.getUserProperties();
  for (int i=0; i < properties.size(); i++) {
    UserPropertyDefn p=(UserPropertyDefn)properties.get(i);
    paramGroup.addUserProperty(p.getName(),handle.getProperty(p.getName()));
  }
  int size=parameters.getCount();
  for (int n=0; n < size; n++) {
    apply(parameters.get(n));
    if (currentElement != null) {
      paramGroup.addParameter((IParameterDefnBase)currentElement);
    }
  }
  currentElement=paramGroup;
}

Fixed version (ground truth):
public void visitCascadingParameterGroup(CascadingParameterGroupHandle handle){
  CascadingParameterGroupDefn paramGroup=new CascadingParameterGroupDefn();
  paramGroup.setLocale(locale);
  paramGroup.setHandle(handle);
  paramGroup.setParameterType(IParameterDefnBase.CASCADING_PARAMETER_GROUP);
  paramGroup.setName(handle.getName());
  paramGroup.setDisplayName(handle.getDisplayName());
  paramGroup.setDisplayNameKey(handle.getDisplayNameKey());
  paramGroup.setHelpText(handle.getHelpText());
  paramGroup.setHelpTextKey(handle.getHelpTextKey());
  paramGroup.setPromptText(handle.getPromptText());
  paramGroup.setPromptTextKey(handle.getPromptTextKey());
  DataSetHandle dset=handle.getDataSet();
  if (dset != null) {
    paramGroup.setDataSet(dset.getName());
  }
  SlotHandle parameters=handle.getParameters();
  List properties=handle.getUserProperties();
  for (int i=0; i < properties.size(); i++) {
    UserPropertyDefn p=(UserPropertyDefn)properties.get(i);
    paramGroup.addUserProperty(p.getName(),handle.getProperty(p.getName()));
  }
  int size=parameters.getCount();
  for (int n=0; n < size; n++) {
    apply(parameters.get(n));
    if (currentElement != null) {
      paramGroup.addParameter((IParameterDefnBase)currentElement);
    }
  }
  currentElement=paramGroup;
}
Program: 72904
Project: 72904
Buggy source:
private static int getAutoColumCount(Bounds boPlot,int iSeries){
  double rat=boPlot.getHeight() / boPlot.getWidth();
  int colums=(int)Math.round(Math.sqrt(iSeries / rat));
  return colums;
}

Fixed version (ground truth):
private static int getAutoColumCount(Bounds boPlot,int iSeries){
  double rat=boPlot.getHeight() / boPlot.getWidth();
  int colums=(int)Math.round(Math.sqrt(iSeries / rat));
  colums=Math.min(colums,iSeries);
  if (colums == 0) {
    colums++;
  }
  return colums;
}
Program: 72905
Project: 72905
Buggy source:
static boolean check(String source,int lineNumber){
  Context cx=Context.enter();
  Debugger oldDebugger=cx.getDebugger();
  Object oldContext=cx.getDebuggerContextData();
  boolean oldGenerate=cx.isGeneratingDebug();
  int oldLevel=cx.getOptimizationLevel();
  try {
    BreakableSourceChecker checker=new BreakableSourceChecker();
    checker.lineNumber=lineNumber + 1;
    cx.setDebugger(checker,null);
    cx.setGeneratingDebug(true);
    cx.setOptimizationLevel(-1);
    cx.compileString(source,"String_Node_Str",1,null);
    return checker.breakable;
  }
  finally {
    cx.setDebugger(oldDebugger,oldContext);
    cx.setGeneratingDebug(oldGenerate);
    cx.setOptimizationLevel(oldLevel);
    Context.exit();
  }
}

Fixed version (ground truth):
static boolean check(String source,int lineNumber){
  Context cx=Context.enter();
  Debugger oldDebugger=cx.getDebugger();
  Object oldContext=cx.getDebuggerContextData();
  boolean oldGenerate=cx.isGeneratingDebug();
  int oldLevel=cx.getOptimizationLevel();
  try {
    BreakableSourceChecker checker=new BreakableSourceChecker();
    checker.lineNumber=lineNumber + 1;
    cx.setDebugger(checker,null);
    cx.setGeneratingDebug(true);
    cx.setOptimizationLevel(-1);
    cx.compileString(source,"String_Node_Str",1,null);
    return checker.breakable;
  }
 catch (  Exception e) {
    return false;
  }
 finally {
    cx.setDebugger(oldDebugger,oldContext);
    cx.setGeneratingDebug(oldGenerate);
    cx.setOptimizationLevel(oldLevel);
    Context.exit();
  }
}
Program: 72906
Project: 72906
Buggy source:
private List getTableInstanceIds() throws EngineException, UnsupportedEncodingException {
  List result=new ArrayList();
  IReportRunnable runnable;
  IReportDocument document=engine.openReportDocument(REPORT_DOCUMENT);
  IRenderTask render=engine.createRenderTask(document);
  ByteArrayOutputStream ostream=new ByteArrayOutputStream();
  HTMLRenderOption option=new HTMLRenderOption();
  option.setOutputFormat("String_Node_Str");
  option.setOutputStream(ostream);
  render.setRenderOption(option);
  render.render();
  render.close();
  String content=ostream.toString("String_Node_Str");
  Pattern iidPattern=Pattern.compile("String_Node_Str");
  Matcher matcher=iidPattern.matcher(content);
  while (matcher.find()) {
    String strIid=matcher.group(1);
    InstanceID iid=InstanceID.parse(strIid);
    long designId=iid.getComponentID();
    runnable=render.getReportRunnable();
    ReportDesignHandle report=(ReportDesignHandle)runnable.getDesignHandle();
    DesignElementHandle element=report.getElementByID(designId);
    if (element instanceof TableHandle) {
      result.add(iid);
    }
  }
  document.close();
  return result;
}

Fixed version (ground truth):
private List getTableInstanceIds() throws EngineException, UnsupportedEncodingException {
  List result=new ArrayList();
  IReportRunnable runnable;
  IReportDocument document=engine.openReportDocument(REPORT_DOCUMENT);
  IRenderTask render=engine.createRenderTask(document);
  ByteArrayOutputStream ostream=new ByteArrayOutputStream();
  HTMLRenderOption option=new HTMLRenderOption();
  option.setOutputFormat("String_Node_Str");
  option.setOutputStream(ostream);
  option.setEnableMetadata(true);
  render.setRenderOption(option);
  render.render();
  render.close();
  String content=ostream.toString("String_Node_Str");
  Pattern iidPattern=Pattern.compile("String_Node_Str");
  Matcher matcher=iidPattern.matcher(content);
  while (matcher.find()) {
    String strIid=matcher.group(1);
    InstanceID iid=InstanceID.parse(strIid);
    long designId=iid.getComponentID();
    runnable=render.getReportRunnable();
    ReportDesignHandle report=(ReportDesignHandle)runnable.getDesignHandle();
    DesignElementHandle element=report.getElementByID(designId);
    if (element instanceof TableHandle) {
      result.add(iid);
    }
  }
  document.close();
  return result;
}
Program: 72909
Project: 72909
Buggy source:
protected ActionDesign readAction(DataInputStream in) throws IOException {
  ActionDesign action=new ActionDesign();
  int actionType=IOUtil.readInt(in);
switch (actionType) {
case ActionDesign.ACTION_BOOKMARK:
    String bookmark=IOUtil.readString(in);
  action.setBookmark(bookmark);
break;
case ActionDesign.ACTION_DRILLTHROUGH:
DrillThroughActionDesign drillThrough=readDrillThrough(in);
action.setDrillThrough(drillThrough);
break;
case ActionDesign.ACTION_HYPERLINK:
String hyperlink=IOUtil.readString(in);
action.setHyperlink(hyperlink);
break;
default :
throw new IOException("String_Node_Str" + actionType);
}
if (version == ENGINE_IR_VERSION_0) {
IOUtil.readBool(in);
}
String targetWindow=IOUtil.readString(in);
action.setTargetWindow(targetWindow);
String tooltip=IOUtil.readString(in);
action.setTooltip(tooltip);
return action;
}

Fixed version (ground truth):
protected ActionDesign readAction(DataInputStream in) throws IOException {
  ActionDesign action=new ActionDesign();
  int actionType=IOUtil.readInt(in);
switch (actionType) {
case ActionDesign.ACTION_BOOKMARK:
    String bookmark=IOUtil.readString(in);
  action.setBookmark(bookmark);
break;
case ActionDesign.ACTION_DRILLTHROUGH:
DrillThroughActionDesign drillThrough=readDrillThrough(in);
action.setDrillThrough(drillThrough);
break;
case ActionDesign.ACTION_HYPERLINK:
String hyperlink=IOUtil.readString(in);
action.setHyperlink(hyperlink);
break;
default :
throw new IOException("String_Node_Str" + actionType);
}
if (version == ENGINE_IR_VERSION_0) {
IOUtil.readBool(in);
}
String targetWindow=IOUtil.readString(in);
action.setTargetWindow(targetWindow);
return action;
}
Program: 72912
Project: 72912
Buggy source:
private void printCube(CubeCursor cursor,List columnEdgeBindingNames,List rowEdgeBindingNames,String measureBindingNames,String columnAggr,String rowAggr,String overallAggr) throws Exception {
  this.printCube(cursor,columnEdgeBindingNames,rowEdgeBindingNames,measureBindingNames,columnAggr,rowAggr,overallAggr,true);
}

Fixed version (ground truth):
private void printCube(CubeCursor cursor,List columnEdgeBindingNames,List rowEdgeBindingNames,String measureBindingName,String[] columnAggrs) throws Exception {
  String output=getOutputFromCursor(cursor,columnEdgeBindingNames,rowEdgeBindingNames,measureBindingName,columnAggrs);
  this.testPrint(output);
}
Program: 72913
Project: 72913
Buggy source:
protected boolean checkMeasureVerticalSpanOverlapped(ColumnEvent ev){
  if (ev.measureIndex == -1) {
    return false;
  }
  LevelHandle spanLevel=null;
switch (ev.type) {
case ColumnEvent.MEASURE_CHANGE:
case ColumnEvent.COLUMN_EDGE_CHANGE:
    spanLevel=getMeasureCell(ev.measureIndex).getSpanOverOnRow();
  break;
case ColumnEvent.COLUMN_TOTAL_CHANGE:
case ColumnEvent.GRAND_TOTAL_CHANGE:
int dimCount=crosstabItem.getDimensionCount(ROW_AXIS_TYPE);
DimensionViewHandle rdv=crosstabItem.getDimension(ROW_AXIS_TYPE,dimCount - 1);
spanLevel=getAggregationCell(dimCount - 1,rdv.getLevelCount() - 1,ev.dimensionIndex,ev.levelIndex,ev.measureIndex).getSpanOverOnRow();
break;
}
if (spanLevel != null) {
int targetSpanGroupIndex=GroupUtil.getGroupIndex(rowGroups,spanLevel);
if (targetSpanGroupIndex != -1) {
try {
EdgeCursor rowEdgeCursor=getRowEdgeCursor();
if (rowEdgeCursor != null) {
targetSpanGroupIndex--;
if (targetSpanGroupIndex == -1) {
return !rowEdgeCursor.isFirst();
}
 else {
DimensionCursor dc=(DimensionCursor)rowEdgeCursor.getDimensionCursor().get(targetSpanGroupIndex);
if (!GroupUtil.isDummyGroup(dc)) {
  return rowEdgeCursor.getPosition() > dc.getEdgeStart();
}
}
}
}
 catch (OLAPException e) {
logger.log(Level.SEVERE,Messages.getString("String_Node_Str"),e);
}
}
}
return false;
}

Fixed version (ground truth):
protected boolean checkMeasureVerticalSpanOverlapped(ColumnEvent ev){
  if (ev.measureIndex == -1 && totalMeasureCount != 1) {
    return false;
  }
  int mx=ev.measureIndex;
  if (mx == -1) {
    mx=0;
  }
  LevelHandle spanLevel=null;
switch (ev.type) {
case ColumnEvent.MEASURE_CHANGE:
case ColumnEvent.COLUMN_EDGE_CHANGE:
    spanLevel=getMeasureCell(mx).getSpanOverOnRow();
  break;
case ColumnEvent.COLUMN_TOTAL_CHANGE:
case ColumnEvent.GRAND_TOTAL_CHANGE:
int dimCount=crosstabItem.getDimensionCount(ROW_AXIS_TYPE);
DimensionViewHandle rdv=crosstabItem.getDimension(ROW_AXIS_TYPE,dimCount - 1);
spanLevel=getAggregationCell(dimCount - 1,rdv.getLevelCount() - 1,ev.dimensionIndex,ev.levelIndex,mx).getSpanOverOnRow();
break;
}
if (spanLevel != null) {
int targetSpanGroupIndex=GroupUtil.getGroupIndex(rowGroups,spanLevel);
if (targetSpanGroupIndex != -1) {
try {
EdgeCursor rowEdgeCursor=getRowEdgeCursor();
if (rowEdgeCursor != null) {
targetSpanGroupIndex--;
if (targetSpanGroupIndex == -1) {
return !rowEdgeCursor.isFirst();
}
 else {
DimensionCursor dc=(DimensionCursor)rowEdgeCursor.getDimensionCursor().get(targetSpanGroupIndex);
if (!GroupUtil.isDummyGroup(dc)) {
  return rowEdgeCursor.getPosition() > dc.getEdgeStart();
}
}
}
}
 catch (OLAPException e) {
logger.log(Level.SEVERE,Messages.getString("String_Node_Str"),e);
}
}
}
return false;
}
Program: 72915
Project: 72915
Buggy source:
protected boolean checkMeasureVerticalSpanOverlapped(ColumnEvent ev){
  if (ev.measureIndex == -1) {
    return false;
  }
  LevelHandle spanLevel=null;
switch (ev.type) {
case ColumnEvent.MEASURE_CHANGE:
case ColumnEvent.COLUMN_EDGE_CHANGE:
    spanLevel=getMeasureCell(ev.measureIndex).getSpanOverOnRow();
  break;
case ColumnEvent.COLUMN_TOTAL_CHANGE:
case ColumnEvent.GRAND_TOTAL_CHANGE:
int dimCount=crosstabItem.getDimensionCount(ROW_AXIS_TYPE);
DimensionViewHandle rdv=crosstabItem.getDimension(ROW_AXIS_TYPE,dimCount - 1);
spanLevel=getAggregationCell(dimCount - 1,rdv.getLevelCount() - 1,ev.dimensionIndex,ev.levelIndex,ev.measureIndex).getSpanOverOnRow();
break;
}
if (spanLevel != null) {
int targetRowSpanGroupIndex=GroupUtil.getGroupIndex(rowGroups,spanLevel);
int currentGroupIndex=GroupUtil.getGroupIndex(rowGroups,dimensionIndex,levelIndex);
if (targetRowSpanGroupIndex != -1) {
return targetRowSpanGroupIndex <= currentGroupIndex;
}
}
return false;
}

Fixed version (ground truth):
protected boolean checkMeasureVerticalSpanOverlapped(ColumnEvent ev){
  if (ev.measureIndex == -1 && totalMeasureCount != 1) {
    return false;
  }
  int mx=ev.measureIndex;
  if (mx == -1) {
    mx=0;
  }
  LevelHandle spanLevel=null;
switch (ev.type) {
case ColumnEvent.MEASURE_CHANGE:
case ColumnEvent.COLUMN_EDGE_CHANGE:
    spanLevel=getMeasureCell(mx).getSpanOverOnRow();
  break;
case ColumnEvent.COLUMN_TOTAL_CHANGE:
case ColumnEvent.GRAND_TOTAL_CHANGE:
int dimCount=crosstabItem.getDimensionCount(ROW_AXIS_TYPE);
DimensionViewHandle rdv=crosstabItem.getDimension(ROW_AXIS_TYPE,dimCount - 1);
spanLevel=getAggregationCell(dimCount - 1,rdv.getLevelCount() - 1,ev.dimensionIndex,ev.levelIndex,mx).getSpanOverOnRow();
break;
}
if (spanLevel != null) {
int targetRowSpanGroupIndex=GroupUtil.getGroupIndex(rowGroups,spanLevel);
int currentGroupIndex=GroupUtil.getGroupIndex(rowGroups,dimensionIndex,levelIndex);
if (targetRowSpanGroupIndex != -1) {
return targetRowSpanGroupIndex <= currentGroupIndex;
}
}
return false;
}
Program: 72917
Project: 72917
Buggy source:
/** 
 * @see org.eclipse.birt.report.service.api.IViewerReportService#runReport(org.eclipse.birt.report.service.api.IViewerReportDesignHandle,java.lang.String,org.eclipse.birt.report.service.api.InputOptions,java.util.Map,java.util.Map)
 */
public String runReport(IViewerReportDesignHandle design,String outputDocName,InputOptions runOptions,Map parameters,Map displayTexts) throws ReportServiceException {
  if (design == null || design.getDesignObject() == null)   throw new ReportServiceException(BirtResources.getMessage(ResourceConstants.GENERAL_EXCEPTION_NO_REPORT_DESIGN));
  IReportRunnable runnable;
  HttpServletRequest request=(HttpServletRequest)runOptions.getOption(InputOptions.OPT_REQUEST);
  Locale locale=(Locale)runOptions.getOption(InputOptions.OPT_LOCALE);
  ViewerAttributeBean attrBean=(ViewerAttributeBean)request.getAttribute(IBirtConstants.ATTRIBUTE_BEAN);
  Map parsedParams=attrBean.getParameters();
  if (parameters != null) {
    parsedParams.putAll(parameters);
  }
  Map displayTextMap=attrBean.getDisplayTexts();
  if (displayTexts != null) {
    displayTextMap.putAll(displayTexts);
  }
  runnable=(IReportRunnable)design.getDesignObject();
  try {
    ReportEngineService.getInstance().runReport(request,runnable,outputDocName,locale,parsedParams,displayTextMap);
  }
 catch (  RemoteException e) {
    throw new ReportServiceException(e.getLocalizedMessage(),e.getCause());
  }
  return outputDocName;
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.birt.report.service.api.IViewerReportService#runReport(org.eclipse.birt.report.service.api.IViewerReportDesignHandle,java.lang.String,org.eclipse.birt.report.service.api.InputOptions,java.util.Map,java.util.Map)
 */
public String runReport(IViewerReportDesignHandle design,String outputDocName,InputOptions runOptions,Map parameters,Map displayTexts) throws ReportServiceException {
  if (design == null || design.getDesignObject() == null)   throw new ReportServiceException(BirtResources.getMessage(ResourceConstants.GENERAL_EXCEPTION_NO_REPORT_DESIGN));
  IReportRunnable runnable;
  HttpServletRequest request=(HttpServletRequest)runOptions.getOption(InputOptions.OPT_REQUEST);
  Locale locale=(Locale)runOptions.getOption(InputOptions.OPT_LOCALE);
  ViewerAttributeBean attrBean=(ViewerAttributeBean)request.getAttribute(IBirtConstants.ATTRIBUTE_BEAN);
  Map parsedParams=attrBean.getParameters();
  if (parameters != null) {
    parsedParams.putAll(parameters);
  }
  Map displayTextMap=attrBean.getDisplayTexts();
  if (displayTexts != null) {
    displayTextMap.putAll(displayTexts);
  }
  runnable=(IReportRunnable)design.getDesignObject();
  try {
    Integer maxRows=null;
    if (ParameterAccessor.isReportParameterExist(request,ParameterAccessor.PARAM_MAXROWS))     maxRows=new Integer(ParameterAccessor.getMaxRows(request));
    ReportEngineService.getInstance().runReport(request,runnable,outputDocName,locale,parsedParams,displayTextMap,maxRows);
  }
 catch (  RemoteException e) {
    throw new ReportServiceException(e.getLocalizedMessage(),e.getCause());
  }
  return outputDocName;
}
Program: 72919
Project: 72919
Buggy source:
/** 
 * Run report.
 * @param request
 * @param runnable
 * @param archive
 * @param documentName
 * @param locale
 * @param parameters
 * @param displayTexts
 * @throws RemoteException
 */
public void runReport(HttpServletRequest request,IReportRunnable runnable,String documentName,Locale locale,Map parameters,Map displayTexts) throws RemoteException {
}

Fixed version (ground truth):
/** 
 * Run report.
 * @param request
 * @param runnable
 * @param archive
 * @param documentName
 * @param locale
 * @param parameters
 * @param displayTexts
 * @param maxRows
 * @throws RemoteException
 */
public void runReport(HttpServletRequest request,IReportRunnable runnable,String documentName,Locale locale,Map parameters,Map displayTexts,Integer maxRows) throws RemoteException {
}
Program: 72920
Project: 72920
Buggy source:
/** 
 * Run and render a report,
 * @param request
 * @param runnable
 * @param outputStream
 * @param locale
 * @param rtl
 * @param parameters
 * @param masterPage
 * @param svgFlag
 * @param activeIds
 * @param renderOption
 * @param displayTexts
 * @param iServletPath
 * @param reportTitle
 * @throws RemoteException
 * @throws IOException
 */
public void runAndRenderReport(HttpServletRequest request,IReportRunnable runnable,OutputStream outputStream,String format,Locale locale,boolean rtl,Map parameters,boolean masterPage,boolean svgFlag,Boolean embeddable,List activeIds,RenderOption renderOption,Map displayTexts,String iServletPath,String reportTitle) throws RemoteException {
}

Fixed version (ground truth):
/** 
 * Run and render a report,
 * @param request
 * @param runnable
 * @param outputStream
 * @param locale
 * @param rtl
 * @param parameters
 * @param masterPage
 * @param svgFlag
 * @param activeIds
 * @param renderOption
 * @param displayTexts
 * @param iServletPath
 * @param reportTitle
 * @param maxRows
 * @throws RemoteException
 * @throws IOException
 */
public void runAndRenderReport(HttpServletRequest request,IReportRunnable runnable,OutputStream outputStream,String format,Locale locale,boolean rtl,Map parameters,boolean masterPage,boolean svgFlag,Boolean embeddable,List activeIds,RenderOption renderOption,Map displayTexts,String iServletPath,String reportTitle,Integer maxRows) throws RemoteException {
}
Program: 72922
Project: 72922
Buggy source:
/** 
 * handle generate report content
 * @param out
 * @throws Exception
 */
protected void __handleOutputReport(OutputStream out) throws Exception {
  ReportEngineService.getInstance().setMaxRows(viewer.getMaxRowsOfRecords());
  if (viewer.isDocumentInUrl()) {
    __renderDocument(out);
  }
 else {
    __renderReport(out);
  }
}

Fixed version (ground truth):
/** 
 * handle generate report content
 * @param out
 * @throws Exception
 */
protected void __handleOutputReport(OutputStream out) throws Exception {
  if (viewer.isDocumentInUrl()) {
    __renderDocument(out);
  }
 else {
    __renderReport(out);
  }
}
Program: 72924
Project: 72924
Buggy source:
/** 
 * Get preview max rows.
 * @param request http request
 * @return max rows
 */
public static int getMaxRows(HttpServletRequest request){
  int curMaxRows=ParameterAccessor.getParameterAsInt(request,PARAM_MAXROWS);
  if (curMaxRows <= 0)   curMaxRows=maxRows;
  return curMaxRows;
}

Fixed version (ground truth):
/** 
 * Get preview max rows.
 * @param request http request
 * @return max rows
 */
public static int getMaxRows(HttpServletRequest request){
  return ParameterAccessor.getParameterAsInt(request,PARAM_MAXROWS);
}
Program: 72926
Project: 72926
Buggy source:
protected void createRoot(){
  if (!isFirst) {
    int startColumn=cellContent.getColumn();
    int endColumn=startColumn + cellContent.getColSpan();
    columnWidth=tableLM.getCellWidth(startColumn,endColumn);
  }
  if (root == null) {
    CellArea cell=AreaFactory.createCellArea(cellContent);
    cell.setRowSpan(tableLM.getRowSpan(cellContent));
    root=cell;
    if (!isFirst) {
      IStyle areaStyle=root.getStyle();
      areaStyle.setProperty(IStyle.STYLE_PADDING_TOP,IStyle.NUMBER_0);
      areaStyle.setProperty(IStyle.STYLE_MARGIN_TOP,IStyle.NUMBER_0);
    }
  }
  tableLM.resolveBorderConflict((CellArea)root,isFirst);
  root.setWidth(columnWidth);
}

Fixed version (ground truth):
protected void createRoot(){
  if (root == null) {
    CellArea cell=AreaFactory.createCellArea(cellContent);
    cell.setRowSpan(tableLM.getRowSpan(cellContent));
    root=cell;
    if (!isFirst) {
      IStyle areaStyle=root.getStyle();
      areaStyle.setProperty(IStyle.STYLE_PADDING_TOP,IStyle.NUMBER_0);
      areaStyle.setProperty(IStyle.STYLE_MARGIN_TOP,IStyle.NUMBER_0);
    }
  }
  tableLM.resolveBorderConflict((CellArea)root,isFirst);
  int startColumn=cellContent.getColumn();
  int endColumn=startColumn + cellContent.getColSpan();
  columnWidth=tableLM.getCellWidth(startColumn,endColumn);
  root.setWidth(columnWidth);
}
Program: 72927
Project: 72927
Buggy source:
public PDFCellLM(PDFLayoutEngineContext context,PDFStackingLM parent,IContent content,IReportItemExecutor executor){
  super(context,parent,content,executor);
  assert(parent != null);
  tableLM=getTableLayoutManager();
  cellContent=(ICellContent)content;
  int startColumn=cellContent.getColumn();
  int endColumn=startColumn + cellContent.getColSpan();
  columnWidth=tableLM.getCellWidth(startColumn,endColumn);
}

Fixed version (ground truth):
public PDFCellLM(PDFLayoutEngineContext context,PDFStackingLM parent,IContent content,IReportItemExecutor executor){
  super(context,parent,content,executor);
  assert(parent != null);
  tableLM=getTableLayoutManager();
  cellContent=(ICellContent)content;
}
Program: 72928
Project: 72928
Buggy source:
protected boolean isHidden(){
  if (columnWidth == 0 || !tableLM.isCellVisible(cellContent)) {
    return true;
  }
  return isHiddenByVisibility();
}

Fixed version (ground truth):
protected boolean isHidden(){
  if (!tableLM.isCellVisible(cellContent)) {
    return true;
  }
  return isHiddenByVisibility();
}
Program: 72930
Project: 72930
Buggy source:
public Object getAdater(Object adaptableObject){
  if (this.adapter != null && this.isSingleton)   return this.adapter;
  if (this.adapterInstance != null)   return this.adapter=this.adapterInstance;
  if (this.factory != null)   this.adapter=this.factory.getAdapter(adaptableObject,this.adapterType);
  if (this.adapter == null && this.includeWorkbenchContribute)   this.adapter=Platform.getAdapterManager().getAdapter(adaptableObject,this.adapterType);
  return adapter;
}

Fixed version (ground truth):
public Object getAdater(Object adaptableObject){
  if (this.adapter != null && this.isSingleton) {
    return this.adapter;
  }
  if (this.adapterInstance != null) {
    return this.adapter=this.adapterInstance;
  }
  if (this.factory != null) {
    this.adapter=this.factory.getAdapter(adaptableObject,this.adapterType);
  }
  if (this.adapter == null && this.includeWorkbenchContribute) {
    this.adapter=Platform.getAdapterManager().getAdapter(adaptableObject,this.adapterType);
  }
  return adapter;
}
Program: 72931
Project: 72931
Buggy source:
public Object evaluate(String script) throws BirtException {
  if (null != script && script.length() > 0) {
    ScriptExpression scriptExpression=new ScriptExpression(script);
    return context.evaluate(scriptExpression);
  }
  return null;
}

Fixed version (ground truth):
public Object evaluate(String script) throws BirtException {
  if (null != script && script.length() > 0) {
    return context.evaluate(script);
  }
  return null;
}
Program: 72932
Project: 72932
Buggy source:
/** 
 * Cancel the process
 * @param browser
 */
public static void cancel(Browser browser){
  if (browser == null)   return;
  try {
    browser.execute("String_Node_Str");
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
/** 
 * Cancel the process
 * @param browser
 */
public static void cancel(Browser browser){
  if (browser == null)   return;
  try {
    browser.execute("String_Node_Str");
  }
 catch (  Exception e) {
    LogUtil.logError(e.getLocalizedMessage(),e);
  }
}
Program: 72933
Project: 72933
Buggy source:
/** 
 * Stop web application
 */
private static void stopWebApp(){
  try {
    WebappAccessor.stop(ViewerPlugin.WEBAPP_CONTEXT);
  }
 catch (  CoreException e) {
  }
}

Fixed version (ground truth):
/** 
 * Stop web application
 */
private static void stopWebApp(){
  try {
    WebappAccessor.stop(ViewerPlugin.WEBAPP_CONTEXT);
  }
 catch (  CoreException e) {
    LogUtil.logError(e.getLocalizedMessage(),e);
  }
}
Program: 72934
Project: 72934
Buggy source:
/** 
 * Start web application.
 */
private synchronized static void startWebApp(){
  try {
    String debugMode=System.getProperty(REPORT_DEBUT_MODE);
    if (debugMode == null) {
      String classpaths=ViewerClassPathHelper.getWorkspaceClassPath();
      URL[] urls=ViewerClassPathHelper.parseURLs(classpaths);
      if (reloadableClassLoader == null) {
        reloadableClassLoader=new ReloadableClassLoader(urls,WebViewer.class.getClassLoader());
      }
 else {
        reloadableClassLoader.setUrls(urls);
        reloadableClassLoader.reload();
      }
    }
    WebappAccessor.start(ViewerPlugin.WEBAPP_CONTEXT);
  }
 catch (  CoreException e) {
  }
}

Fixed version (ground truth):
/** 
 * Start web application.
 */
private synchronized static void startWebApp(){
  try {
    String debugMode=System.getProperty(REPORT_DEBUT_MODE);
    if (debugMode == null) {
      String classpaths=ViewerClassPathHelper.getWorkspaceClassPath();
      URL[] urls=ViewerClassPathHelper.parseURLs(classpaths);
      if (reloadableClassLoader == null) {
        reloadableClassLoader=new ReloadableClassLoader(urls,WebViewer.class.getClassLoader());
      }
 else {
        reloadableClassLoader.setUrls(urls);
        reloadableClassLoader.reload();
      }
    }
    WebappAccessor.start(ViewerPlugin.WEBAPP_CONTEXT);
  }
 catch (  CoreException e) {
    LogUtil.logError(e.getLocalizedMessage(),e);
  }
}
Program: 72935
Project: 72935
Buggy source:
/** 
 * Displays the specified url using eclipse SWT browser.
 * @param report report report
 * @param params the parameter map to set
 */
public static void display(String report,Map params){
  try {
    startWebApp();
    BrowserAccessor.getPreviewBrowser(false).displayURL(createURL(report,params) + "String_Node_Str" + new Random().nextInt());
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
/** 
 * Displays the specified url using eclipse SWT browser.
 * @param report report report
 * @param params the parameter map to set
 */
public static void display(String report,Map params){
  startWebApp();
  try {
    BrowserAccessor.getPreviewBrowser(false).displayURL(createURL(report,params) + "String_Node_Str" + new Random().nextInt());
  }
 catch (  Exception e) {
    LogUtil.logError(e.getLocalizedMessage(),e);
  }
}
Program: 72937
Project: 72937
Buggy source:
/** 
 * @param report the entry point to the report design
 * @param context the execution context
 */
public ReportQueryBuilder(Report report,ExecutionContext context,DataRequestSession dteSession){
  expressionUtil=new ExpressionUtil();
  queryBuilder=new QueryBuilderVisitor();
  this.dteSession=dteSession;
  this.report=report;
  this.context=context;
  if (null != this.context) {
    IReportEngine engine=this.context.getEngine();
    if (null != engine) {
      EngineConfig engineConfig=engine.getConfig();
      if (null != engineConfig) {
        maxRows=engineConfig.getMaxRowsPerQuery();
      }
    }
  }
  queryContext=new QueryContext(context,this);
}

Fixed version (ground truth):
/** 
 * @param report the entry point to the report design
 * @param context the execution context
 */
public ReportQueryBuilder(Report report,ExecutionContext context,DataRequestSession dteSession){
  expressionUtil=new ExpressionUtil();
  queryBuilder=new QueryBuilderVisitor();
  this.dteSession=dteSession;
  this.report=report;
  this.context=context;
  if (null != this.context) {
    maxRows=this.context.getMaxRowsPerQuery();
    if (maxRows == -1) {
      IReportEngine engine=this.context.getEngine();
      if (null != engine) {
        EngineConfig engineConfig=engine.getConfig();
        if (null != engineConfig) {
          maxRows=engineConfig.getMaxRowsPerQuery();
        }
      }
    }
  }
  queryContext=new QueryContext(context,this);
}
Program: 72939
Project: 72939
Buggy source:
public final IFigure createFigure(ExtendedItemHandle eih){
  try {
    eih.loadExtendedElement();
  }
 catch (  ExtendedElementException eeex) {
    logger.log(eeex);
  }
  try {
    final IReportItem iri=eih.getReportItem();
    final DesignerRepresentation dr=new DesignerRepresentation((ChartReportItemImpl)iri);
    ((ChartReportItemImpl)iri).setDesignerRepresentation(dr);
    return dr;
  }
 catch (  ExtendedElementException e) {
    return null;
  }
}

Fixed version (ground truth):
public final IFigure createFigure(final ExtendedItemHandle eih){
  try {
    eih.loadExtendedElement();
  }
 catch (  ExtendedElementException eeex) {
    logger.log(eeex);
  }
  try {
    final ChartReportItemImpl iri=(ChartReportItemImpl)eih.getReportItem();
    final DesignerRepresentation dr=new DesignerRepresentation(iri);
    iri.setDesignerRepresentation(dr);
    if (iri.isCopied() && ChartXTabUtil.isPlotChart(eih)) {
      ChartWithAxes cwa=(ChartWithAxes)iri.getProperty(ChartReportItemConstants.PROPERTY_CHART);
      Axis yAxis=(Axis)((Axis)cwa.getAxes().get(0)).getAssociatedAxes().get(0);
      if (yAxis.getLineAttributes().isVisible() && ChartXTabUtil.findReferenceChart(eih) == null) {
        AggregationCellHandle containerCell=ChartXTabUtil.getXtabContainerCell(eih);
        AggregationCellHandle grandTotalCell=ChartXTabUIUtil.getGrandTotalAggregationCell(containerCell,cwa.isTransposed());
        Object content=ChartXTabUtil.getFirstContent(grandTotalCell);
        if (ChartXTabUtil.isAxisChart((DesignElementHandle)content)) {
          final ExtendedItemHandle axisChart=(ExtendedItemHandle)content;
          if (!axisChart.getElementProperty(ChartReportItemConstants.PROPERTY_HOST_CHART).equals(eih))           Display.getCurrent().asyncExec(new Runnable(){
            public void run(){
              try {
                axisChart.setProperty(ChartReportItemConstants.PROPERTY_HOST_CHART,eih);
              }
 catch (              SemanticException e) {
                logger.log(e);
              }
            }
          }
);
        }
      }
    }
 else     if (ChartXTabUtil.isAxisChart(eih)) {
      eih.getContainer().addListener(ChartXTabUtil.createDeleteChartListener(eih.getElementProperty(ChartReportItemConstants.PROPERTY_HOST_CHART),eih));
    }
    return dr;
  }
 catch (  BirtException e) {
    logger.log(e);
    return null;
  }
}
Program: 72941
Project: 72941
Buggy source:
/** 
 * Updates Axis chart in Xtab by replacing date item with axis chart.
 * @param cell
 * @param cwa
 * @param hostChartHandle
 * @throws BirtException
 */
public static void updateAxisChart(AggregationCellHandle cell,ChartWithAxes cwa,ExtendedItemHandle hostChartHandle) throws BirtException {
  boolean bTransposed=cwa.isTransposed();
  if (getGrandTotalCell(cell,bTransposed) != null) {
    AggregationCellHandle grandTotalAggCell=getGrandTotalAggregationCell(cell,bTransposed);
    Object content=ChartXTabUtil.getFirstContent(grandTotalAggCell);
    if (content instanceof DataItemHandle) {
      if (isYAxisVisible(cwa)) {
        ExtendedItemHandle axisChartHandle=createChartHandle(cell.getModelHandle(),ChartReportItemConstants.TYPE_AXIS_CHART,hostChartHandle);
        grandTotalAggCell.addContent(axisChartHandle,0);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates Axis chart in Xtab by replacing date item with axis chart.
 * @param cell
 * @param cwa
 * @param hostChartHandle
 * @throws BirtException
 */
public static void updateAxisChart(AggregationCellHandle cell,ChartWithAxes cwa,ExtendedItemHandle hostChartHandle) throws BirtException {
  boolean bTransposed=cwa.isTransposed();
  if (getGrandTotalCell(cell,bTransposed) != null) {
    AggregationCellHandle grandTotalAggCell=getGrandTotalAggregationCell(cell,bTransposed);
    Object content=ChartXTabUtil.getFirstContent(grandTotalAggCell);
    if (content instanceof DataItemHandle) {
      if (isYAxisVisible(cwa)) {
        ExtendedItemHandle axisChartHandle=createChartHandle(cell.getModelHandle(),ChartReportItemConstants.TYPE_AXIS_CHART,hostChartHandle);
        grandTotalAggCell.addContent(axisChartHandle,0);
      }
    }
 else     if (ChartXTabUtil.isAxisChart((DesignElementHandle)content)) {
      if (((ExtendedItemHandle)content).getElementProperty(PROPERTY_HOST_CHART) != hostChartHandle) {
        ((ExtendedItemHandle)content).setProperty(PROPERTY_HOST_CHART,hostChartHandle);
      }
    }
  }
}
Program: 72942
Project: 72942
Buggy source:
private static AggregationCellHandle getGrandTotalAggregationCell(AggregationCellHandle cell,boolean bTransposed){
  if (cell == null) {
    return null;
  }
  if (bTransposed) {
    return ((MeasureViewHandle)cell.getContainer()).getAggregationCell(null,null,cell.getDimensionName(ICrosstabConstants.COLUMN_AXIS_TYPE),cell.getLevelName(ICrosstabConstants.COLUMN_AXIS_TYPE));
  }
 else {
    return ((MeasureViewHandle)cell.getContainer()).getAggregationCell(cell.getDimensionName(ICrosstabConstants.ROW_AXIS_TYPE),cell.getLevelName(ICrosstabConstants.ROW_AXIS_TYPE),null,null);
  }
}

Fixed version (ground truth):
public static AggregationCellHandle getGrandTotalAggregationCell(AggregationCellHandle cell,boolean bTransposed){
  if (cell == null) {
    return null;
  }
  if (bTransposed) {
    return ((MeasureViewHandle)cell.getContainer()).getAggregationCell(null,null,cell.getDimensionName(ICrosstabConstants.COLUMN_AXIS_TYPE),cell.getLevelName(ICrosstabConstants.COLUMN_AXIS_TYPE));
  }
 else {
    return ((MeasureViewHandle)cell.getContainer()).getAggregationCell(cell.getDimensionName(ICrosstabConstants.ROW_AXIS_TYPE),cell.getLevelName(ICrosstabConstants.ROW_AXIS_TYPE),null,null);
  }
}
Program: 72944
Project: 72944
Buggy source:
public DataExtractionTaskV0(ReportEngine engine,IReportDocument reader) throws EngineException {
  super(engine,IEngineTask.TASK_DATAEXTRACTION);
  IReportRunnable runnable=getOnPreparedRunnable(reader);
  setReportRunnable(runnable);
  setReportIR(reader);
  this.report=executionContext.getReport();
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
}

Fixed version (ground truth):
public DataExtractionTaskV0(ReportEngine engine,IReportDocument reader) throws EngineException {
  super(engine,IEngineTask.TASK_DATAEXTRACTION);
  IReportRunnable runnable=getOnPreparedRunnable(reader);
  setReportRunnable(runnable);
  IInternalReportDocument internalDoc=(IInternalReportDocument)reader;
  Report reportIR=internalDoc.getReportIR(executionContext.getDesign());
  executionContext.setReport(reportIR);
  this.report=executionContext.getReport();
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
}
Program: 72945
Project: 72945
Buggy source:
public DataExtractionTaskV1(ReportEngine engine,IReportDocument reader) throws EngineException {
  super(engine,IEngineTask.TASK_DATAEXTRACTION);
  IReportRunnable runnable=getOnPreparedRunnable(reader);
  setReportRunnable(runnable);
  setReportIR(reader);
  this.report=executionContext.getReport();
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  setParameterValues(reportDocReader.getParameterValues());
  setParameterDisplayTexts(reportDocReader.getParameterDisplayTexts());
  usingParameterValues();
  executionContext.registerGlobalBeans(reportDocReader.getGlobalVariables(null));
  Map appContext=executionContext.getAppContext();
  IDataEngine dataEngine=executionContext.getDataEngine();
  dataEngine.prepare(report,appContext);
}

Fixed version (ground truth):
public DataExtractionTaskV1(ReportEngine engine,IReportDocument reader) throws EngineException {
  super(engine,IEngineTask.TASK_DATAEXTRACTION);
  IReportRunnable runnable=getOnPreparedRunnable(reader);
  setReportRunnable(runnable);
  IInternalReportDocument internalDoc=(IInternalReportDocument)reader;
  Report reportIR=internalDoc.getReportIR(executionContext.getDesign());
  executionContext.setReport(reportIR);
  this.report=executionContext.getReport();
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  setParameterValues(reportDocReader.getParameterValues());
  setParameterDisplayTexts(reportDocReader.getParameterDisplayTexts());
  usingParameterValues();
  executionContext.registerGlobalBeans(reportDocReader.getGlobalVariables(null));
  Map appContext=executionContext.getAppContext();
  IDataEngine dataEngine=executionContext.getDataEngine();
  dataEngine.prepare(report,appContext);
}
Program: 72946
Project: 72946
Buggy source:
/** 
 * @param engine the report engine
 * @param runnable the report runnable object
 * @param reportDoc the report document instance
 */
public RenderTask(ReportEngine engine,IReportDocument reportDoc){
  super(engine,IEngineTask.TASK_RENDER);
  IReportRunnable runnable=getOnPreparedRunnable(reportDoc);
  setReportRunnable(runnable);
  initializeRender(reportDoc,runnable);
}

Fixed version (ground truth):
/** 
 * @param engine the report engine
 * @param runnable the report runnable object
 * @param reportDoc the report document instance
 */
public RenderTask(ReportEngine engine,IReportDocument reportDoc){
  super(engine,IEngineTask.TASK_RENDER);
  initializeRender(reportDoc,null);
}
Program: 72947
Project: 72947
Buggy source:
protected void openReportDocument(IReportDocument reportDoc){
  this.reportDoc=reportDoc;
  executionContext.setReportDocument(reportDoc);
  setReportIR(reportDoc);
  setParameterValues(reportDoc.getParameterValues());
  setParameterDisplayTexts(reportDoc.getParameterDisplayTexts());
  usingParameterValues();
  executionContext.registerGlobalBeans(reportDoc.getGlobalVariables(null));
}

Fixed version (ground truth):
protected void openReportDocument(IReportDocument reportDoc){
  this.reportDoc=reportDoc;
  executionContext.setReportDocument(reportDoc);
  setParameterValues(reportDoc.getParameterValues());
  setParameterDisplayTexts(reportDoc.getParameterDisplayTexts());
  usingParameterValues();
  executionContext.registerGlobalBeans(reportDoc.getGlobalVariables(null));
}
Program: 72948
Project: 72948
Buggy source:
protected void initializeRender(IReportDocument reportDoc,IReportRunnable runnable){
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  assert(reportDoc instanceof IInternalReportDocument);
  IInternalReportDocument internalReportDoc=(IInternalReportDocument)reportDoc;
  ClassLoader documentLoader=internalReportDoc.getClassLoader();
  ClassLoader renderLoader=ApplicationClassLoader.createClassLoaderFromDesign(runnable,documentLoader);
  executionContext.setApplicationClassLoader(renderLoader);
  openReportDocument(reportDoc);
  totalPage=reportDoc.getPageCount();
  innerRender=new AllPageRender(new long[]{1,this.reportDoc.getPageCount()});
}

Fixed version (ground truth):
protected void initializeRender(IReportDocument reportDoc,IReportRunnable runnable){
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  assert(reportDoc instanceof IInternalReportDocument);
  IInternalReportDocument internalReportDoc=(IInternalReportDocument)reportDoc;
  if (runnable == null) {
    runnable=getOnPreparedRunnable(reportDoc);
    setReportRunnable(runnable);
    Report reportIR=internalReportDoc.getReportIR((ReportDesignHandle)runnable.getDesignHandle());
    executionContext.setReport(reportIR);
  }
 else {
    setReportRunnable(runnable);
    Report reportIR=new ReportParser().parse((ReportDesignHandle)runnable.getDesignHandle());
    executionContext.setReport(reportIR);
  }
  ClassLoader documentLoader=internalReportDoc.getClassLoader();
  ClassLoader renderLoader=ApplicationClassLoader.createClassLoaderFromDesign(runnable,documentLoader);
  executionContext.setApplicationClassLoader(renderLoader);
  openReportDocument(reportDoc);
  totalPage=reportDoc.getPageCount();
  innerRender=new AllPageRender(new long[]{1,this.reportDoc.getPageCount()});
}
Program: 72949
Project: 72949
Buggy source:
public Report getReport(){
  if (reportIR != null) {
    return reportIR;
  }
  if (runnable != null) {
    reportIR=new ReportParser().parse((ReportDesignHandle)runnable.getDesignHandle());
    reportIR=new ReportParser().parse((ReportDesignHandle)runnable.getDesignHandle());
  }
  return reportIR;
}

Fixed version (ground truth):
public Report getReport(){
  if (reportIR != null) {
    return reportIR;
  }
  if (runnable != null) {
    reportIR=new ReportParser().parse((ReportDesignHandle)runnable.getDesignHandle());
  }
  return reportIR;
}
Program: 72950
Project: 72950
Buggy source:
/** 
 * @param expr
 * @param bindings
 * @return
 * @throws DataException
 */
public static boolean isReferenceToAttribute(IBaseExpression expr,List bindings) throws DataException {
  Set set=OlapExpressionCompiler.getReferencedDimLevel(expr,bindings);
  if (set.size() != 1) {
    throw new DataException(ResourceConstants.REFERENCED_DIM_LEVEL_SET_ERROR);
  }
  for (Iterator k=set.iterator(); k.hasNext(); ) {
    Object obj=k.next();
    if (obj instanceof DimLevel) {
      DimLevel dimLevel=(DimLevel)obj;
      if (dimLevel.getAttrName() != null) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param expr
 * @param bindings
 * @return
 * @throws DataException
 */
public static boolean isReferenceToAttribute(IBaseExpression expr,List bindings) throws DataException {
  Set set=OlapExpressionCompiler.getReferencedDimLevel(expr,bindings);
  if (set.size() != 1) {
    return false;
  }
  for (Iterator k=set.iterator(); k.hasNext(); ) {
    Object obj=k.next();
    if (obj instanceof DimLevel) {
      DimLevel dimLevel=(DimLevel)obj;
      if (dimLevel.getAttrName() != null) {
        return true;
      }
    }
  }
  return false;
}
Program: 72951
Project: 72951
Buggy source:
public Collection getColumnValueSet(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,String boundColumnName,IRequestInfo requestInfo) throws BirtException {
  IColumnValueIterator columnValueIterator=getColumnValueIterator(dataSet,inputParamBindings,columnBindings,boundColumnName);
  int maxRowCount=-1;
  ArrayList values=new ArrayList();
  if (requestInfo != null) {
    if (requestInfo.getStartRow() >= 0) {
      ((ColumnValueIterator)columnValueIterator).moveTo(requestInfo.getStartRow());
      Object value=columnValueIterator.getValue();
      values.add(value);
    }
    maxRowCount=requestInfo.getMaxRow();
  }
  while (columnValueIterator.next() && maxRowCount != 0) {
    Object value=columnValueIterator.getValue();
    values.add(value);
    maxRowCount--;
  }
  columnValueIterator.close();
  return values;
}

Fixed version (ground truth):
public Collection getColumnValueSet(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,String boundColumnName,IRequestInfo requestInfo) throws BirtException {
  IColumnValueIterator columnValueIterator=getColumnValueIterator(dataSet,inputParamBindings,columnBindings,boundColumnName);
  int maxRowCount=-1;
  ArrayList values=new ArrayList();
  if (requestInfo != null) {
    if (requestInfo.getStartRow() >= 0) {
      ((ColumnValueIterator)columnValueIterator).moveTo(requestInfo.getStartRow());
    }
    maxRowCount=requestInfo.getMaxRow();
    if (maxRowCount != 0) {
      Object value=columnValueIterator.getValue();
      values.add(value);
      maxRowCount--;
    }
  }
  while (columnValueIterator.next() && maxRowCount != 0) {
    Object value=columnValueIterator.getValue();
    values.add(value);
    maxRowCount--;
  }
  columnValueIterator.close();
  return values;
}
Program: 72954
Project: 72954
Buggy source:
/** 
 * constructor
 * @param reportHandle the handle of the report design
 */
public DataViewTreeViewerPage(ModuleHandle reportHandle){
  super();
  this.reportHandle=reportHandle;
}

Fixed version (ground truth):
/** 
 * constructor
 * @param reportHandle the handle of the report design
 */
public DataViewTreeViewerPage(ModuleHandle reportHandle){
  super();
  setReportHandle(reportHandle);
}
Program: 72955
Project: 72955
Buggy source:
/** 
 * Gets the root of the viewer
 * @return Returns the root
 */
public ModuleHandle getRoot(){
  return reportHandle;
}

Fixed version (ground truth):
/** 
 * Gets the root of the viewer
 * @return Returns the root
 */
public ModuleHandle getRoot(){
  return getReportHandle();
}
Program: 72956
Project: 72956
Buggy source:
/** 
 * The <code>Page</code> implementation of this <code>IPage</code> method disposes of this page's control (if it has one and it has not already been disposed).
 */
public void dispose(){
  selectionChangedListeners.clear();
  treeViewer=null;
  SessionHandleAdapter.getInstance().getMediator().removeColleague(this);
  super.dispose();
}

Fixed version (ground truth):
/** 
 * The <code>Page</code> implementation of this <code>IPage</code> method disposes of this page's control (if it has one and it has not already been disposed).
 */
public void dispose(){
  selectionChangedListeners.clear();
  treeViewer=null;
  if (reportHandle != null)   SessionHandleAdapter.getInstance().getMediator(reportHandle).removeColleague(this);
  super.dispose();
}
Program: 72957
Project: 72957
Buggy source:
/** 
 * Creates the SWT control for this page under the given parent control.
 * @param parent the parent control
 */
public void createControl(Composite parent){
  treeViewer=createTreeViewer(parent);
  getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      treeSelect(event);
    }
  }
);
  configTreeViewer();
  hookTreeViewer();
  initPage();
  SessionHandleAdapter.getInstance().getMediator().addColleague(this);
}

Fixed version (ground truth):
/** 
 * Creates the SWT control for this page under the given parent control.
 * @param parent the parent control
 */
public void createControl(Composite parent){
  treeViewer=createTreeViewer(parent);
  getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      treeSelect(event);
    }
  }
);
  configTreeViewer();
  hookTreeViewer();
  initPage();
  if (reportHandle != null)   SessionHandleAdapter.getInstance().getMediator(reportHandle).addColleague(this);
}