nus-yam/ex-repair huggingface dataset:
Program: 71380
Project: 71380
Buggy source:
/** 
 * @param s
 * @return
 */
private String[] splitOnBreaks(String s,double maxSize){
  List al=new ArrayList();
  int i=0, j;
  do {
    j=s.indexOf('\n',i);
    if (j == -1) {
      j=s.length();
    }
    String ss=s.substring(i,j);
    if (ss != null && ss.length() > 0) {
      al.add(ss);
    }
    i=j + 1;
  }
 while (j != -1 && j < s.length());
  if (maxSize > 0) {
    TextLayout tl=new TextLayout(((SwtDisplayServer)ids).getDevice());
    tl.setFont(getFont());
    tl.setWidth((int)maxSize);
    List nal=new ArrayList();
    for (Iterator itr=al.iterator(); itr.hasNext(); ) {
      String ns=(String)itr.next();
      tl.setText(ns);
      int[] offsets=tl.getLineOffsets();
      String ss;
      for (i=1; i < offsets.length; i++) {
        ss=ns.substring(offsets[i - 1],offsets[i]);
        nal.add(ss);
      }
    }
    tl.dispose();
    al=nal;
  }
  final int n=al.size();
  if (n == 1 || n == 0) {
    return null;
  }
  final String[] sa=new String[n];
  for (i=0; i < al.size(); i++) {
    sa[i]=(String)al.get(i);
  }
  return sa;
}

Fixed version (ground truth):
/** 
 * @param s
 * @return
 */
private String[] splitOnBreaks(String s,double maxSize){
  List<String> al=new ArrayList<String>();
  int i=0, j;
  do {
    j=s.indexOf('\n',i);
    if (j == -1) {
      j=s.length();
    }
    String ss=s.substring(i,j);
    if (ss != null && ss.length() > 0) {
      al.add(ss);
    }
    i=j + 1;
  }
 while (j != -1 && j < s.length());
  if (maxSize > 0) {
    TextLayout tl=new TextLayout(((SwtDisplayServer)ids).getDevice());
    tl.setFont(getFont());
    tl.setWidth((int)maxSize);
    List<String> nal=new ArrayList<String>();
    for (Iterator<String> itr=al.iterator(); itr.hasNext(); ) {
      String ns=(String)itr.next();
      tl.setText(ns);
      int[] offsets=tl.getLineOffsets();
      String ss;
      for (i=1; i < offsets.length; i++) {
        ss=ns.substring(offsets[i - 1],offsets[i]);
        nal.add(ss);
      }
    }
    tl.dispose();
    al=nal;
  }
  final int n=al.size();
  if (n == 1 || n == 0) {
    return null;
  }
  final String[] sa=new String[n];
  for (i=0; i < al.size(); i++) {
    sa[i]=(String)al.get(i);
  }
  return sa;
}
Program: 71382
Project: 71382
Buggy source:
public Point getPoint(int index){
  return (Point)points.get(index);
}

Fixed version (ground truth):
public Point getPoint(int index){
  return points.get(index);
}
Program: 71384
Project: 71384
Buggy source:
public List getPoints(){
  return points;
}

Fixed version (ground truth):
public List<Point> getPoints(){
  return points;
}
Program: 71385
Project: 71385
Buggy source:
public Polygon(){
  points=new ArrayList();
}

Fixed version (ground truth):
public Polygon(){
  points=new ArrayList<Point>();
}
Program: 71386
Project: 71386
Buggy source:
/** 
 * Returns points as Point objects.
 * @return
 */
public final Point[] asPoints(){
  List pts=getPoints();
  return (Point[])pts.toArray(new Point[pts.size()]);
}

Fixed version (ground truth):
/** 
 * Returns points as Point objects.
 * @return
 */
public final Point[] asPoints(){
  List<Point> pts=getPoints();
  return pts.toArray(new Point[pts.size()]);
}
Program: 71387
Project: 71387
Buggy source:
public PrimitiveRenderEvent copy() throws ChartException {
  Area3DRenderEvent are=new Area3DRenderEvent(source);
  if (fill != null) {
    are.setBackground(FillUtil.copyOf(fill));
  }
  if (lia != null) {
    are.setOutline(LineAttributesImpl.copyInstance(lia));
  }
  for (Iterator itr=alLinesAndArcs.iterator(); itr.hasNext(); ) {
    are.add(((PrimitiveRenderEvent)itr.next()).copy());
  }
  return are;
}

Fixed version (ground truth):
public PrimitiveRenderEvent copy() throws ChartException {
  Area3DRenderEvent are=new Area3DRenderEvent(source);
  if (fill != null) {
    are.setBackground(FillUtil.copyOf(fill));
  }
  if (lia != null) {
    are.setOutline(LineAttributesImpl.copyInstance(lia));
  }
  for (Iterator<PrimitiveRenderEvent> itr=alLinesAndArcs.iterator(); itr.hasNext(); ) {
    are.add(((PrimitiveRenderEvent)itr.next()).copy());
  }
  return are;
}
Program: 71388
Project: 71388
Buggy source:
/** 
 * Draws a container's border, and its background color/image if there is any.
 * @param container the containerArea whose border and background need to be drew
 */
protected void drawContainer(IContainerArea container){
  IStyle style=container.getStyle();
  if (null == style) {
    return;
  }
  if (container.getContent() != null) {
    int startX=currentX + getX(container);
    int startY=currentY + getY(container);
    int width=getWidth(container);
    int height=getHeight(container);
    Color bc=PropertyUtil.getColor(style.getProperty(StyleConstants.STYLE_BACKGROUND_COLOR));
    pageGraphic.drawBackgroundColor(bc,startX,startY,width,height);
    drawBackgroundImage(style,startX,startY,width,height);
  }
}

Fixed version (ground truth):
/** 
 * Draws a container's border, and its background color/image if there is any.
 * @param container the containerArea whose border and background need to be drew
 */
