nus-yam/ex-repair huggingface dataset:
Program: 72292
Project: 72292
Buggy source:
public void testFitToPageTrue() throws EngineException {
  List pages=getPages(true,false);
  float[] scales=new float[]{0.75f,0.75f,0.75f,0.75f,0.75f,0.75f,0.75f,0.75f};
  assertTrue(pages.size() == scales.length);
  for (int i=0; i < pages.size(); i++) {
    PageArea page=(PageArea)pages.get(i);
    assertEquals(new Float(scales[i]),new Float(page.getScale()));
  }
  pages=getPages(true,true);
  scales=new float[]{0.75f,0.75f,0.75f,0.234f};
  assertTrue(pages.size() == scales.length);
  for (int i=0; i < pages.size(); i++) {
    PageArea page=(PageArea)pages.get(i);
    float delta=scales[i] - page.getScale();
    assertTrue(delta > -0.001 && delta < 0.001);
  }
}

Fixed version (ground truth):
public void testFitToPageTrue() throws EngineException {
  List pages=getPages(true,true);
  float[] scales=new float[]{0.75f,0.75f,0.75f,0.23f};
  assertTrue(pages.size() == scales.length);
  for (int i=0; i < pages.size(); i++) {
    PageArea page=(PageArea)pages.get(i);
    float delta=scales[i] - page.getScale();
    assertTrue(delta > -0.01 && delta < 0.01);
  }
}
Program: 72293
Project: 72293
Buggy source:
public void testPagebreakPaginationOnlyFalse() throws EngineException {
  assertEquals(8,getPages(false,false).size());
}

Fixed version (ground truth):
public void testPagebreakPaginationOnlyFalse() throws EngineException {
  assertEquals(4,getPages(false,false).size());
}
Program: 72295
Project: 72295
Buggy source:
/** 
 * @param dataSourceQuery
 * @param resultSet
 * @param resultClass
 * @param stopSign
 * @throws DataException
 */
public SimpleResultSet(DataSourceQuery dataSourceQuery,ResultSet resultSet,IResultClass resultClass,IEventHandler handler,StopSign stopSign) throws DataException {
  this.rowResultSet=new RowResultSet(new SmartCacheRequest(dataSourceQuery.getMaxRows(),dataSourceQuery.getFetchEvents(),new OdiAdapter(resultSet),resultClass,false));
  this.currResultObj=this.rowResultSet.next(stopSign);
  this.resultSet=resultSet;
  this.stopSign=stopSign;
  this.handler=handler;
}

Fixed version (ground truth):
/** 
 * @param dataSourceQuery
 * @param resultSet
 * @param resultClass
 * @param stopSign
 * @throws DataException
 */
public SimpleResultSet(DataSourceQuery dataSourceQuery,ResultSet resultSet,IResultClass resultClass,IEventHandler handler,StopSign stopSign) throws DataException {
  this.rowResultSet=new RowResultSet(new SmartCacheRequest(dataSourceQuery.getMaxRows(),dataSourceQuery.getFetchEvents(),new OdiAdapter(resultSet),resultClass,false));
  this.currResultObj=this.rowResultSet.next(stopSign);
  this.rowCount=(this.currResultObj != null) ? -1 : 0;
  this.resultSet=resultSet;
  this.stopSign=stopSign;
  this.handler=handler;
}
Program: 72296
Project: 72296
Buggy source:
public int getRowCount() throws DataException {
  return this.currResultObj == null ? 0 : -1;
}

Fixed version (ground truth):
public int getRowCount() throws DataException {
  return this.rowCount;
}
Program: 72297
Project: 72297
Buggy source:
public boolean next() throws BirtException {
  checkStarted();
  currRowIndex++;
  if (currRowIndex < rowCount) {
    readCurrentRow();
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean next() throws BirtException {
  checkStarted();
  if (this.columnValueMap == null)   return false;
  currRowIndex++;
  readCurrentRow();
  return this.columnValueMap != null;
}
Program: 72298
Project: 72298
Buggy source:
/** 
 * @throws DataException
 */
private void readCurrentRow() throws DataException {
  try {
    rowIndex=IOUtil.readInt(rowInputStream);
    startingGroupLevel=IOUtil.readInt(rowInputStream);
    endingGroupLevel=IOUtil.readInt(rowInputStream);
    columnValueMap.clear();
    for (int i=0; i < columnList.size(); i++) {
      columnValueMap.put(columnList.get(i),IOUtil.readObject(rowInputStream,DataEngineSession.getCurrentClassLoader()));
    }
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.READ_CACHE_TEMPFILE_ERROR);
  }
}

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

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

Fixed version (ground truth):
/** 
 * @throws DataException 
 * @throws IOException 
 */
private void closeCacheOutputStream() throws DataException {
  try {
    if (rowOutputStream != null) {
      IOUtil.writeInt(rowOutputStream,-1);
      rowOutputStream.close();
      rowOutputStream=null;
    }
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.CLOSE_CACHE_TEMPFILE_ERROR);
  }
}
Program: 72301
Project: 72301
Buggy source:
/** 
 * whethter the expression has aggregation 
 * @param oldExpression
 * @return
 * @throws BirtException
 */