protected void drawContainer(IContainerArea container){
  IStyle style=container.getStyle();
  if (null == style) {
    return;
  }
  if (container.getContent() != null) {
    Color bc=PropertyUtil.getColor(style.getProperty(StyleConstants.STYLE_BACKGROUND_COLOR));
    String imageUrl=getBackgroundImageUrl(style);
    if (bc != null || imageUrl != null) {
      int startX=currentX + getX(container);
      int startY=currentY + getY(container);
      int width=getWidth(container);
      int height=getHeight(container);
      if (bc != null) {
        pageGraphic.drawBackgroundColor(bc,startX,startY,width,height);
      }
      if (imageUrl != null) {
        drawBackgroundImage(style,imageUrl,startX,startY,width,height);
      }
    }
  }
}
Program: 71389
Project: 71389
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();
  }
 else {
    if (container instanceof TableArea) {
      drawTableBorder((TableArea)container);
    }
 else     if (!(container instanceof CellArea)) {
      BorderInfo[] borders=cacheBorderInfo(container);
      drawBorder(borders);
    }
    if (container.needClip()) {
      endClip();
    }
  }
}

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 RowArea) {
      rowStyleStack.pop();
    }
    if (container instanceof TableArea) {
      drawTableBorder((TableArea)container);
    }
 else     if (!(container instanceof CellArea)) {
      BorderInfo[] borders=cacheBorderInfo(container);
      drawBorder(borders);
    }
    if (container.needClip()) {
      endClip();
    }
  }
}
Program: 71390
Project: 71390
Buggy source:
/** 
 * 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()) {
    startClip(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()) {
    startClip(container);
  }
  if (container instanceof RowArea) {
    rowStyleStack.push(container.getStyle());
  }
 else   if (container instanceof CellArea) {
    drawCell(container);
  }
 else {
    drawContainer(container);
  }
  currentX+=getX(container);
  currentY+=getY(container);
}
Program: 71391
Project: 71391
Buggy source:
/** 
 * 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);
}

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);
  IStyle style=page.getStyle();
  String imageUrl=getBackgroundImageUrl(style);
  if (imageUrl != null) {
    drawBackgroundImage(style,imageUrl,0,0,pageWidth,pageHeight);
  }
}
Program: 71392
Project: 71392
Buggy source:
/** 
 */
public void testLike(){
  String[] script=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  boolean[] result=new boolean[]{true,true,true,true,true,false,false,false,true,false,true,false};
  for (int i=0; i < script.length; i++) {
    assertTrue(((Boolean)cx.evaluateString(scope,script[i],"String_Node_Str",1,null)).booleanValue() == result[i]);
  }
}

Fixed version (ground truth):
/** 
 */
public void testLike(){
  String[] script=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  boolean[] result=new boolean[]{true,true,true,true,true,false,false,false,true,false,true,false,false};
  for (int i=0; i < script.length; i++) {
    assertTrue(((Boolean)cx.evaluateString(scope,script[i],"String_Node_Str",1,null)).booleanValue() == result[i]);
  }
}
Program: 71393
Project: 71393
Buggy source:
public final double getFullHeight(){
  return getHeight() * getLineCount() + (ins.getTop() + ins.getBottom());
}

Fixed version (ground truth):
@Override public final double getFullHeight(double fontHeight){
  return fontHeight * getLineCount() + ins.getTop() + ins.getBottom();
}
Program: 71394
Project: 71394
Buggy source:
public final double getFullHeight(){
  return getHeight() * getLineCount() + (ins.getTop() + ins.getBottom());
}

Fixed version (ground truth):
@Override public final double getFullHeight(double fontHeight){
  return fontHeight * getLineCount() + ins.getTop() + ins.getBottom();
}
Program: 71395
Project: 71395
Buggy source:
public void drawText(TextRenderEvent tre) throws ChartException {
  String fontName=convertFont(tre.getLabel().getCaption().getFont().getName());
  if (fontName != null) {
    tre.getLabel().getCaption().getFont().setName(fontName);
  }
  iv.modifyEvent(tre);
  if (!tre.getLabel().isVisible())   return;
switch (tre.getAction()) {
case TextRenderEvent.UNDEFINED:
    throw new ChartException(ChartDeviceSwtActivator.ID,ChartException.RENDERING,"String_Node_Str",Messages.getResourceBundle(getULocale()));
case TextRenderEvent.RENDER_SHADOW_AT_LOCATION:
  Location lo=(Location)EcoreUtil.copy(tre.getLocation());
lo.translate(dTranslateX,dTranslateY);
lo.scale(dScale);
_tr.renderShadowAtLocation(this,tre.getTextPosition(),lo,tre.getLabel());
break;
case TextRenderEvent.RENDER_TEXT_AT_LOCATION:
lo=(Location)EcoreUtil.copy(tre.getLocation());
lo.translate(dTranslateX,dTranslateY);
lo.scale(dScale);
_tr.renderTextAtLocation(this,tre.getTextPosition(),lo,tre.getLabel());
break;
case TextRenderEvent.RENDER_TEXT_IN_BLOCK:
final Bounds bo=BoundsImpl.copyInstance(tre.getBlockBounds());
bo.translate(dTranslateX,dTranslateY);
bo.scale(dScale);
_tr.renderTextInBlock(this,bo,tre.getBlockAlignment(),tre.getLabel());
break;
}
}

Fixed version (ground truth):
public void drawText(TextRenderEvent tre) throws ChartException {
  String fontName=convertFont(tre.getLabel().getCaption().getFont().getName());
  if (fontName != null) {
    tre.getLabel().getCaption().getFont().setName(fontName);
  }
  iv.modifyEvent(tre);
  if (!tre.getLabel().isVisible())   return;
switch (tre.getAction()) {
case TextRenderEvent.UNDEFINED:
    throw new ChartException(ChartDeviceSwtActivator.ID,ChartException.RENDERING,"String_Node_Str",Messages.getResourceBundle(getULocale()));
case TextRenderEvent.RENDER_SHADOW_AT_LOCATION:
  Location lo=LocationImpl.copyInstance(tre.getLocation());
lo.translate(dTranslateX,dTranslateY);
lo.scale(dScale);
_tr.renderShadowAtLocation(this,tre.getTextPosition(),lo,tre.getLabel());
break;
case TextRenderEvent.RENDER_TEXT_AT_LOCATION:
lo=LocationImpl.copyInstance(tre.getLocation());
lo.translate(dTranslateX,dTranslateY);
lo.scale(dScale);
_tr.renderTextAtLocation(this,tre.getTextPosition(),lo,tre.getLabel());
break;
case TextRenderEvent.RENDER_TEXT_IN_BLOCK:
final Bounds bo=BoundsImpl.copyInstance(tre.getBlockBounds());
bo.translate(dTranslateX,dTranslateY);
bo.scale(dScale);
_tr.renderTextInBlock(this,bo,tre.getBlockAlignment(),tre.getLabel());
break;
}
}
Program: 71396
Project: 71396
Buggy source:
public final double getFullHeight(){
  return getHeight() * getLineCount() + ins.getTop() + ins.getBottom();
}