public static boolean hasAggregation(String expression){
  if (expression == null)   return false;
  try {
    return ExpressionParserUtility.hasAggregation(expression,ExpressionUtil.ROW_INDICATOR);
  }
 catch (  BirtException e) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * whethter the expression has aggregation 
 * @param oldExpression
 * @return
 * @throws BirtException
 */
public static boolean hasAggregation(String expression){
  if (expression == null)   return false;
  try {
    return ExpressionParserUtility.hasAggregation(expression,ExpressionUtil.ROW_INDICATOR) || ExpressionParserUtility.hasAggregation(expression,ExpressionUtil.DATASET_ROW_INDICATOR);
  }
 catch (  BirtException e) {
    return false;
  }
}
Program: 72303
Project: 72303
Buggy source:
private String createSignature(IMethodInfo info){
  StringBuffer signature=new StringBuffer();
  String javaDoc=info.getJavaDoc();
  if (javaDoc != null && javaDoc.length() > 0) {
    signature.append("String_Node_Str");
    signature.append(info.getJavaDoc());
  }
  signature.append("String_Node_Str");
  signature.append(info.getName());
  signature.append("String_Node_Str");
  Iterator iter=info.argumentListIterator();
  if (iter.hasNext()) {
    IArgumentInfoList argumentList=(IArgumentInfoList)iter.next();
    for (Iterator argumentIter=argumentList.argumentsIterator(); argumentIter.hasNext(); ) {
      IArgumentInfo argument=(IArgumentInfo)argumentIter.next();
      String argName=argument.getName();
      if (argName == null || argName.length() == 0) {
        String type=argument.getType();
        argName=JSEditor.convertToParameterName(type);
      }
      signature.append(argName);
      if (argumentIter.hasNext()) {
        signature.append("String_Node_Str");
      }
    }
  }
  signature.append("String_Node_Str");
  return signature.toString();
}

Fixed version (ground truth):
private String createSignature(IMethodInfo info){
  StringBuffer signature=new StringBuffer();
  String javaDoc=info.getJavaDoc();
  if (javaDoc != null && javaDoc.length() > 0) {
    signature.append("String_Node_Str");
    signature.append(info.getJavaDoc());
  }
  if (info instanceof ITemplateMethodInfo) {
    String code=((ITemplateMethodInfo)info).getCodeTemplate();
    if (code != null) {
      signature.append("String_Node_Str").append(code).append("String_Node_Str");
      return signature.toString();
    }
  }
  signature.append("String_Node_Str");
  signature.append(info.getName());
  signature.append("String_Node_Str");
  Iterator iter=info.argumentListIterator();
  if (iter.hasNext()) {
    IArgumentInfoList argumentList=(IArgumentInfoList)iter.next();
    for (Iterator argumentIter=argumentList.argumentsIterator(); argumentIter.hasNext(); ) {
      IArgumentInfo argument=(IArgumentInfo)argumentIter.next();
      String argName=argument.getName();
      if (argName == null || argName.length() == 0) {
        String type=argument.getType();
        argName=JSEditor.convertToParameterName(type);
      }
      signature.append(argName);
      if (argumentIter.hasNext()) {
        signature.append("String_Node_Str");
      }
    }
  }
  signature.append("String_Node_Str");
  return signature.toString();
}
Program: 72304
Project: 72304
Buggy source:
protected void drawTextAt(ITextArea text,int x,int y,int width,int height,TextStyle textStyle){
  pageGraphic.drawText(text.getNotFlippedText(),x,y,width,height,textStyle);
}

Fixed version (ground truth):
protected void drawTextAt(ITextArea text,int x,int y,int width,int height,TextStyle textStyle){
  pageGraphic.drawText(text.getLogicalOrderText(),x,y,width,height,textStyle);
}
Program: 72305
Project: 72305
Buggy source:
public IStyle getStyle(){
  if (style == null) {
    if (inlineStyle == null) {
      inlineStyle=report.createStyle();
    }
    String styleClass=getStyleClass();
    if (styleClass != null) {
      IStyle classStyle=report.findStyle(styleClass);
      style=new CompositeStyle(classStyle,inlineStyle);
    }
 else {
      style=inlineStyle;
    }
  }
  return style;
}

Fixed version (ground truth):
public IStyle getStyle(){
  if (style == null) {
    if (inlineStyle == null) {
      inlineStyle=report.createStyle();
    }
    String styleClass=getStyleClass();
    if (styleClass != null) {
      IStyle classStyle=report.findStyle(styleClass);
      style=new CompositeStyle(classStyle,inlineStyle);
    }
 else {
      style=inlineStyle;
    }
  }
  return new ContentStyle((AbstractStyle)style);
}
Program: 72306
Project: 72306
Buggy source:
/** 
 * This method will be invoked while a containerArea ends.
 * @param container the ContainerArea specified from layout
 */
protected void endContainer(IContainerArea container){
  currentX-=getX(container);
  currentY-=getY(container);
  if (container instanceof PageArea) {
    pageGraphic.dispose();
    if (((PageArea)container).isExtendToMultiplePages() && (extendDirection != EXTEND_NONE) && !extendDirectionMask) {
      int originalX=currentX;
      int originalY=currentY;
      if (extendDirection == EXTEND_ON_VERTICAL) {
        int startX=originalX;
        int startY=originalY + pageHeight;
        while (startY < maxHeight) {
          visitContainer(container,startX,startY);
          startY+=pageHeight;
        }
      }
 else       if (extendDirection == EXTEND_ON_HORIZONTAL) {
        int startX=originalX + pageWidth;
        int startY=originalY;
        while (startX < maxWidth) {
          visitContainer(container,startX,startY);
          startX+=pageWidth;
        }
      }
 else       if (extendDirection == EXTEND_ON_HORIZONTAL_AND_VERTICAL) {
        int startX=originalX + pageWidth;
        int startY=originalY;
        while (startY < maxHeight) {
          while (startX < maxWidth) {
            visitContainer(container,startX,startY);
            startX+=pageWidth;
          }
          startX=originalX;
          startY+=pageHeight;
        }
      }
      setExtendDirection(EXTEND_NONE);
      maxWidth=0;
      maxHeight=0;
    }
  }
 else {
    if (container instanceof TableArea) {
      drawTableBorder((TableArea)container);
    }
 else     if (!(container instanceof CellArea)) {
      BorderInfo[] borders=cacheBorderInfo(container);
      drawBorder(borders);
    }
    if (container.needClip()) {
      pageGraphic.clipRestore();
    }
  }
}

Fixed version (ground truth):
/** 
 * This method will be invoked while a containerArea ends.
 * @param container the ContainerArea specified from layout
 */
protected void endContainer(IContainerArea container){
  currentX-=getX(container);
  currentY-=getY(container);
  if (container instanceof PageArea) {
    pageGraphic.dispose();
  }
 else {
    if (container instanceof TableArea) {
      drawTableBorder((TableArea)container);
    }
 else     if (!(container instanceof CellArea)) {
      BorderInfo[] borders=cacheBorderInfo(container);
      drawBorder(borders);
    }
    if (container.needClip()) {
      pageGraphic.clipRestore();
    }
  }
}
Program: 72307
Project: 72307
Buggy source:
/** 
 * If the container is a PageArea, this method creates a PDF page. If the container is the other containerAreas, such as TableArea, or just the border of textArea/imageArea this method draws the border and background of the given container.
 * @param container the ContainerArea specified from layout
 * @param offsetX for any (x,y) in the ContainerArea, if x<offsetX, the (x,y) will be omitted.
 * @param offsetY for any (x,y) in the ContainerArea, if y<offsetY, the (x,y) will be omitted.
 */
protected void startContainer(IContainerArea container,int offsetX,int offsetY){
  if (container instanceof PageArea) {
    scale=container.getScale();
    newPage(container);
    currentX=-offsetX;
    currentY=-offsetY;
  }
 else {
    if (container.needClip()) {
      pageGraphic.clipSave();
      clip(container);
    }
    drawContainer(container);
    currentX+=getX(container);
    currentY+=getY(container);
  }
}

Fixed version (ground truth):
/** 
 * The container may be a TableArea, RowArea, etc. Or just the border of textArea/imageArea. This method draws the border and background of the given container.
 * @param container the ContainerArea specified from layout
 */
protected void startContainer(IContainerArea container){
  if (container.needClip()) {
    pageGraphic.clipSave();
    clip(container);
  }
  drawContainer(container);
  currentX+=getX(container);
  currentY+=getY(container);
}
Program: 72308
Project: 72308
Buggy source:
/** 
 * Gets the output format. always returns "postscript".
 */
public abstract String getOutputFormat();

Fixed version (ground truth):
/** 
 * Gets the output format.
 */
public abstract String getOutputFormat();
Program: 72309
Project: 72309
Buggy source:
/** 
 * Creates a new PDF page
 * @param page the PageArea specified from layout
 */
protected void newPage(IContainerArea page){
  pageHeight=getHeight(page);
  pageWidth=getWidth(page);
  Color backgroundColor=PropertyUtil.getColor(page.getStyle().getProperty(StyleConstants.STYLE_BACKGROUND_COLOR));
  pageGraphic=pageDevice.newPage(pageWidth,pageHeight,backgroundColor);
  drawBackgroundImage(page.getStyle(),0,0,pageWidth,pageHeight);
}

Fixed version (ground truth):
/** 
 * Creates a new PDF page
 * @param page the PageArea specified from layout
 */
protected void newPage(IContainerArea page){
  int pageHeight=getHeight(page);
  int pageWidth=getWidth(page);
  Color backgroundColor=PropertyUtil.getColor(page.getStyle().getProperty(StyleConstants.STYLE_BACKGROUND_COLOR));
  pageGraphic=pageDevice.newPage(pageWidth,pageHeight,backgroundColor);
  drawBackgroundImage(page.getStyle(),0,0,pageWidth,pageHeight);
}
Program: 72310
Project: 72310
Buggy source:
public void visitContainer(IContainerArea container){
  startContainer(container);
  visitChildren(container);
  endContainer(container);
}

Fixed version (ground truth):
/** 
 * Visits a container
 * @param container
 * @param offsetX
 * @param offsetY
 */
public void visitContainer(IContainerArea container){
  if (container instanceof PageArea) {
    visitPage((PageArea)container);
  }
 else {
    startContainer(container);
    visitChildren(container);
    endContainer(container);
  }
}
Program: 72311
Project: 72311
Buggy source:
/** 
 * Creates selected expression trees with given filter list.
 * @param dataSetList list for DataSet tree
 * @param filterList list of filters
 */
public void createFilteredExpressionTree(List dataSetList,List filterList){
  if (filter(TREE_NAME_CONTEXT,filterList)) {
    createContextCatagory();
  }
  if (filter(TREE_NAME_PARAMETERS,filterList)) {
    createParamtersCategory();
  }
  if (filter(TREE_NAME_NATIVE_OBJECTS,filterList)) {
    createNativeObjectsCategory();
  }
  if (filter(TREE_NAME_BIRT_OBJECTS,filterList)) {
    createBirtObjectsCategory();
  }
  if (filter(TREE_NAME_OPERATORS,filterList)) {
    createOperatorsCategory();
  }
}

Fixed version (ground truth):
/** 
 * Creates selected expression trees with given filter list.
 * @param dataSetList list for DataSet tree
 * @param filterList list of filters
 */
public void createFilteredExpressionTree(List dataSetList,List filterList){
  if (filter(TREE_NAME_CONTEXT,filterList)) {
    createContextCatagory();
  }
  if (filter(TREE_NAME_PARAMETERS,filterList)) {
    createParamtersCategory();
  }
  if (filter(TREE_NAME_NATIVE_OBJECTS,filterList)) {
    createNativeObjectsCategory();
  }
  if (filter(TREE_NAME_BIRT_OBJECTS,filterList)) {
    createBirtObjectsCategory();
  }
  if (filter(TREE_NAME_OPERATORS,filterList)) {
    createOperatorsCategory();
  }
  if (currentMethodName != null) {
    switchContext();
  }
}
Program: 72312
Project: 72312
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  ISelection selection=event.getSelection();
  if (selection != null) {
    Object[] sel=((IStructuredSelection)selection).toArray();
    if (sel.length == 1) {
      if (sel[0] instanceof IPropertyDefn) {
        IPropertyDefn elePropDefn=(IPropertyDefn)sel[0];
        switchContext(elePropDefn.getName());
      }
    }
  }
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  ISelection selection=event.getSelection();
  if (selection != null) {
    Object[] sel=((IStructuredSelection)selection).toArray();
    if (sel.length == 1) {
      if (sel[0] instanceof IPropertyDefn) {
        IPropertyDefn elePropDefn=(IPropertyDefn)sel[0];
        currentMethodName=elePropDefn.getName();
        currentContextName=elePropDefn.getContext();
        switchContext();
      }
    }
  }
}
Program: 72313
Project: 72313
Buggy source:
private void updateClientContext(){
  if (CLIENT_CONTEXT.equals(currentMethodName)) {
    if (parametersItem != null && !parametersItem.isDisposed()) {
      parametersItem.dispose();
      parametersItem=null;
    }
    if (birtObjectsItem != null && !birtObjectsItem.isDisposed()) {
      birtObjectsItem.dispose();
      birtObjectsItem=null;
    }
  }
 else {
    if (parametersItem == null || parametersItem.isDisposed()) {
      int idx=tree.indexOf(contextItem);
      if (idx == -1) {
        parametersItem=createTopTreeItem(tree,TREE_ITEM_PARAMETERS);
      }
 else {
        parametersItem=createTopTreeItem(tree,TREE_ITEM_PARAMETERS,idx + 1);
      }
      buildParameterTree();
    }
    if (birtObjectsItem == null || birtObjectsItem.isDisposed()) {
      int idx=tree.indexOf(nativeObejctsItem);
      if (idx == -1) {
        birtObjectsItem=createTopTreeItem(tree,TREE_ITEM_BIRT_OBJECTS);
      }
 else {
        birtObjectsItem=createTopTreeItem(tree,TREE_ITEM_BIRT_OBJECTS,idx + 1);
      }
      createObjects(birtObjectsItem,OBJECTS_TYPE_BIRT);
    }
  }
}