Fixed version (ground truth):
@Override public final double getFullHeight(double fontHeight){
  return fontHeight * getLineCount() + ins.getTop() + ins.getBottom();
}
Program: 71397
Project: 71397
Buggy source:
public boolean testLabelVisible(String strNew,Object oPara) throws ChartException ;

Fixed version (ground truth):
public boolean testLabelVisible(String strNew,Object para) throws ChartException {
  la.getCaption().setValue(strNew);
  itm.reuse(la,maxWrappingSize);
  try {
    BoundingBox bb=Methods.computeBox(xs,IConstants.ABOVE,la,0,0);
    return bb.getWidth() <= maxWidth && bb.getHeight() <= maxHeight;
  }
 catch (  IllegalArgumentException uiex) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.RENDERING,uiex);
  }
}
Program: 71398
Project: 71398
Buggy source:
public WrappedInstruction getSharedEdge(I3DRenderEvent event1,I3DRenderEvent event2,double xOffset,double yOffset){
  PrimitiveRenderEvent primEvent=(PrimitiveRenderEvent)event2;
  Fill background=primEvent.getBackground();
  if (!(background instanceof ColorDefinition))   return null;
  ColorDefinition backgroundColor=(ColorDefinition)background;
  Polygon3DRenderEvent sharedPolygonEdge=null;
  WrappedInstruction wi=null;
  Object3D sharedEdgeObject=event1.getObject3D().getSharedEdge(event2.getObject3D());
  if (sharedEdgeObject != null) {
    sharedPolygonEdge=new Polygon3DRenderEvent(primEvent.getSource());
    ColorDefinition sharedBackgroundColor=(ColorDefinition)EcoreUtil.copy(backgroundColor);
    sharedPolygonEdge.setBackground(sharedBackgroundColor);
    if (backgroundColor.isSetTransparency() && backgroundColor.getTransparency() < 255) {
      int t=backgroundColor.getTransparency();
      sharedBackgroundColor.setTransparency(t * t * t / (255 * 255));
    }
    Location[] locations=sharedEdgeObject.getPoints2D(xOffset,yOffset);
    sharedPolygonEdge.setPoints(locations);
    wi=new WrappedInstruction(null,sharedPolygonEdge,PrimitiveRenderEvent.FILL);
  }
  return wi;
}

Fixed version (ground truth):
public WrappedInstruction getSharedEdge(I3DRenderEvent event1,I3DRenderEvent event2,double xOffset,double yOffset){
  PrimitiveRenderEvent primEvent=(PrimitiveRenderEvent)event2;
  Fill background=primEvent.getBackground();
  if (!(background instanceof ColorDefinition))   return null;
  ColorDefinition backgroundColor=(ColorDefinition)background;
  Polygon3DRenderEvent sharedPolygonEdge=null;
  WrappedInstruction wi=null;
  Object3D sharedEdgeObject=event1.getObject3D().getSharedEdge(event2.getObject3D());
  if (sharedEdgeObject != null) {
    sharedPolygonEdge=new Polygon3DRenderEvent(primEvent.getSource());
    ColorDefinition sharedBackgroundColor=(ColorDefinition)FillUtil.copyOf(backgroundColor);
    sharedPolygonEdge.setBackground(sharedBackgroundColor);
    if (backgroundColor.isSetTransparency() && backgroundColor.getTransparency() < 255) {
      int t=backgroundColor.getTransparency();
      sharedBackgroundColor.setTransparency(t * t * t / (255 * 255));
    }
    Location[] locations=sharedEdgeObject.getPoints2D(xOffset,yOffset);
    sharedPolygonEdge.setPoints(locations);
    wi=new WrappedInstruction(null,sharedPolygonEdge,PrimitiveRenderEvent.FILL);
  }
  return wi;
}
Program: 71401
Project: 71401
Buggy source:
/** 
 * Check whether the input aggregation script expression is empty
 * @param aggrInfo
 * @return
 */
private boolean isEmptyAggrArgument(IAggrInfo aggrInfo){
  return aggrInfo.getArgument().length == 0 || aggrInfo.getArgument()[0] == null;
}

Fixed version (ground truth):
/** 
 * Check whether the input aggregation script expression is empty
 * @param aggrInfo
 * @return
 */
private boolean isEmptyAggrArgument(IAggrInfo aggrInfo){
  return aggrInfo.getArgument().length == 0 || aggrInfo.getArgument()[0] == null || ((IScriptExpression)aggrInfo.getArgument()[0]).getText() == null || ((IScriptExpression)aggrInfo.getArgument()[0]).getText().trim().length() == 0;
}
Program: 71402
Project: 71402
Buggy source:
private StyleEntry initStyle(IStyle style,ContainerSizeInfo rule){
  StyleEntry entry=StyleBuilder.createStyleEntry(style);
  if (engine.getContainers().size() > 0) {
    XlsContainer container=engine.getCurrentContainer();
    StyleEntry cEntry=container.getStyle();
    StyleBuilder.mergeInheritableProp(cEntry,entry);
    applyHBorders(cEntry,entry,container.getSizeInfo(),rule);
  }
  return entry;
}

Fixed version (ground truth):
private StyleEntry initStyle(IStyle style,ContainerSizeInfo rule){
  StyleEntry entry=StyleBuilder.createStyleEntry(style);
  ;
  if (!containerStyles.isEmpty()) {
    StyleEntry centry=containerStyles.peek();
    StyleBuilder.mergeInheritableProp(centry,entry);
  }
  if (engine.getContainers().size() > 0) {
    XlsContainer container=engine.getCurrentContainer();
    StyleEntry cEntry=container.getStyle();
    StyleBuilder.mergeInheritableProp(cEntry,entry);
    applyHBorders(cEntry,entry,container.getSizeInfo(),rule);
  }
  return entry;
}
Program: 71403
Project: 71403
Buggy source:
/** 
 * @param queryResults
 * @param queryScope
 * @throws BirtException 
 */
private ResultIterator(QueryResults queryResults,ExprManager exprManager,Scriptable queryScope,Scriptable parentScope) throws BirtException {
  this.queryResults=queryResults;
  this.exprManager=exprManager;
  this.queryScope=queryScope;
  this.jsDummyRowObject=new JSDummyRowObject(exprManager,queryScope,parentScope,session.getEngineContext().getScriptContext());
  queryScope.put("String_Node_Str",queryScope,jsDummyRowObject);
  this.getRdSaveUtil().doSaveStart();
  exprValueMap=new HashMap();
  Map exprMap=getBindingMap(exprManager.getBindingExprs());
  Iterator it=exprMap.entrySet().iterator();
  while (it.hasNext()) {
    Map.Entry entry=(Entry)it.next();
    String exprName=(String)entry.getKey();
    IBaseExpression baseExpr=(IBaseExpression)entry.getValue();
    Object exprValue=ExprEvaluateUtil.evaluateRawExpression(baseExpr,queryScope,session.getEngineContext().getScriptContext());
    exprValueMap.put(exprName,exprValue);
  }
  this.getRdSaveUtil().doSaveExpr(exprValueMap);
}

Fixed version (ground truth):
/** 
 * @param queryResults
 * @param queryScope
 * @throws BirtException 
 */
private ResultIterator(QueryResults queryResults,ExprManager exprManager,Scriptable queryScope,Scriptable parentScope) throws BirtException {
  this.queryResults=queryResults;
  this.exprManager=exprManager;
  this.queryScope=queryScope;
  this.jsDummyRowObject=new JSDummyRowObject(exprManager,queryScope,parentScope,session.getEngineContext().getScriptContext());
  queryScope.put("String_Node_Str",queryScope,jsDummyRowObject);
  this.getRdSaveUtil().doSaveStart();
  exprValueMap=new HashMap();
  Map exprMap=getBindingMap(exprManager.getBindingExprs());
  Iterator it=exprMap.entrySet().iterator();
  while (it.hasNext()) {
    Map.Entry entry=(Entry)it.next();
    String exprName=(String)entry.getKey();
    IBaseExpression baseExpr=(IBaseExpression)entry.getValue();
    Object exprValue=ExprEvaluateUtil.evaluateRawExpression(baseExpr,queryScope,session.getEngineContext().getScriptContext());
    exprValueMap.put(exprName,exprValue);
  }
  this.getRdSaveUtil().doSaveExpr(exprValueMap);
  if (needCache()) {
    try {
      createCacheOutputStream();
      saveMetaData();
      IOUtil.writeInt(this.rowOutputStream,1);
      cacheRow();
    }
 catch (    IOException e) {
      throw new DataException(ResourceConstants.CREATE_CACHE_TEMPFILE_ERROR);
    }
  }
}
Program: 71404
Project: 71404
Buggy source:
public boolean supportsBreakpoint(IBreakpoint breakpoint){
  return breakpoint instanceof ScriptLineBreakpoint && ((ScriptLineBreakpoint)breakpoint).getFileName().equals(getFileName());
}

Fixed version (ground truth):
public boolean supportsBreakpoint(IBreakpoint breakpoint){
  if (!(breakpoint instanceof ScriptLineBreakpoint)) {
    return false;
  }
  String str=((ScriptLineBreakpoint)breakpoint).getFileName();
  if (str == null || str.length() == 0) {
    return false;
  }
  return str.equals(getFileName());
}
Program: 71405
Project: 71405
Buggy source:
/** 
 * Gets the file name.
 * @return
 */