Fixed version (ground truth):
private void updateClientContext(){
  if (CLIENT_CONTEXT.equals(currentContextName)) {
    if (parametersItem != null && !parametersItem.isDisposed()) {
      parametersItem.dispose();
      parametersItem=null;
    }
    if (birtObjectsItem != null && !birtObjectsItem.isDisposed()) {
      birtObjectsItem.dispose();
      birtObjectsItem=null;
    }
  }
 else {
    if (parametersItem == null || parametersItem.isDisposed()) {
      int idx=tree.indexOf(contextItem);
      if (idx == -1) {
        parametersItem=createTopTreeItem(tree,TREE_ITEM_PARAMETERS);
      }
 else {
        parametersItem=createTopTreeItem(tree,TREE_ITEM_PARAMETERS,idx + 1);
      }
      buildParameterTree();
    }
    if (birtObjectsItem == null || birtObjectsItem.isDisposed()) {
      int idx=tree.indexOf(nativeObejctsItem);
      if (idx == -1) {
        birtObjectsItem=createTopTreeItem(tree,TREE_ITEM_BIRT_OBJECTS);
      }
 else {
        birtObjectsItem=createTopTreeItem(tree,TREE_ITEM_BIRT_OBJECTS,idx + 1);
      }
      createObjects(birtObjectsItem,OBJECTS_TYPE_BIRT);
    }
  }
}
Program: 72314
Project: 72314
Buggy source:
protected void switchContext(String context){
  if (tree == null || tree.isDisposed() || context == null) {
    return;
  }
  currentMethodName=context;
  createContextObjects(currentMethodName);
  updateClientContext();
  updateDynamicItems();
}