public String getFileName(){
  try {
    return (String)getMarker().getAttribute(FILENAME);
  }
 catch (  CoreException e) {
    logger.warning(e.getMessage());
    throw new Error("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Gets the file name.
 * @return
 */
public String getFileName(){
  try {
    return (String)getMarker().getAttribute(FILENAME);
  }
 catch (  CoreException e) {
    return "String_Node_Str";
  }
}
Program: 71406
Project: 71406
Buggy source:
public ConcreteImageLayout(LayoutEngineContext context,ContainerLayout parentContext,IContent content){
  super(context,parentContext,content);
}

Fixed version (ground truth):
public ConcreteImageLayout(LayoutEngineContext context,ContainerLayout parentContext,IContent content,Image imageObject){
  super(context,parentContext,content);
  this.imageObject=imageObject;
}
Program: 71408
Project: 71408
Buggy source:
protected Dimension getSpecifiedDimension(IImageContent content,int pWidth,boolean scale){
  Dimension dim=new Dimension(DEFAULT_WIDHT,DEFAULT_HEIGHT);
  try {
    intrinsic=getIntrinsicDimension(content);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,e.getLocalizedMessage());
  }
  int specifiedWidth=getDimensionValue(content.getWidth(),pWidth);
  int specifiedHeight=getDimensionValue(content.getHeight());
  if (intrinsic == null) {
    dim.setDimension(specifiedWidth == 0 ? DEFAULT_WIDHT : specifiedWidth,specifiedHeight == 0 ? DEFAULT_HEIGHT : specifiedHeight);
    return dim;
  }
  if (scale) {
    double ratio=intrinsic.getRatio();
    if (specifiedWidth > 0) {
      if (specifiedHeight > 0) {
        dim.setDimension(specifiedWidth,specifiedHeight);
      }
 else {
        dim.setDimension(specifiedWidth,(int)(specifiedWidth / ratio));
      }
    }
 else {
      if (specifiedHeight > 0) {
        dim.setDimension((int)(specifiedHeight * ratio),specifiedHeight);
      }
 else {
        dim.setDimension(intrinsic.getWidth(),intrinsic.getHeight());
      }
    }
  }
 else {
    if (specifiedWidth > 0) {
      if (specifiedHeight > 0) {
        dim.setDimension(specifiedWidth,specifiedHeight);
      }
 else {
        dim.setDimension(specifiedWidth,intrinsic.getHeight());
      }
    }
 else {
      if (specifiedHeight > 0) {
        dim.setDimension(intrinsic.getWidth(),specifiedHeight);
      }
 else {
        dim.setDimension(intrinsic.getWidth(),intrinsic.getHeight());
      }
    }
  }
  return dim;
}

Fixed version (ground truth):
protected Dimension getSpecifiedDimension(IImageContent content,int pWidth,boolean scale){
  Dimension dim=new Dimension(DEFAULT_WIDHT,DEFAULT_HEIGHT);
  try {
    intrinsic=getIntrinsicDimension(content,imageObject);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,e.getLocalizedMessage());
  }
  int specifiedWidth=getDimensionValue(content.getWidth(),pWidth);
  int specifiedHeight=getDimensionValue(content.getHeight());
  if (intrinsic == null) {
    dim.setDimension(specifiedWidth == 0 ? DEFAULT_WIDHT : specifiedWidth,specifiedHeight == 0 ? DEFAULT_HEIGHT : specifiedHeight);
    return dim;
  }
  if (scale) {
    double ratio=intrinsic.getRatio();
    if (specifiedWidth > 0) {
      if (specifiedHeight > 0) {
        dim.setDimension(specifiedWidth,specifiedHeight);
      }
 else {
        dim.setDimension(specifiedWidth,(int)(specifiedWidth / ratio));
      }
    }
 else {
      if (specifiedHeight > 0) {
        dim.setDimension((int)(specifiedHeight * ratio),specifiedHeight);
      }
 else {
        dim.setDimension(intrinsic.getWidth(),intrinsic.getHeight());
      }
    }
  }
 else {
    if (specifiedWidth > 0) {
      if (specifiedHeight > 0) {
        dim.setDimension(specifiedWidth,specifiedHeight);
      }
 else {
        dim.setDimension(specifiedWidth,intrinsic.getHeight());
      }
    }
 else {
      if (specifiedHeight > 0) {
        dim.setDimension(intrinsic.getWidth(),specifiedHeight);
      }
 else {
        dim.setDimension(intrinsic.getWidth(),intrinsic.getHeight());
      }
    }
  }
  return dim;
}
Program: 71409
Project: 71409
Buggy source:
protected void createActions(){
  super.createActions();
  IAction contentAssistAction=new TextOperationAction(Messages.getReportResourceBundle(),"String_Node_Str",this,ISourceViewer.CONTENTASSIST_PROPOSALS,true);
  IAction expandAll=new TextOperationAction(Messages.getReportResourceBundle(),"String_Node_Str",this,ProjectionViewer.EXPAND_ALL,true);
  IAction collapseAll=new TextOperationAction(Messages.getReportResourceBundle(),"String_Node_Str",this,ProjectionViewer.COLLAPSE_ALL,true);
  IAction collapseComments=new ResourceAction(Messages.getReportResourceBundle(),"String_Node_Str"){
    public void run(){
      collapseStyle(ScriptProjectionAnnotation.SCRIPT_COMMENT);
    }
  }
;
  IAction collapseMethods=new ResourceAction(Messages.getReportResourceBundle(),"String_Node_Str"){
    public void run(){
      collapseStyle(ScriptProjectionAnnotation.SCRIPT_METHOD);
    }
  }
;
  contentAssistAction.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
  expandAll.setActionDefinitionId(IFoldingCommandIds.FOLDING_EXPAND_ALL);
  collapseAll.setActionDefinitionId(IFoldingCommandIds.FOLDING_COLLAPSE_ALL);
  setAction("String_Node_Str",contentAssistAction);
  setAction("String_Node_Str",expandAll);
  setAction("String_Node_Str",collapseAll);
  setAction("String_Node_Str",collapseComments);
  setAction("String_Node_Str",collapseMethods);
}

Fixed version (ground truth):
protected void createActions(){
  super.createActions();
  IAction contentAssistAction=new TextOperationAction(Messages.getReportResourceBundle(),"String_Node_Str",this,ISourceViewer.CONTENTASSIST_PROPOSALS,true);
  IAction expandAll=new TextOperationAction(Messages.getReportResourceBundle(),"String_Node_Str",this,ProjectionViewer.EXPAND_ALL,true);
  IAction collapseAll=new TextOperationAction(Messages.getReportResourceBundle(),"String_Node_Str",this,ProjectionViewer.COLLAPSE_ALL,true);
  IAction collapseComments=new ResourceAction(Messages.getReportResourceBundle(),"String_Node_Str"){
    public void run(){
      collapseStyle(ScriptProjectionAnnotation.SCRIPT_COMMENT);
    }
  }
;
  IAction collapseMethods=new ResourceAction(Messages.getReportResourceBundle(),"String_Node_Str"){
    public void run(){
      collapseStyle(ScriptProjectionAnnotation.SCRIPT_METHOD);
    }
  }
;
  contentAssistAction.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
  expandAll.setActionDefinitionId(IFoldingCommandIds.FOLDING_EXPAND_ALL);
  collapseAll.setActionDefinitionId(IFoldingCommandIds.FOLDING_COLLAPSE_ALL);
  setAction("String_Node_Str",contentAssistAction);
  setAction("String_Node_Str",expandAll);
  setAction("String_Node_Str",collapseAll);
  setAction("String_Node_Str",collapseComments);
  setAction("String_Node_Str",collapseMethods);
  setAction(ITextEditorActionConstants.SAVE,new TextSaveAction(this));
}
Program: 71410
Project: 71410
Buggy source:
public void init(IEditorSite site,final IEditorInput input) throws PartInitException {
  super.init(site,input);
  try {
    reportXMLEditor=new StructuredTextEditor(){
      @Override public void doSave(      IProgressMonitor progressMonitor){
        super.doSave(progressMonitor);
        clearDirtyFlag();
        try {
          getReportEditor().refreshMarkers(input);
        }
 catch (        CoreException e) {
        }
      }
    }
;
    reportXMLEditor.init(site,input);
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
public void init(IEditorSite site,final IEditorInput input) throws PartInitException {
  super.init(site,input);
  try {
    reportXMLEditor=new StructuredTextEditor(){
      @Override protected void createActions(){
        super.createActions();
        setAction(ITextEditorActionConstants.SAVE,new TextSaveAction(this));
      }
      @Override public void doSave(      IProgressMonitor progressMonitor){
        super.doSave(progressMonitor);
        clearDirtyFlag();
        try {
          getReportEditor().refreshMarkers(input);
        }
 catch (        CoreException e) {
        }
      }
    }
;
    reportXMLEditor.init(site,input);
  }
 catch (  Exception e) {
  }
}
Program: 71411
Project: 71411
Buggy source:
protected void createActions(){
  super.createActions();
  IAction contentAssistAction=new TextOperationAction(Messages.getReportResourceBundle(),"String_Node_Str",this,ISourceViewer.CONTENTASSIST_PROPOSALS,true);
  contentAssistAction.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
  setAction("String_Node_Str",contentAssistAction);
}

Fixed version (ground truth):
protected void createActions(){
  super.createActions();
  IAction contentAssistAction=new TextOperationAction(Messages.getReportResourceBundle(),"String_Node_Str",this,ISourceViewer.CONTENTASSIST_PROPOSALS,true);
  contentAssistAction.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
  setAction("String_Node_Str",contentAssistAction);
  setAction(ITextEditorActionConstants.SAVE,new TextSaveAction(this));
}
Program: 71412
Project: 71412
Buggy source:
/** 
 * Since this query is running based on the data set, the old things stored in report document is no more use, and it will be safter if they are all removed.
 * @throws DataException
 */
private void cleanUpOldRD() throws DataException {
  if (true)   return;
  String basedID=this.queryDefn.getQueryResultsID();
  String _1partID=QueryResultIDUtil.get1PartID(basedID);
  if (_1partID != null)   basedID=_1partID;
  StreamManager streamManager=new StreamManager(engine.getContext(),new QueryResultInfo(queryDefn.getQueryResultsID(),null,0));
  streamManager.dropStream1(DataEngineContext.EXPR_VALUE_STREAM);
  streamManager.dropStream1(DataEngineContext.EXPR_ROWLEN_STREAM);
  QueryResultIDManager.cleanChildOfRoot(streamManager);
  streamManager.dropStream1(DataEngineContext.META_STREAM);
  streamManager.dropStream1(DataEngineContext.META_INDEX_STREAM);
}

Fixed version (ground truth):
/** 
 * Since this query is running based on the data set, the old things stored in report document is no more use, and it will be safter if they are all removed.
 * @throws DataException
 */
private void cleanUpOldRD() throws DataException {
  String basedID=this.queryDefn.getQueryResultsID();
  String _1partID=QueryResultIDUtil.get1PartID(basedID);
  if (_1partID != null)   basedID=_1partID;
  StreamManager streamManager=new StreamManager(engine.getContext(),new QueryResultInfo(queryDefn.getQueryResultsID(),null,0));
  streamManager.dropStream1(DataEngineContext.EXPR_VALUE_STREAM);
  streamManager.dropStream1(DataEngineContext.EXPR_ROWLEN_STREAM);
  QueryResultIDManager.cleanChildOfRoot(streamManager);
  streamManager.dropStream1(DataEngineContext.META_STREAM);
  streamManager.dropStream1(DataEngineContext.META_INDEX_STREAM);
}
Program: 71414
Project: 71414
Buggy source:
/** 
 * @param imageName
 * @param imageTitle
 * @param width
 * @param height
 * @param x
 * @param y
 */
private void exportImageDefn(String imageName,String imageTitle,double width,double height,double x,double y){
  println("String_Node_Str" + (shapeCount) + "String_Node_Str");
  println("String_Node_Str" + x + "String_Node_Str"+ y+ "String_Node_Str"+ width+ "String_Node_Str"+ height+ "String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str" + imageName + "String_Node_Str"+ imageTitle+ "String_Node_Str");
  println("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param imageName
 * @param imageTitle
 * @param width
 * @param height
 * @param x
 * @param y
 */
private void exportImageDefn(String imageName,String imageTitle,double width,double height,double x,double y,String link){
  println("String_Node_Str" + (shapeCount) + "String_Node_Str");
  if (link != null) {
    print("String_Node_Str" + link + "String_Node_Str");
  }
  println("String_Node_Str" + x + "String_Node_Str"+ y+ "String_Node_Str"+ width+ "String_Node_Str"+ height+ "String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str" + imageName + "String_Node_Str"+ imageTitle+ "String_Node_Str");
  println("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  println("String_Node_Str");
}
Program: 71417
Project: 71417
Buggy source:
public void drawImage(String imageId,byte[] imageData,String extension,float imageX,float imageY,float height,float width,String helpText) throws Exception {
  ImageInfo imageInfo=getImageInfo(imageId,imageData,extension);
  exportImageDefn(imageInfo.imageName,imageInfo.imageId,width,height,imageX,imageY);
}

Fixed version (ground truth):
public void drawImage(String imageId,byte[] imageData,String extension,float imageX,float imageY,float height,float width,String helpText,String link) throws Exception {
  ImageInfo imageInfo=getImageInfo(imageId,imageData,extension);
  exportImageDefn(imageInfo.imageName,imageInfo.imageId,width,height,imageX,imageY,link);
}
Program: 71418
Project: 71418
Buggy source:
protected void drawText(String text,float textX,float textY,float baseline,float width,float height,TextStyle textStyle){
  writer.drawText(text,textX,textY,width + 1f,height,textStyle.getFontInfo(),textStyle.getColor(),textStyle.isRtl());
}

Fixed version (ground truth):
protected void drawText(String text,float textX,float textY,float baseline,float width,float height,TextStyle textStyle){
  writer.drawText(text,textX,textY,width + 1f,height,textStyle.getFontInfo(),textStyle.getColor(),textStyle.isRtl(),link);
}
Program: 71419
Project: 71419
Buggy source:
public Object getSummaryValue(){
  if (values == null) {
    return null;
  }
  StringBuffer buffer=new StringBuffer();
  Iterator<String> valueIterator=values.iterator();
  while (valueIterator.hasNext()) {
    String currentValue=valueIterator.next();
    if (buffer.length() > this.maxLength - currentValue.length()) {
      break;
    }
    if (currentValue != null && currentValue.trim().length() > 0) {
      buffer.append(currentValue).append(separator);
    }
  }
  if (buffer.length() > 0) {
    buffer.deleteCharAt(buffer.length() - 1);
  }
  return buffer.toString();
}

Fixed version (ground truth):
public Object getSummaryValue(){
  if (values == null) {
    return null;
  }
  StringBuffer buffer=new StringBuffer();
  Iterator<String> valueIterator=values.iterator();
  while (valueIterator.hasNext()) {
    String currentValue=valueIterator.next();
    if (buffer.length() > this.maxLength - currentValue.length()) {
      break;
    }
    if (currentValue != null && currentValue.trim().length() > 0) {
      buffer.append(currentValue).append(separator);
    }
  }
  if (buffer.length() > 0) {
    return buffer.toString().substring(0,buffer.length() - separator.length());
  }
  return buffer.toString();
}
Program: 71421
Project: 71421
Buggy source:
public void startData(IDataContent data){
  super.startData(data);
  HyperlinkDef url=parseHyperLink(data);
  BookmarkDef bookmark=getBookmark(data);
  if (((StyledElementDesign)data.getGenerateBy()).getMap() != null && ((StyledElementDesign)data.getGenerateBy()).getMap().getRuleCount() > 0 && data.getLabelText() != null) {
    engine.addData(data.getLabelText().trim(),data.getComputedStyle(),url,bookmark);
  }
 else   if (ExcelUtil.getType(data.getValue()).equals(Data.STRING)) {
    engine.addData(data.getText(),data.getComputedStyle(),url,bookmark);
  }
 else   if (!ExcelUtil.getType(data.getValue()).equals(Data.NUMBER)) {
    engine.addDateTime(data,data.getComputedStyle(),url,bookmark);
  }
 else {
    engine.addData(data.getValue(),data.getComputedStyle(),url,bookmark);
  }
}

Fixed version (ground truth):
public void startData(IDataContent data){
  HyperlinkDef url=parseHyperLink(data);
  BookmarkDef bookmark=getBookmark(data);
  if (((StyledElementDesign)data.getGenerateBy()).getMap() != null && ((StyledElementDesign)data.getGenerateBy()).getMap().getRuleCount() > 0 && data.getLabelText() != null) {
    engine.addData(data.getLabelText().trim(),data.getComputedStyle(),url,bookmark);
  }
 else   if (ExcelUtil.getType(data.getValue()).equals(Data.STRING)) {
    engine.addData(data.getText(),data.getComputedStyle(),url,bookmark);
  }
 else   if (!ExcelUtil.getType(data.getValue()).equals(Data.NUMBER)) {
    engine.addDateTime(data,data.getComputedStyle(),url,bookmark);
  }
 else {
    engine.addData(data.getValue(),data.getComputedStyle(),url,bookmark);
  }
}
Program: 71423
Project: 71423
Buggy source:
public void startText(ITextContent text){
}

Fixed version (ground truth):
public void startText(ITextContent text){
  HyperlinkDef url=parseHyperLink(text);
  BookmarkDef bookmark=getBookmark(text);
  engine.addData(text.getText(),text.getComputedStyle(),url,bookmark);
}
Program: 71424
Project: 71424
Buggy source:
/** 
 * Get the evaluated result by the ScriptExpression
 * @param aggrIndex
 * @param aggrInfo
 * @param i
 * @throws DataException
 */
private void evaluateArgsValue(int aggrIndex,IAggrInfo aggrInfo,int i) throws DataException {
  if (i >= aggrInfo.getArgument().length) {
    return;
  }
  IBaseExpression argExpr=aggrInfo.getArgument()[i];
  checkExpression(aggrInfo,argExpr);
  try {
    aggrArgs[aggrIndex][i]=ExprEvaluateUtil.evaluateValue(argExpr,this.populator.getCache().getCurrentIndex(),this.populator.getCache().getCurrentResult(),this.populator.getQuery().getExprProcessor().getScope(),this.populator.getSession().getEngineContext().getScriptContext());
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}

Fixed version (ground truth):
/** 
 * Get the evaluated result by the ScriptExpression
 * @param aggrIndex
 * @param aggrInfo
 * @param i
 * @throws DataException
 */
private void evaluateArgsValue(int aggrIndex,IAggrInfo aggrInfo,int i,boolean isOptional) throws DataException {
  if (i >= aggrInfo.getArgument().length) {
    return;
  }
  IBaseExpression argExpr=aggrInfo.getArgument()[i];
  if (!isOptional) {
    checkExpression(aggrInfo,argExpr);
  }
 else   if (argExpr == null || ((IScriptExpression)argExpr).getText() == null || ((IScriptExpression)argExpr).getText().trim().length() == 0) {
    aggrArgs[aggrIndex][i]=null;
    return;
  }
  try {
    aggrArgs[aggrIndex][i]=ExprEvaluateUtil.evaluateValue(argExpr,this.populator.getCache().getCurrentIndex(),this.populator.getCache().getCurrentResult(),this.populator.getQuery().getExprProcessor().getScope(),this.populator.getSession().getEngineContext().getScriptContext());
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}
Program: 71425
Project: 71425
Buggy source:
/** 
 * Check whether the input aggregation script expression is empty
 * @param aggrInfo
 * @return
 */
private boolean isEmptyScriptExpression(IAggrInfo aggrInfo){
  return aggrInfo.getArgument().length == 0 || aggrInfo.getArgument()[0] == null || ((IScriptExpression)aggrInfo.getArgument()[0]).getText() == null;
}

Fixed version (ground truth):
/** 
 * Checks whether the ScriptExpression has empty expression text
 * @param argExpr
 * @return
 */
private boolean isEmptyScriptExpression(IBaseExpression argExpr){
  IScriptExpression expr=(IScriptExpression)argExpr;
  return expr == null || expr.getText() == null || expr.getText().trim().length() == 0;
}
Program: 71427
Project: 71427
Buggy source:
/** 
 * @param aggrInfo
 * @param argExpr
 * @throws DataException
 */
private void checkExpression(IAggrInfo aggrInfo,IBaseExpression argExpr) throws DataException {
  if (!isFunctionCount(aggrInfo)) {
    IScriptExpression expr=(IScriptExpression)argExpr;
    if (expr == null || expr.getText() == null || "String_Node_Str".equals(expr.getText().trim())) {
      throw new DataException(ResourceConstants.EXPRESSION_CANNOT_BE_NULL_OR_BLANK);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param aggrInfo
 * @param argExpr
 * @throws DataException
 */
private void checkExpression(IAggrInfo aggrInfo,IBaseExpression argExpr) throws DataException {
  if (!isFunctionCount(aggrInfo) && isEmptyScriptExpression(argExpr)) {
    throw new DataException(ResourceConstants.EXPRESSION_CANNOT_BE_NULL_OR_BLANK);
  }
}
Program: 71428
Project: 71428
Buggy source:
protected void addColumBinding(IBaseQueryDefinition transfer,ComputedColumnHandle columnBinding) throws BirtException {
  String name=columnBinding.getName();
  String expr=columnBinding.getExpression();
  String type=columnBinding.getDataType();
  String displayName=columnBinding.getDisplayName();
  String aggregateOn=columnBinding.getAggregateOn();
  int dbType=ModelDteApiAdapter.toDteDataType(type);
  IBaseExpression dbExpr=null;
  if (expr != null) {
    dbExpr=new ScriptExpression(expr,dbType);
    if (aggregateOn != null) {
      dbExpr.setGroupName(aggregateOn);
    }
  }
  IBinding binding=new Binding(name,dbExpr);
  binding.setDisplayName(displayName);
  if (aggregateOn != null) {
    binding.addAggregateOn(aggregateOn);
  }
  if (columnBinding.getAggregateFunction() != null) {
    binding.setAggrFunction(DataAdapterUtil.adaptModelAggregationType(columnBinding.getAggregateFunction()));
  }
  String filter=columnBinding.getFilterExpression();
  if (filter != null) {
    binding.setFilter(new ScriptExpression(filter));
  }
  Iterator arguments=columnBinding.argumentsIterator();
  if (arguments != null) {
    while (arguments.hasNext()) {
      AggregationArgumentHandle argumentHandle=(AggregationArgumentHandle)arguments.next();
      String argument=argumentHandle.getValue();
      if (argument != null) {
        binding.addArgument(DataAdapterUtil.adaptArgumentName(argumentHandle.getName()),new ScriptExpression(argument));
      }
    }
  }
  binding.setDataType(dbType);
  transfer.addBinding(binding);
}

Fixed version (ground truth):
protected void addColumBinding(IBaseQueryDefinition transfer,ComputedColumnHandle columnBinding) throws BirtException {
  String name=columnBinding.getName();
  String expr=columnBinding.getExpression();
  String type=columnBinding.getDataType();
  String displayName=columnBinding.getDisplayName();
  String aggregateOn=columnBinding.getAggregateOn();
  int dbType=ModelDteApiAdapter.toDteDataType(type);
  IBaseExpression dbExpr=null;
  if (expr != null) {
    dbExpr=new ScriptExpression(expr,dbType);
    if (aggregateOn != null) {
      dbExpr.setGroupName(aggregateOn);
    }
  }
  IBinding binding=new Binding(name,dbExpr);
  binding.setDisplayName(displayName);
  if (aggregateOn != null) {
    binding.addAggregateOn(aggregateOn);
  }
  if (columnBinding.getAggregateFunction() != null) {
    binding.setAggrFunction(DataAdapterUtil.adaptModelAggregationType(columnBinding.getAggregateFunction()));
  }
  String filter=columnBinding.getFilterExpression();
  if (filter != null) {
    binding.setFilter(new ScriptExpression(filter));
  }
  Iterator arguments=columnBinding.argumentsIterator();
  if (arguments != null) {
    while (arguments.hasNext()) {
      AggregationArgumentHandle argumentHandle=(AggregationArgumentHandle)arguments.next();
      String argument=argumentHandle.getValue();
      binding.addArgument(DataAdapterUtil.adaptArgumentName(argumentHandle.getName()),new ScriptExpression(argument));
    }
  }
  binding.setDataType(dbType);
  transfer.addBinding(binding);
}
Program: 71429
Project: 71429
Buggy source:
/** 
 * @param resultBindingList
 * @param bindingCollection
 * @throws DataException 
 */
protected static void addQueryBindings(List<IBinding> resultBindingList,Collection bindingCollection) throws DataException {
  Iterator bindingIterator=bindingCollection.iterator();
  while (bindingIterator.hasNext()) {
    IBinding binding=(IBinding)(bindingIterator.next());
    IBaseExpression expr=binding.getExpression();
    if (expr instanceof IScriptExpression && !ExpressionUtil.hasAggregation(((IScriptExpression)expr).getText())) {
      resultBindingList.add(binding);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param resultBindingList
 * @param bindingCollection
 * @throws DataException 
 */
protected static void addQueryBindings(List<IBinding> resultBindingList,Collection bindingCollection) throws DataException {
  Iterator bindingIterator=bindingCollection.iterator();
  while (bindingIterator.hasNext()) {
    IBinding binding=(IBinding)(bindingIterator.next());
    IBaseExpression expr=binding.getExpression();
    if (expr instanceof IScriptExpression && !ExpressionUtil.hasAggregation(((IScriptExpression)expr).getText())) {
      boolean exist=false;
      for (int i=0; i < resultBindingList.size(); i++) {
        if (resultBindingList.get(i) != null && resultBindingList.get(i).getBindingName().equals(binding.getBindingName())) {
          exist=true;
        }
      }
      if (!exist)       resultBindingList.add(binding);
    }
  }
}
Program: 71431
Project: 71431
Buggy source:
/** 
 * @param dataEngine
 * @param queryDefn
 * @throws DataException
 */
PreparedIVDataSourceQuery(DataEngineImpl dataEngine,IQueryDefinition queryDefn) throws DataException {
  super(dataEngine,PLSUtil.isPLSEnabled(queryDefn) ? PLSUtil.populateBindings(queryDefn) : queryDefn,null,null);
  Object[] params={dataEngine,queryDefn};
  logger.entering(PreparedIVDataSourceQuery.class.getName(),"String_Node_Str",params);
  this.queryDefn=queryDefn;
  this.engine=dataEngine;
  logger.exiting(PreparedIVDataSourceQuery.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param dataEngine
 * @param queryDefn
 * @throws DataException
 */
PreparedIVDataSourceQuery(DataEngineImpl dataEngine,IQueryDefinition queryDefn) throws DataException {
  super(dataEngine,PLSUtil.isPLSEnabled(queryDefn) ? PLSUtil.populateBindings(queryDefn) : queryDefn,null,null);
  Object[] params={dataEngine,queryDefn};
  logger.entering(PreparedIVDataSourceQuery.class.getName(),"String_Node_Str",params);
  this.queryDefn=queryDefn;
  this.engine=dataEngine;
  if (!PLSUtil.isPLSEnabled(queryDefn))   cleanUpOldRD();
  logger.exiting(PreparedIVDataSourceQuery.class.getName(),"String_Node_Str");
}
Program: 71433
Project: 71433
Buggy source:
/** 
 * Since this query is running based on the data set, the old things stored in report document is no more use, and it will be safter if they are all removed.
 * @throws DataException
 */
protected QueryExecutor newExecutor(){
  return new IVDataSourceExecutor(engine.getSession().getSharedScope(),queryDefn,this.preparedQuery.getAggrTable());
}

Fixed version (ground truth):
protected QueryExecutor newExecutor(){
  return new IVDataSourceExecutor(engine.getSession().getSharedScope(),queryDefn,this.preparedQuery.getAggrTable());
}