Fixed version (ground truth):
protected void switchContext(){
  if (tree == null || tree.isDisposed()) {
    return;
  }
  createContextObjects(currentMethodName);
  updateClientContext();
  updateDynamicItems();
}
Program: 72315
Project: 72315
Buggy source:
/** 
 * Compute the row span include data span and subtotal span for row edge area, this doesn't consider for multiple vertical measures.
 */
public static int computeRowSpan(CrosstabReportItemHandle crosstabItem,List rowGroups,int dimensionIndex,int levelIndex,EdgeCursor rowEdgeCursor,boolean isLayoutDownThenOver) throws OLAPException {
}

Fixed version (ground truth):
/** 
 * Compute the row span include data span and subtotal span for row edge area, this doesn't consider for multiple vertical measures.
 */
public static int computeRowSpan(CrosstabReportItemHandle crosstabItem,List<EdgeGroup> rowGroups,int dimensionIndex,int levelIndex,EdgeCursor rowEdgeCursor,boolean isLayoutDownThenOver) throws OLAPException {
}
Program: 72316
Project: 72316
Buggy source:
/** 
 * Returns 1-based starting group index, 0 means start of entire edge
 */
public static int getStartingGroupLevel(EdgeCursor edgeCursor,List groupCursors) throws OLAPException {
  if (edgeCursor.isFirst()) {
    return 0;
  }
  for (int i=0; i < groupCursors.size() - 1; i++) {
    DimensionCursor dc=(DimensionCursor)groupCursors.get(i);
    if (GroupUtil.isDummyGroup(dc)) {
      return i == 0 ? 1 : i;
    }
    if (dc.getEdgeStart() == edgeCursor.getPosition()) {
      return i + 1;
    }
  }
  return groupCursors.size();
}

Fixed version (ground truth):
/** 
 * Returns 1-based starting group index, 0 means start of entire edge
 */
public static int getStartingGroupLevel(EdgeCursor edgeCursor,List<DimensionCursor> groupCursors) throws OLAPException {
  if (edgeCursor.isFirst()) {
    return 0;
  }
  for (int i=0; i < groupCursors.size() - 1; i++) {
    DimensionCursor dc=groupCursors.get(i);
    if (GroupUtil.isDummyGroup(dc)) {
      return i == 0 ? 1 : i;
    }
    if (dc.getEdgeStart() == edgeCursor.getPosition()) {
      return i + 1;
    }
  }
  return groupCursors.size();
}
Program: 72317
Project: 72317
Buggy source:
/** 
 * Check if this group is a leaf group, e.g. the innerest non-dummy group.
 */
public static boolean isLeafGroup(List groupCursors,int groupIndex) throws OLAPException {
  for (int i=groupIndex + 1; i < groupCursors.size(); i++) {
    DimensionCursor dc=(DimensionCursor)groupCursors.get(i);
    if (!isDummyGroup(dc)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Check if this group is a leaf group, e.g. the innerest non-dummy group.
 */
public static boolean isLeafGroup(List<DimensionCursor> groupCursors,int groupIndex) throws OLAPException {
  for (int i=groupIndex + 1; i < groupCursors.size(); i++) {
    DimensionCursor dc=groupCursors.get(i);
    if (!isDummyGroup(dc)) {
      return false;
    }
  }
  return true;
}
Program: 72318
Project: 72318
Buggy source:
/** 
 * Returns the accumulated group index for current level element from given group list.
 * @param groups
 * @param dimensionIndex
 * @param levelIndex If this is negative(<0), means the last level index in given dimension.
 * @return
 */
public static int getGroupIndex(List groups,int dimensionIndex,int levelIndex){
  if (levelIndex < 0) {
    for (int i=groups.size() - 1; i >= 0; i--) {
      EdgeGroup gp=(EdgeGroup)groups.get(i);
      if (gp.dimensionIndex == dimensionIndex) {
        return i;
      }
    }
  }
 else {
    for (int i=0; i < groups.size(); i++) {
      EdgeGroup gp=(EdgeGroup)groups.get(i);
      if (gp.dimensionIndex == dimensionIndex && gp.levelIndex == levelIndex) {
        return i;
      }
    }
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Returns the accumulated group index for current level element from given group list.
 * @param groups
 * @param dimensionIndex
 * @param levelIndex If this is negative(<0), means the last level index in given dimension.
 * @return
 */
public static int getGroupIndex(List<EdgeGroup> groups,int dimensionIndex,int levelIndex){
  if (levelIndex < 0) {
    for (int i=groups.size() - 1; i >= 0; i--) {
      EdgeGroup gp=groups.get(i);
      if (gp.dimensionIndex == dimensionIndex) {
        return i;
      }
    }
  }
 else {
    for (int i=0; i < groups.size(); i++) {
      EdgeGroup gp=groups.get(i);
      if (gp.dimensionIndex == dimensionIndex && gp.levelIndex == levelIndex) {
        return i;
      }
    }
  }
  return -1;
}
Program: 72319
Project: 72319
Buggy source:
/** 
 * Returns the next group on given group list.
 */
public static EdgeGroup getNextGroup(List groups,int currentDimensionIndex,int currentLevelIndex){
  int currentGroup=-1;
  for (int i=0; i < groups.size(); i++) {
    EdgeGroup gp=(EdgeGroup)groups.get(i);
    if (gp.dimensionIndex == currentDimensionIndex && gp.levelIndex == currentLevelIndex) {
      currentGroup=i;
      break;
    }
  }
  if (currentGroup >= 0 && currentGroup < groups.size() - 1) {
    return (EdgeGroup)groups.get(currentGroup + 1);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the next group on given group list.
 */
public static EdgeGroup getNextGroup(List<EdgeGroup> groups,int currentDimensionIndex,int currentLevelIndex){
  int currentGroup=-1;
  for (int i=0; i < groups.size(); i++) {
    EdgeGroup gp=groups.get(i);
    if (gp.dimensionIndex == currentDimensionIndex && gp.levelIndex == currentLevelIndex) {
      currentGroup=i;
      break;
    }
  }
  if (currentGroup >= 0 && currentGroup < groups.size() - 1) {
    return groups.get(currentGroup + 1);
  }
  return null;
}
Program: 72320
Project: 72320
Buggy source:
/** 
 * Returns 1-based ending group index, 0 means end of entire edge.
 */
public static int getEndingGroupLevel(EdgeCursor edgeCursor,List groupCursors) throws OLAPException {
  if (edgeCursor.isLast()) {
    return 0;
  }
  for (int i=0; i < groupCursors.size() - 1; i++) {
    DimensionCursor dc=(DimensionCursor)groupCursors.get(i);
    if (GroupUtil.isDummyGroup(dc)) {
      return i == 0 ? 1 : i;
    }
    if (dc.getEdgeEnd() == edgeCursor.getPosition()) {
      return i + 1;
    }
  }
  return groupCursors.size();
}

Fixed version (ground truth):
/** 
 * Returns 1-based ending group index, 0 means end of entire edge.
 */
public static int getEndingGroupLevel(EdgeCursor edgeCursor,List<DimensionCursor> groupCursors) throws OLAPException {
  if (edgeCursor.isLast()) {
    return 0;
  }
  for (int i=0; i < groupCursors.size() - 1; i++) {
    DimensionCursor dc=groupCursors.get(i);
    if (GroupUtil.isDummyGroup(dc)) {
      return i == 0 ? 1 : i;
    }
    if (dc.getEdgeEnd() == edgeCursor.getPosition()) {
      return i + 1;
    }
  }
  return groupCursors.size();
}
Program: 72321
Project: 72321
Buggy source:
/** 
 * Returns the span between current group to last group.
 */
public static int computeGroupSpan(List groups,int dimensionIndex,int levelIndex){
  int currentGroup=-1;
  for (int i=0; i < groups.size(); i++) {
    EdgeGroup gp=(EdgeGroup)groups.get(i);
    if (gp.dimensionIndex == dimensionIndex && gp.levelIndex == levelIndex) {
      currentGroup=i;
      break;
    }
  }
  if (currentGroup == -1) {
    return 1;
  }
  return groups.size() - currentGroup - 1;
}

Fixed version (ground truth):
/** 
 * Returns the span between current group to last group.
 */
public static int computeGroupSpan(List<EdgeGroup> groups,int dimensionIndex,int levelIndex){
  int currentGroup=-1;
  for (int i=0; i < groups.size(); i++) {
    EdgeGroup gp=groups.get(i);
    if (gp.dimensionIndex == dimensionIndex && gp.levelIndex == levelIndex) {
      currentGroup=i;
      break;
    }
  }
  if (currentGroup == -1) {
    return 1;
  }
  return groups.size() - currentGroup - 1;
}
Program: 72323
Project: 72323
Buggy source:
/** 
 * Returns the previous group on specific axis
 */
public static EdgeGroup getPreviousGroup(List groups,int currentDimensionIndex,int currentLevelIndex){
  int currentGroup=-1;
  for (int i=0; i < groups.size(); i++) {
    EdgeGroup gp=(EdgeGroup)groups.get(i);
    if (gp.dimensionIndex == currentDimensionIndex && gp.levelIndex == currentLevelIndex) {
      currentGroup=i;
      break;
    }
  }
  if (currentGroup > 0 && currentGroup < groups.size()) {
    return (EdgeGroup)groups.get(currentGroup - 1);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the previous group on specific axis
 */
public static EdgeGroup getPreviousGroup(List<EdgeGroup> groups,int currentDimensionIndex,int currentLevelIndex){
  int currentGroup=-1;
  for (int i=0; i < groups.size(); i++) {
    EdgeGroup gp=groups.get(i);
    if (gp.dimensionIndex == currentDimensionIndex && gp.levelIndex == currentLevelIndex) {
      currentGroup=i;
      break;
    }
  }
  if (currentGroup > 0 && currentGroup < groups.size()) {
    return groups.get(currentGroup - 1);
  }
  return null;
}
Program: 72324
Project: 72324
Buggy source:
/** 
 * Returns the next group index on given group list.
 */
public static int getNextGroupIndex(List groups,int currentDimensionIndex,int currentLevelIndex){
  int currentGroup=-1;
  for (int i=0; i < groups.size(); i++) {
    EdgeGroup gp=(EdgeGroup)groups.get(i);
    if (gp.dimensionIndex == currentDimensionIndex && gp.levelIndex == currentLevelIndex) {
      currentGroup=i;
      break;
    }
  }
  if (currentGroup >= 0 && currentGroup < groups.size() - 1) {
    return currentGroup + 1;
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Returns the next group index on given group list.
 */
public static int getNextGroupIndex(List<EdgeGroup> groups,int currentDimensionIndex,int currentLevelIndex){
  int currentGroup=-1;
  for (int i=0; i < groups.size(); i++) {
    EdgeGroup gp=groups.get(i);
    if (gp.dimensionIndex == currentDimensionIndex && gp.levelIndex == currentLevelIndex) {
      currentGroup=i;
      break;
    }
  }
  if (currentGroup >= 0 && currentGroup < groups.size() - 1) {
    return currentGroup + 1;
  }
  return -1;
}
Program: 72325
Project: 72325
Buggy source:
/** 
 * Checks if current group is the first group
 */
public static boolean isFirstGroup(List groups,int dimensionIndex,int levelIndex){
  if (groups.size() > 0) {
    EdgeGroup eg=(EdgeGroup)groups.get(0);
    return dimensionIndex == eg.dimensionIndex && levelIndex == eg.levelIndex;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks if current group is the first group
 */
public static boolean isFirstGroup(List<EdgeGroup> groups,int dimensionIndex,int levelIndex){
  if (groups.size() > 0) {
    EdgeGroup eg=groups.get(0);
    return dimensionIndex == eg.dimensionIndex && levelIndex == eg.levelIndex;
  }
  return false;
}
Program: 72326
Project: 72326
Buggy source:
/** 
 * Returns a list of groups on specific axis.
 */
public static List getGroups(CrosstabReportItemHandle crosstabItem,int axisType){
  List groups=new ArrayList();
  int dimCount=crosstabItem.getDimensionCount(axisType);
  if (dimCount > 0) {
    for (int i=0; i < dimCount; i++) {
      DimensionViewHandle dv=crosstabItem.getDimension(axisType,i);
      for (int j=0; j < dv.getLevelCount(); j++) {
        groups.add(new EdgeGroup(i,j,dv.getCubeDimensionName(),dv.getLevel(j).getCubeLevelName()));
      }
    }
  }
  return groups;
}

Fixed version (ground truth):
/** 
 * Returns a list of groups on specific axis.
 */
public static List<EdgeGroup> getGroups(CrosstabReportItemHandle crosstabItem,int axisType){
  List<EdgeGroup> groups=new ArrayList<EdgeGroup>();
  int dimCount=crosstabItem.getDimensionCount(axisType);
  if (dimCount > 0) {
    for (int i=0; i < dimCount; i++) {
      DimensionViewHandle dv=crosstabItem.getDimension(axisType,i);
      for (int j=0; j < dv.getLevelCount(); j++) {
        groups.add(new EdgeGroup(i,j,dv.getCubeDimensionName(),dv.getLevel(j).getCubeLevelName()));
      }
    }
  }
  return groups;
}
Program: 72327
Project: 72327
Buggy source:
protected void drawTextAt(ITextArea text,int x,int y,int width,int height,TextStyle textStyle){
  pageGraphic.drawText(text.getText(),x,y,width,height,textStyle);
}

Fixed version (ground truth):
protected void drawTextAt(ITextArea text,int x,int y,int width,int height,TextStyle textStyle){
  pageGraphic.drawText(text.getNotFlippedText(),x,y,width,height,textStyle);
}
Program: 72330
Project: 72330
Buggy source:
public IReportItemExecutor getNextChild(){
  if (null != childIterator && childIterator.hasNext()) {
    IContent child=(IContent)childIterator.next();
    return manager.createExecutor(child);
  }
  return null;
}

Fixed version (ground truth):
public IReportItemExecutor getNextChild(){
  if (null != childIterator && childIterator.hasNext()) {
    IContent child=(IContent)childIterator.next();
    return manager.createExecutor(this,child);
  }
  return null;
}
Program: 72331
Project: 72331
Buggy source:
public IContent execute(){
  if (null == content) {
    return null;
  }
  childIterator=content.getChildren().iterator();
  if (cloneContent) {
    return content.cloneContent(false);
  }
  return content;
}

Fixed version (ground truth):
public IContent execute(){
  if (null == content) {
    return null;
  }
  childIterator=content.getChildren().iterator();
  if (cloneContent) {
    content=content.cloneContent(false);
    IReportItemExecutor parent=getParent();
    if (parent != null) {
      content.setParent(parent.getContent());
    }
  }
  return content;
}
Program: 72332
Project: 72332
Buggy source:
DOMReportItemExecutor createExecutor(IContent content){
  DOMReportItemExecutor executor=null;
  if (!freeList.isEmpty()) {
    executor=(DOMReportItemExecutor)freeList.removeFirst();
  }
 else {
    executor=new DOMReportItemExecutor(this);
  }
  executor.setContent(content);
  return executor;
}

Fixed version (ground truth):
DOMReportItemExecutor createExecutor(DOMReportItemExecutor parent,IContent content){
  DOMReportItemExecutor executor=null;
  if (!freeList.isEmpty()) {
    executor=(DOMReportItemExecutor)freeList.removeFirst();
  }
 else {
    executor=new DOMReportItemExecutor(this);
  }
  executor.setContent(content);
  executor.setParent(parent);
  return executor;
}
Program: 72333
Project: 72333
Buggy source:
/** 
 * Returns current page instance if the currently selected page index is not -1, or <code>null</code> if it is.
 * @return active page instance if selected, or <code>null</code> if nopage is currently active.
 */
public IFormPage getCurrentPageInstance(){
  int index=getCurrentPage();
  if (index != -1) {
    Object page=pages.get(index);
    if (page instanceof IFormPage)     return (IFormPage)page;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns current page instance if the currently selected page index is not -1, or <code>null</code> if it is.
 * @return active page instance if selected, or <code>null</code> if no pageis currently active.
 */
public IFormPage getCurrentPageInstance(){
  int index=getCurrentPage();
  if (index != -1) {
    Object page=pages.get(index);
    if (page instanceof IFormPage)     return (IFormPage)page;
  }
  return null;
}
Program: 72334
Project: 72334
Buggy source:
public void setFocus(){
  super.setFocus();
  if (getCurrentPage() < 0 || getCurrentPage() > pages.size() - 1) {
    return;
  }
  bingdingKey(getCurrentPage());
}

Fixed version (ground truth):
public void setFocus(){
  super.setFocus();
  if (pages == null || getCurrentPage() < 0 || getCurrentPage() > pages.size() - 1) {
    return;
  }
  bingdingKey(getCurrentPage());
}
Program: 72336
Project: 72336
Buggy source:
/** 
 * Tests ACLExpression for report item
 * @throws SemanticException
 */
public void testACL() throws SemanticException {
  TextItemHandle textHandle=(TextItemHandle)designHandle.findElement("String_Node_Str");
  String aclExp="String_Node_Str";
  textHandle.setACLExpression(aclExp);
  assertEquals(aclExp,textHandle.getACLExpression());
  assertFalse(textHandle.cascadeACL());
  textHandle.setCascadeACL(true);
  assertFalse(textHandle.cascadeACL());
  assertFalse((Boolean)(textHandle.getProperty(IReportItemModel.CASCADE_ACL_PROP)));
  aclExp="String_Node_Str";
  textHandle.setACLExpression(aclExp);
  assertEquals(aclExp,textHandle.getACLExpression());
  aclExp="String_Node_Str";
  textHandle.setACLExpression(aclExp);
  assertEquals(aclExp,textHandle.getACLExpression());
  aclExp="String_Node_Str";
  textHandle.setACLExpression(aclExp);
  assertEquals(aclExp,textHandle.getACLExpression());
}

Fixed version (ground truth):
/** 
 * Tests ACLExpression for report item
 * @throws SemanticException
 */
public void testACL() throws SemanticException {
  TextItemHandle textHandle=(TextItemHandle)designHandle.findElement("String_Node_Str");
  String aclExp="String_Node_Str";
  textHandle.setACLExpression(aclExp);
  assertEquals(aclExp,textHandle.getACLExpression());
  assertFalse(textHandle.cascadeACL());
  textHandle.setCascadeACL(true);
  assertFalse(textHandle.cascadeACL());
  assertFalse(((Boolean)textHandle.getProperty(IReportItemModel.CASCADE_ACL_PROP)).booleanValue());
  aclExp="String_Node_Str";
  textHandle.setACLExpression(aclExp);
  assertEquals(aclExp,textHandle.getACLExpression());
  aclExp="String_Node_Str";
  textHandle.setACLExpression(aclExp);
  assertEquals(aclExp,textHandle.getACLExpression());
  aclExp="String_Node_Str";
  textHandle.setACLExpression(aclExp);
  assertEquals(aclExp,textHandle.getACLExpression());
}
Program: 72340
Project: 72340
Buggy source:
/** 
 * @param interval
 * @param dataType
 * @param intervalStart
 * @param intervalRange
 * @return
 * @throws DataException
 */
public static ICalculator getGroupCalculator(int interval,int dataType,Object intervalStart,double intervalRange) throws AdapterException {
  if (!isValidInterval(interval,dataType)) {
    return null;
  }
  try {
switch (interval) {
case IGroupDefinition.YEAR_INTERVAL:
      return new YearGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.MONTH_INTERVAL:
    return new MonthGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.QUARTER_INTERVAL:
  return new QuarterGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.WEEK_INTERVAL:
return new WeekGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.DAY_INTERVAL:
return new DayGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.HOUR_INTERVAL:
return new HourGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.MINUTE_INTERVAL:
return new MinuteGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.SECOND_INTERVAL:
return new SecondGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.NUMERIC_INTERVAL:
return new NumericGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.STRING_PREFIX_INTERVAL:
return new StringGroupCalculator(intervalStart,intervalRange);
default :
throw new DataException(ResourceConstants.BAD_GROUP_INTERVAL_INVALID);
}
}
 catch (BirtException be) {
throw new AdapterException(be.getLocalizedMessage());
}
}

Fixed version (ground truth):
/** 
 * @param interval
 * @param dataType
 * @param intervalStart
 * @param intervalRange
 * @return
 * @throws DataException
 */
public static ICalculator getGroupCalculator(int interval,int dataType,Object intervalStart,double intervalRange) throws AdapterException {
  if (!isValidInterval(interval,dataType)) {
    return null;
  }
  try {
switch (interval) {
case IGroupDefinition.YEAR_INTERVAL:
      return new YearGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.MONTH_INTERVAL:
    return new MonthGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.QUARTER_INTERVAL:
  return new QuarterGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.WEEK_INTERVAL:
return new WeekGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.DAY_INTERVAL:
return new DayGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.HOUR_INTERVAL:
return new HourGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.MINUTE_INTERVAL:
return new MinuteGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.SECOND_INTERVAL:
return new SecondGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.NUMERIC_INTERVAL:
return new NumericGroupCalculator(intervalStart,intervalRange);
case IGroupDefinition.STRING_PREFIX_INTERVAL:
return new StringGroupCalculator(intervalStart,intervalRange);
default :
throw new DataException(ResourceConstants.BAD_GROUP_INTERVAL_INVALID);
}
}
 catch (BirtException be) {
throw new AdapterException(be.getLocalizedMessage(),be);
}
}
Program: 72343
Project: 72343
Buggy source:
public Object process(Object d) throws AdapterException {
  try {
    return this.calculator.calculate(d);
  }
 catch (  BirtException e) {
    throw new AdapterException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public Object process(Object d) throws AdapterException {
  try {
    return this.calculator.calculate(d);
  }
 catch (  BirtException e) {
    throw new AdapterException(e.getLocalizedMessage(),e);
  }
}
Program: 72344
Project: 72344
Buggy source:
/** 
 * @param queryDefn
 * @param paramBindingIt
 * @param filterIt
 * @param bindingIt
 * @throws AdapterException 
 */
private void populateQueryDefn(IQueryDefinition queryDefn,Iterator paramBindingIt,Iterator filterIt,Iterator bindingIt,boolean disAllowAggregation) throws AdapterException {
  try {
    while (bindingIt != null && bindingIt.hasNext()) {
      IBinding binding=this.modelAdaptor.adaptBinding((ComputedColumnHandle)bindingIt.next());
      if (disAllowAggregation && binding.getAggrFunction() != null)       continue;
      queryDefn.addBinding(binding);
    }
    List parameterBindings=convertParamterBindings(paramBindingIt);
    if (parameterBindings != null)     queryDefn.getInputParamBindings().addAll(parameterBindings);
    List filters=convertFilters(filterIt);
    if (filters != null)     queryDefn.getFilters().addAll(filters);
  }
 catch (  DataException e) {
    throw new AdapterException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
/** 
 * @param queryDefn
 * @param paramBindingIt
 * @param filterIt
 * @param bindingIt
 * @throws AdapterException 
 */
private void populateQueryDefn(IQueryDefinition queryDefn,Iterator paramBindingIt,Iterator filterIt,Iterator bindingIt,boolean disAllowAggregation) throws AdapterException {
  try {
    while (bindingIt != null && bindingIt.hasNext()) {
      IBinding binding=this.modelAdaptor.adaptBinding((ComputedColumnHandle)bindingIt.next());
      if (disAllowAggregation && binding.getAggrFunction() != null)       continue;
      queryDefn.addBinding(binding);
    }
    List parameterBindings=convertParamterBindings(paramBindingIt);
    if (parameterBindings != null)     queryDefn.getInputParamBindings().addAll(parameterBindings);
    List filters=convertFilters(filterIt);
    if (filters != null)     queryDefn.getFilters().addAll(filters);
  }
 catch (  DataException e) {
    throw new AdapterException(e.getLocalizedMessage(),e);
  }
}
Program: 72345
Project: 72345
Buggy source:
private void outputNamedImageSource(String name,ArrayImageSource imageSource){
  out.println('/' + name + "String_Node_Str");
  int count=outputImageSource(imageSource,"String_Node_Str","String_Node_Str");
  out.print("String_Node_Str" + count + "String_Node_Str");
  out.println(imageSource.getWidth() + "String_Node_Str" + imageSource.getHeight()+ "String_Node_Str");
}

Fixed version (ground truth):
private void outputNamedImageSource(String name,ArrayImageSource imageSource){
  out.println("String_Node_Str");
  outputImageSource(imageSource);
  out.println("String_Node_Str" + name + "String_Node_Str"+ imageSource.getWidth()+ "String_Node_Str"+ imageSource.getHeight()+ "String_Node_Str");
}
Program: 72346
Project: 72346
Buggy source:
private void outputUncachedImage(Image image,float x,float y,float width,float height) throws IOException {
  ArrayImageSource imageSource=getImageSource(image);
  out.print(x + "String_Node_Str" + y+ "String_Node_Str");
  out.print(width + "String_Node_Str" + height+ "String_Node_Str");
  out.print(imageSource.getWidth() + "String_Node_Str" + imageSource.getHeight());
  out.println("String_Node_Str");
  outputUncachedImageSource(imageSource);
  out.println("String_Node_Str");
}

Fixed version (ground truth):
private void outputUncachedImage(Image image,float x,float y,float width,float height) throws IOException {
  ArrayImageSource imageSource=getImageSource(image);
  out.print(x + "String_Node_Str" + y+ "String_Node_Str");
  out.print(width + "String_Node_Str" + height+ "String_Node_Str");
  out.print(imageSource.getWidth() + "String_Node_Str" + imageSource.getHeight());
  out.println("String_Node_Str");
  outputImageSource(imageSource);
  out.println("String_Node_Str");
}