nus-yam/ex-repair huggingface dataset:
Program: 68528
Project: 68528
Buggy source:
private Location[] computeRiserTriangle2D(boolean bInverted,int i,double[] faX,double[] faY,double dX,double dY,double dHeight,double dWidth){
  Location[] loaFrontFace=new Location[3];
  if (isTransposed()) {
    final double dX1=bInverted ? dX : dX + dWidth;
    final double dX2=bInverted ? dX + dWidth : dX;
    loaFrontFace[0]=goFactory.createLocation(dX1,dY + dHeight);
    loaFrontFace[1]=goFactory.createLocation(dX2,dY + dHeight / 2);
    loaFrontFace[2]=goFactory.createLocation(dX1,dY);
    faX[i]=dX2;
    faY[i]=(dY + dHeight / 2);
  }
 else {
    final double dY1=bInverted ? dY : dY + dHeight;
    final double dY2=bInverted ? dY + dHeight : dY;
    loaFrontFace[0]=goFactory.createLocation(dX,dY1);
    loaFrontFace[1]=goFactory.createLocation(dX + dWidth / 2,dY2);
    loaFrontFace[2]=goFactory.createLocation(dX + dWidth,dY1);
    faX[i]=(dX + dWidth / 2);
    faY[i]=(dY2);
  }
  return loaFrontFace;
}

Fixed version (ground truth):
private Location[] computeRiserTriangle2D(boolean bInverted,int i,double[] faX,double[] faY,double dX,double dY,double dHeight,double dWidth){
  Location[] loaFrontFace=new Location[3];
  dX=Math.round(dX);
  dY=Math.round(dY);
  dWidth=Math.round(dWidth);
  dHeight=Math.round(dHeight);
  if (isTransposed()) {
    final double dX1=bInverted ? dX : dX + dWidth;
    final double dX2=bInverted ? dX + dWidth : dX;
    loaFrontFace[0]=goFactory.createLocation(dX1,dY + dHeight);
    loaFrontFace[1]=goFactory.createLocation(dX2,dY + dHeight / 2);
    loaFrontFace[2]=goFactory.createLocation(dX1,dY);
    faX[i]=dX2;
    faY[i]=(dY + dHeight / 2);
  }
 else {
    final double dY1=bInverted ? dY : dY + dHeight;
    final double dY2=bInverted ? dY + dHeight : dY;
    loaFrontFace[0]=goFactory.createLocation(dX,dY1);
    loaFrontFace[1]=goFactory.createLocation(dX + dWidth / 2,dY2);
    loaFrontFace[2]=goFactory.createLocation(dX + dWidth,dY1);
    faX[i]=(dX + dWidth / 2);
    faY[i]=(dY2);
  }
  return loaFrontFace;
}
Program: 68529
Project: 68529
Buggy source:
private Location[] computeRiserCone2D(boolean bInverted,int i,double[] faX,double[] faY,double dX,double dY,double dHeight,double dWidth){
  Location[] loaFrontFace=new Location[3];
  if (isTransposed()) {
    final double dX1=bInverted ? dX : dX + dWidth;
    final double dX2=bInverted ? dX + dWidth : dX;
    loaFrontFace[0]=goFactory.createLocation(dX1,dY);
    loaFrontFace[1]=goFactory.createLocation(dX2,dY + dHeight / 2);
    loaFrontFace[2]=goFactory.createLocation(dX1,dY + dHeight);
    faX[i]=dX2;
    faY[i]=(dY + dHeight / 2);
  }
 else {
    final double dY1=bInverted ? dY : dY + dHeight;
    final double dY2=bInverted ? dY + dHeight : dY;
    loaFrontFace[0]=goFactory.createLocation(dX,dY1);
    loaFrontFace[1]=goFactory.createLocation(dX + dWidth / 2,dY2);
    loaFrontFace[2]=goFactory.createLocation(dX + dWidth,dY1);
    faX[i]=(dX + dWidth / 2);
    faY[i]=(dY2);
  }
  return loaFrontFace;
}

Fixed version (ground truth):
private Location[] computeRiserCone2D(boolean bInverted,int i,double[] faX,double[] faY,double dX,double dY,double dHeight,double dWidth){
  Location[] loaFrontFace=new Location[3];
  dX=Math.round(dX);
  dY=Math.round(dY);
  dWidth=Math.round(dWidth);
  dHeight=Math.round(dHeight);
  if (isTransposed()) {
    final double dX1=bInverted ? dX : dX + dWidth;
    final double dX2=bInverted ? dX + dWidth : dX;
    loaFrontFace[0]=goFactory.createLocation(dX1,dY);
    loaFrontFace[1]=goFactory.createLocation(dX2,dY + dHeight / 2);
    loaFrontFace[2]=goFactory.createLocation(dX1,dY + dHeight);
    faX[i]=dX2;
    faY[i]=(dY + dHeight / 2);
  }
 else {
    final double dY1=bInverted ? dY : dY + dHeight;
    final double dY2=bInverted ? dY + dHeight : dY;
    loaFrontFace[0]=goFactory.createLocation(dX,dY1);
    loaFrontFace[1]=goFactory.createLocation(dX + dWidth / 2,dY2);
    loaFrontFace[2]=goFactory.createLocation(dX + dWidth,dY1);
    faX[i]=(dX + dWidth / 2);
    faY[i]=(dY2);
  }
  return loaFrontFace;
}
Program: 68537
Project: 68537
Buggy source:
/** 
 * Restores the clipping
 * @param ipr
 * @throws ChartException
 */
protected void restoreClipping(final IPrimitiveRenderer ipr) throws ChartException {
  final boolean bLastInSequence=isLastVisibleSeries();
  if (bLastInSequence && !isDimension3D() && (!isShowOutside() || !baseIsShowOutside())) {
    flushClipping();
    ClipRenderEvent clip=new ClipRenderEvent(this);
    clip.setVertices(null);
    ipr.setClip(clip);
  }
}

Fixed version (ground truth):
/** 
 * Restores the clipping
 * @param ipr
 * @throws ChartException
 */
protected void restoreClipping(final IPrimitiveRenderer ipr) throws ChartException {
  final boolean bLastInSequence=iSeriesIndex == (iSeriesCount - 1);
  if (bLastInSequence && !isDimension3D() && (!isShowOutside() || !baseIsShowOutside())) {
    flushClipping();
    ClipRenderEvent clip=new ClipRenderEvent(this);
    clip.setVertices(null);
    ipr.setClip(clip);
  }
}
Program: 68538
Project: 68538
Buggy source:
/** 
 * re-create URLClassLoader to reload class by URLs.
 */
public void reload(){
  this.loader=new URLClassLoader(this.urls,this.parent);
}

Fixed version (ground truth):
/** 
 * re-create URLClassLoader to reload class by URLs.
 */
public void reload(){
  if (this.loader != null) {
    this.loader.close();
  }
  this.loader=new URLClassLoader(this.urls,this.parent);
}
Program: 68542
Project: 68542
Buggy source:
public int compare(double[] l1,double[] l2){
  if (sortFirstArray) {
    if (l1[0] == l2[0]) {
      return 0;
    }
    if (l1[0] < l2[0]) {
      return -1;
    }
  }
 else {
    if (l1[1] == l2[1]) {
      return 0;
    }
    if (l1[1] < l2[1]) {
      return -1;
    }
  }
  return 1;
}

Fixed version (ground truth):
public int compare(double[] l1,double[] l2){
  if (l1[0] == l2[0]) {
    return 0;
  }
  if (l1[0] < l2[0]) {
    return -1;
  }
  return 1;
}
Program: 68543
Project: 68543
Buggy source:
private void sort(double[] a,double[] b,final boolean sortFirstArray){
  double[][] sa=new double[a.length][2];
  for (int i=0; i < a.length; i++) {
    double[] ca=new double[2];
    ca[0]=a[i];
    ca[1]=b[i];
    sa[i]=ca;
  }
  Arrays.sort(sa,new Comparator<double[]>(){
    public int compare(    double[] l1,    double[] l2){
      if (sortFirstArray) {
        if (l1[0] == l2[0]) {
          return 0;
        }
        if (l1[0] < l2[0]) {
          return -1;
        }
      }
 else {
        if (l1[1] == l2[1]) {
          return 0;
        }
        if (l1[1] < l2[1]) {
          return -1;
        }
      }
      return 1;
    }
  }
);
  for (int i=0; i < a.length; i++) {
    a[i]=sa[i][0];
    b[i]=sa[i][1];
  }
}

Fixed version (ground truth):
private static double[][] sort(double[] a,double[] b,final boolean isTransposed){
  double[] baseArray=isTransposed ? b : a;
  double[] orthogonalArray=isTransposed ? a : b;
  double[][] sa=new double[a.length][2];
  for (int i=0; i < a.length; i++) {
    double[] ca=new double[2];
    ca[0]=baseArray[i];
    ca[1]=orthogonalArray[i];
    sa[i]=ca;
  }
  Arrays.sort(sa,new Comparator<double[]>(){
    public int compare(    double[] l1,    double[] l2){
      if (l1[0] == l2[0]) {
        return 0;
      }
      if (l1[0] < l2[0]) {
        return -1;
      }
      return 1;
    }
  }
);
  return sa;
}
Program: 68545
Project: 68545
Buggy source:
/** 
 * Filters the Null or invalid entry(contains NaN value) from the array.
 * @param ll
 * @return
 */
protected Location[] filterNull(Location[] ll){
  ArrayList<Location> al=new ArrayList<Location>();
  for (int i=0; i < ll.length; i++) {
    if (Double.isNaN(ll[i].getX()) || Double.isNaN(ll[i].getY())) {
      continue;
    }
    al.add(ll[i]);
  }
  if (ll instanceof Location3D[]) {
    return al.toArray(new Location3D[al.size()]);
  }
  return al.toArray(new Location[al.size()]);
}

Fixed version (ground truth):
/** 
 * Filters the Null or invalid entry(contains NaN value) from the array in respect of DataPointHints.
 * @param ll
 * @return
 */
protected static Location[] filterNull(Location[] ll,DataPointHints[] dpha) throws ChartException {
  if (ll == null || dpha == null || ll.length != dpha.length) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,new IllegalArgumentException());
  }
  int iLen=dpha.length;
  ArrayList<Location> al=new ArrayList<Location>(iLen);
  for (int i=0; i < iLen; i++) {
    if (dpha[i].getBaseValue() != null && dpha[i].getOrthogonalValue() != null) {
      al.add(ll[i]);
    }
  }
  if (ll instanceof Location3D[]) {
    return al.toArray(new Location3D[al.size()]);
  }
  return al.toArray(new Location[al.size()]);
}
Program: 68546
Project: 68546
Buggy source:
/** 
 * Add the createby property to the mudule handle 
 * @param handles
 */
public static void addCreateBy(ModuleHandle handle){
  String VERSION_MESSAGE=Messages.getString("String_Node_Str");
  String designerVersion=MessageFormat.format(VERSION_MESSAGE,new String[]{ReportPlugin.getVersion(),ReportPlugin.getBuildInfo()});
  handle.setCreatedBy(designerVersion);
}

Fixed version (ground truth):
/** 
 * Add the createby property to the mudule handle
 * @param handles
 */
public static void addCreateBy(ModuleHandle handle){
  String VERSION_MESSAGE=Messages.getString("String_Node_Str");
  String designerVersion=MessageFormat.format(VERSION_MESSAGE,new String[]{ReportPlugin.getVersion(),ReportPlugin.getBuildInfo()});
  handle.setCreatedBy(designerVersion);
}
Program: 68547
Project: 68547
Buggy source:
/** 
 * @throws IOException
 */
public void outputCacheData() throws IOException {
  writer.startSheet(engine.getCoordinates(),pageHeader,pageFooter,sheetName);
  sheetName=DEFAULT_SHEET_NAME + sheetIndex;
  Iterator<RowData> it=engine.getIterator();
  while (it.hasNext()) {
    outputRowData(it.next());
  }
  writer.endSheet(orientation);
}

Fixed version (ground truth):
/** 
 * @throws IOException
 */
public void outputCacheData() throws IOException {
  writer.startSheet(engine.getCoordinates(),pageHeader,pageFooter,sheetName);
  sheetName=DEFAULT_SHEET_NAME + sheetIndex;
  Iterator<RowData> it=engine.getIterator();
  while (it.hasNext()) {
    outputRowData(it.next());
  }
  writer.endSheet(orientation,pageWidth,pageHeight);
}
Program: 68548
Project: 68548
Buggy source:
public void start(IReportContent report){
  setupRenderOptions();
  ReportDesignHandle designHandle=report.getDesign().getReportDesign();
  String reportOrientation=designHandle.getBidiOrientation();
  if ("String_Node_Str".equalsIgnoreCase(reportOrientation)) {
    isRTLSheet=true;
  }
  String reportLayoutPreference=designHandle.getLayoutPreference();
  if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_FIXED_LAYOUT.equals(reportLayoutPreference)) {
    isAuto=false;
  }
  IStyle style=report.getRoot().getComputedStyle();
  SimpleMasterPageDesign master=(SimpleMasterPageDesign)report.getDesign().getPageSetup().getMasterPage(0);
  engine=createLayoutEngine(context,this);
  engine.initalize(new PageDef(master,style));
  String reportTitle=report.getDesign().getReportDesign().getStringProperty(IModuleModel.TITLE_PROP);
  if (reportTitle != null) {
    sheetName=reportTitle;
  }
 else {
    sheetName=DEFAULT_SHEET_NAME;
  }
  sheetName=ExcelUtil.getValidSheetName(sheetName);
  createWriter();
}

Fixed version (ground truth):
public void start(IReportContent report){
  setupRenderOptions();
  ReportDesignHandle designHandle=report.getDesign().getReportDesign();
  parseReportOrientation(designHandle);
  parseReportLayout(designHandle);
  parseSheetName(designHandle);
  parsePageSize(report);
  IStyle style=report.getRoot().getComputedStyle();
  engine=createLayoutEngine(context,this);
  engine.initalize(contentwidth,style);
  createWriter();
}
Program: 68549
Project: 68549
Buggy source:
private void declareWorkSheetOptions(String orientation,String pageHeader,String pageFooter){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.openTag("String_Node_Str");
  if (orientation != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",orientation);
    writer.closeTag("String_Node_Str");
  }
  if (pageHeader != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",pageHeader);
    writer.closeTag("String_Node_Str");
  }
  if (pageFooter != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",pageFooter);
    writer.closeTag("String_Node_Str");
  }
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
private void declareWorkSheetOptions(String orientation,int pageWidth,int pageHeight){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.openTag("String_Node_Str");
  if (orientation != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",orientation);
    writer.closeTag("String_Node_Str");
  }
  if (pageHeader != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",pageHeader);
    writer.closeTag("String_Node_Str");
  }
  if (pageFooter != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",pageFooter);
    writer.closeTag("String_Node_Str");
  }
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  int index=ExcelUtil.getPageSizeIndex(pageWidth / 1000,pageHeight / 1000);
  writer.text(String.valueOf(index));
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
}
Program: 68550
Project: 68550
Buggy source:
public void endSheet(){
  endSheet(null);
}

Fixed version (ground truth):
public void endSheet(){
  endSheet(null,0,0);
}
Program: 68551
Project: 68551
Buggy source:
public void initalize(PageDef page){
  axis=new AxisProcessor();
  axis.addCoordinate(page.contentwidth);
  setCacheSize();
  ContainerSizeInfo rule=new ContainerSizeInfo(0,page.contentwidth);
  cache=createDataCache(maxCol,maxRow);
  engine=new StyleEngine(this);
  containers.push(createContainer(rule,page.style,null));
}

Fixed version (ground truth):
public void initalize(int contentWidth,IStyle style){
  axis=new AxisProcessor();
  axis.addCoordinate(contentWidth);
  setCacheSize();
  ContainerSizeInfo rule=new ContainerSizeInfo(0,contentWidth);
  cache=createDataCache(maxCol,maxRow);
  engine=new StyleEngine(this);
  containers.push(createContainer(rule,style,null));
}
Program: 68553
Project: 68553
Buggy source:
public static String convertVAlign(String align){
  String va="String_Node_Str";
  align=ExcelUtil.getValue(align);
  if ("String_Node_Str".equalsIgnoreCase(align)) {
    va="String_Node_Str";
  }
 else   if ("String_Node_Str".equalsIgnoreCase(align)) {
    va="String_Node_Str";
  }
  return va;
}

Fixed version (ground truth):
public static String convertVAlign(StyleEntry parent,String align){
  align=ExcelUtil.getValue(align);
  if ("String_Node_Str".equalsIgnoreCase(align)) {
    return "String_Node_Str";
  }
 else   if ("String_Node_Str".equalsIgnoreCase(align)) {
    return "String_Node_Str";
  }
 else   if ("String_Node_Str".equalsIgnoreCase(align) && parent != null) {
    return (String)parent.getProperty(StyleConstant.V_ALIGN_PROP);
  }
  return "String_Node_Str";
}
Program: 68554
Project: 68554
Buggy source:
public StyleEntry createCellEntry(ContainerSizeInfo sizeInfo,IStyle style,String diagonalLineColor,String diagonalLineStyle,int diagonalLineWidth){
  StyleEntry entry;
  if (style == null) {
    entry=StyleBuilder.createEmptyStyleEntry();
  }
 else   entry=initStyle(style,sizeInfo);
  StyleBuilder.applyDiagonalLine(entry,PropertyUtil.getColor(diagonalLineColor),diagonalLineStyle,diagonalLineWidth);
  return entry;
}

Fixed version (ground truth):
public StyleEntry createCellEntry(ContainerSizeInfo sizeInfo,IStyle style,String diagonalLineColor,String diagonalLineStyle,int diagonalLineWidth,StyleEntry parent){
  StyleEntry entry;
  if (style == null) {
    entry=StyleBuilder.createEmptyStyleEntry();
  }
 else   entry=initStyle(style,sizeInfo,parent);
  StyleBuilder.applyDiagonalLine(entry,PropertyUtil.getColor(diagonalLineColor),diagonalLineStyle,diagonalLineWidth);
  return entry;
}
Program: 68555
Project: 68555
Buggy source:
public StyleEntry createEntry(ContainerSizeInfo sizeInfo,IStyle style){
  if (style == null) {
    return StyleBuilder.createEmptyStyleEntry();
  }
  StyleEntry entry=initStyle(style,sizeInfo);
  return entry;
}

Fixed version (ground truth):
public StyleEntry createEntry(ContainerSizeInfo sizeInfo,IStyle style,StyleEntry parent){
  if (style == null) {
    return StyleBuilder.createEmptyStyleEntry();
  }
  StyleEntry entry=initStyle(style,sizeInfo,parent);
  return entry;
}
Program: 68556
Project: 68556
Buggy source:
private StyleEntry initStyle(IStyle style,ContainerSizeInfo rule){
  return initStyle(style,null,rule);
}

Fixed version (ground truth):
private StyleEntry initStyle(IStyle style,ContainerSizeInfo rule,StyleEntry parent){
  return initStyle(style,null,rule,parent);
}
Program: 68557
Project: 68557
Buggy source:
public void addContainderStyle(IStyle computedStyle){
  StyleEntry entry=StyleBuilder.createStyleEntry(computedStyle);
  if (!containerStyles.isEmpty()) {
    StyleEntry centry=containerStyles.peek();
    StyleBuilder.mergeInheritableProp(centry,entry);
  }
  containerStyles.add(entry);
}

Fixed version (ground truth):
public void addContainderStyle(IStyle computedStyle,StyleEntry parent){
  StyleEntry entry=StyleBuilder.createStyleEntry(computedStyle,parent);
  if (!containerStyles.isEmpty()) {
    StyleEntry centry=containerStyles.peek();
    StyleBuilder.mergeInheritableProp(centry,entry);
  }
  containerStyles.add(entry);
}
Program: 68558
Project: 68558
Buggy source:
public Data addDateTime(Object txt,IStyle style,HyperlinkDef link,BookmarkDef bookmark,String dateTimeLocale,float height){
  ContainerSizeInfo containerSize=getCurrentContainer().getSizeInfo();
  StyleEntry entry=engine.getStyle(style,containerSize);
  setlinkStyle(entry,link);
  Data data=null;
  IDataContent dataContent=(IDataContent)txt;
  Object value=dataContent.getValue();
  Date date=ExcelUtil.getDate(value);
  if (date != null && ((date instanceof Time) || date.getYear() >= 0)) {
    data=createDateData(value,entry,style.getDateTimeFormat(),dateTimeLocale);
    data.setHeight(height);
    data.setBookmark(bookmark);
    data.setHyperlinkDef(link);
    data.setStartX(containerSize.getStartCoordinate());
    data.setEndX(containerSize.getEndCoordinate());
    addData(data);
    return data;
  }
 else {
    entry.setProperty(StyleConstant.DATA_TYPE_PROP,SheetData.STRING);
    return addData(dataContent.getText(),style,link,bookmark,dateTimeLocale,height);
  }
}

Fixed version (ground truth):
public Data addDateTime(Object txt,IStyle style,HyperlinkDef link,BookmarkDef bookmark,String dateTimeLocale,float height){
  XlsContainer currentContainer=getCurrentContainer();
  ContainerSizeInfo containerSize=currentContainer.getSizeInfo();
  StyleEntry entry=engine.getStyle(style,containerSize,getParentStyle(currentContainer));
  setlinkStyle(entry,link);
  Data data=null;
  IDataContent dataContent=(IDataContent)txt;
  Object value=dataContent.getValue();
  Date date=ExcelUtil.getDate(value);
  if (date != null && ((date instanceof Time) || date.getYear() >= 0)) {
    data=createDateData(value,entry,style.getDateTimeFormat(),dateTimeLocale);
    data.setHeight(height);
    data.setBookmark(bookmark);
    data.setHyperlinkDef(link);
    data.setStartX(containerSize.getStartCoordinate());
    data.setEndX(containerSize.getEndCoordinate());
    addData(data);
    return data;
  }
 else {
    entry.setProperty(StyleConstant.DATA_TYPE_PROP,SheetData.STRING);
    return addData(dataContent.getText(),style,link,bookmark,dateTimeLocale,height);
  }
}
Program: 68559
Project: 68559
Buggy source:
public void addContainerStyle(IStyle computedStyle){
  engine.addContainderStyle(computedStyle);
}

Fixed version (ground truth):
public void addContainerStyle(IStyle computedStyle){
  engine.addContainderStyle(computedStyle,getParentStyle());
}
Program: 68560
Project: 68560
Buggy source:
public void addCell(ICellContent cellcontent,int col,int colSpan,int rowSpan,IStyle style){
  XlsTable table=tables.peek();
  ContainerSizeInfo cellSizeInfo=table.getColumnSizeInfo(col,colSpan);
  int diagonalNumber=cellcontent.getDiagonalNumber();
  StyleEntry cellStyleEntry=null;
  if (diagonalNumber != 0) {
    String diagonalColor=cellcontent.getDiagonalColor();
    String diagonalStyle=cellcontent.getDiagonalStyle();
    int diagonalWidth=PropertyUtil.getDimensionValue(cellcontent,cellcontent.getDiagonalWidth(),cellSizeInfo.getWidth());
    cellStyleEntry=engine.createCellEntry(cellSizeInfo,style,diagonalColor,diagonalStyle,diagonalWidth);
  }
 else {
    cellStyleEntry=engine.createEntry(cellSizeInfo,style);
  }
  XlsCell cell=new XlsCell(cellStyleEntry,cellSizeInfo,getCurrentContainer(),rowSpan);
  addContainer(cell);
}

Fixed version (ground truth):
public void addCell(ICellContent cellcontent,int col,int colSpan,int rowSpan,IStyle style){
  XlsTable table=tables.peek();
  ContainerSizeInfo cellSizeInfo=table.getColumnSizeInfo(col,colSpan);
  int diagonalNumber=cellcontent.getDiagonalNumber();
  StyleEntry cellStyleEntry=null;
  if (diagonalNumber != 0) {
    String diagonalColor=cellcontent.getDiagonalColor();
    String diagonalStyle=cellcontent.getDiagonalStyle();
    int diagonalWidth=PropertyUtil.getDimensionValue(cellcontent,cellcontent.getDiagonalWidth(),cellSizeInfo.getWidth());
    cellStyleEntry=engine.createCellEntry(cellSizeInfo,style,diagonalColor,diagonalStyle,diagonalWidth,getParentStyle());
  }
 else {
    cellStyleEntry=engine.createEntry(cellSizeInfo,style,getParentStyle());
  }
  XlsCell cell=new XlsCell(cellStyleEntry,cellSizeInfo,getCurrentContainer(),rowSpan);
  addContainer(cell);
}
Program: 68561
Project: 68561
Buggy source:
private void createTable(ColumnsInfo tableInfo,IStyle style,XlsContainer currentContainer,int[] columnStartCoordinates){
  int leftCordinate=columnStartCoordinates[0];
  int width=columnStartCoordinates[columnStartCoordinates.length - 1] - leftCordinate;
  ContainerSizeInfo sizeInfo=new ContainerSizeInfo(leftCordinate,width);
  StyleEntry styleEntry=engine.createEntry(sizeInfo,style);
  XlsTable table=new XlsTable(tableInfo,styleEntry,sizeInfo,currentContainer);
  tables.push(table);
  addContainer(table);
}

Fixed version (ground truth):
private void createTable(ColumnsInfo tableInfo,IStyle style,XlsContainer currentContainer,int[] columnStartCoordinates){
  int leftCordinate=columnStartCoordinates[0];
  int width=columnStartCoordinates[columnStartCoordinates.length - 1] - leftCordinate;
  ContainerSizeInfo sizeInfo=new ContainerSizeInfo(leftCordinate,width);
  StyleEntry styleEntry=engine.createEntry(sizeInfo,style,getParentStyle());
  XlsTable table=new XlsTable(tableInfo,styleEntry,sizeInfo,currentContainer);
  tables.push(table);
  addContainer(table);
}
Program: 68562
Project: 68562
Buggy source:
private SheetData createImageData(IImageContent image,StyleEntry entry,XlsContainer container){
  int type=SheetData.IMAGE;
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,type);
  String uri=image.getURI();
  String mimeType=image.getMIMEType();
  String extension=image.getExtension();
  String altText=image.getAltText();
  if (FlashFile.isFlash(mimeType,uri,extension)) {
    if (null == altText) {
      altText=messageFlashObjectNotSupported;
    }
    return createData(altText,entry);
  }
  try {
    Image imageInfo=EmitterUtil.parseImage(image,image.getImageSource(),image.getURI(),image.getMIMEType(),image.getExtension());
    byte[] data=imageInfo.getData();
    if (data != null) {
      return createData(image,entry,container,type,imageInfo);
    }
 else {
      return createData(image.getAltText(),entry);
    }
  }
 catch (  IOException e) {
    logger.log(Level.WARNING,e.getLocalizedMessage());
    return createData(image.getAltText(),entry);
  }
}

Fixed version (ground truth):
private SheetData createImageData(IImageContent image,StyleEntry entry,XlsContainer container){
  int type=SheetData.IMAGE;
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,type);
  String uri=image.getURI();
  String mimeType=image.getMIMEType();
  String extension=image.getExtension();
  String altText=image.getAltText();
  if (FlashFile.isFlash(mimeType,uri,extension)) {
    if (null == altText) {
      altText=messageFlashObjectNotSupported;
    }
    entry.setProperty(StyleConstant.DATA_TYPE_PROP,SheetData.STRING);
    return createData(altText,entry);
  }
  try {
    Image imageInfo=EmitterUtil.parseImage(image,image.getImageSource(),image.getURI(),image.getMIMEType(),image.getExtension());
    byte[] data=imageInfo.getData();
    if (data != null) {
      return createData(image,entry,container,type,imageInfo);
    }
 else {
      return createData(image.getAltText(),entry);
    }
  }
 catch (  IOException e) {
    logger.log(Level.WARNING,e.getLocalizedMessage());
    return createData(image.getAltText(),entry);
  }
}
Program: 68563
Project: 68563
Buggy source:
public XlsContainer createContainer(ContainerSizeInfo sizeInfo,IStyle style,XlsContainer parent){
  return new XlsContainer(engine.createEntry(sizeInfo,style),sizeInfo,parent);
}

Fixed version (ground truth):
public XlsContainer createContainer(ContainerSizeInfo sizeInfo,IStyle style,XlsContainer parent){
  return new XlsContainer(engine.createEntry(sizeInfo,style,getParentStyle(parent)),sizeInfo,parent);
}
Program: 68564
Project: 68564
Buggy source:
public void addImageData(IImageContent image,IStyle style,HyperlinkDef link,BookmarkDef bookmark){
  XlsContainer container=getCurrentContainer();
  ContainerSizeInfo parentSizeInfo=container.getSizeInfo();
  ColumnsInfo imageColumnsInfo=LayoutUtil.createImage(image,parentSizeInfo.getWidth());
  splitColumns(imageColumnsInfo,parentSizeInfo);
  ContainerSizeInfo imageSize=new ContainerSizeInfo(parentSizeInfo.getStartCoordinate(),imageColumnsInfo.getTotalWidth());
  StyleEntry entry=engine.getStyle(style,imageSize,parentSizeInfo);
  setlinkStyle(entry,link);
  SheetData data=createImageData(image,entry,container);
  data.setHyperlinkDef(link);
  data.setBookmark(bookmark);
  data.setStartX(imageSize.getStartCoordinate());
  data.setEndX(imageSize.getEndCoordinate());
  addData(data);
}

Fixed version (ground truth):
public void addImageData(IImageContent image,IStyle style,HyperlinkDef link,BookmarkDef bookmark){
  XlsContainer container=getCurrentContainer();
  ContainerSizeInfo parentSizeInfo=container.getSizeInfo();
  ColumnsInfo imageColumnsInfo=LayoutUtil.createImage(image,parentSizeInfo.getWidth());
  splitColumns(imageColumnsInfo,parentSizeInfo);
  ContainerSizeInfo imageSize=new ContainerSizeInfo(parentSizeInfo.getStartCoordinate(),imageColumnsInfo.getTotalWidth());
  StyleEntry entry=engine.getStyle(style,imageSize,parentSizeInfo,getParentStyle(container));
  setlinkStyle(entry,link);
  SheetData data=createImageData(image,entry,container);
  data.setHyperlinkDef(link);
  data.setBookmark(bookmark);
  data.setStartX(imageSize.getStartCoordinate());
  data.setEndX(imageSize.getEndCoordinate());
  addData(data);
}
Program: 68565
Project: 68565
Buggy source:
public XlsContainer createCellContainer(IStyle style,XlsContainer parent,int rowSpan){
  ContainerSizeInfo sizeInfo=parent.getSizeInfo();
  return new XlsCell(engine.createEntry(sizeInfo,style),sizeInfo,parent,rowSpan);
}

Fixed version (ground truth):
public XlsContainer createCellContainer(IStyle style,XlsContainer parent,int rowSpan){
  ContainerSizeInfo sizeInfo=parent.getSizeInfo();
  return new XlsCell(engine.createEntry(sizeInfo,style,getParentStyle(parent)),sizeInfo,parent,rowSpan);
}
Program: 68566
Project: 68566
Buggy source:
public void widgetSelected(SelectionEvent e){
  Object oSource=e.getSource();
  if (oSource.equals(cbHidden)) {
    getAxisForProcessing().getLineAttributes().setVisible(!cbHidden.getSelection());
  }
 else   if (oSource.equals(cbTickBetweenCategory)) {
    getAxisForProcessing().getScale().setTickBetweenCategories(cbTickBetweenCategory.getSelection());
  }
  if (oSource.equals(iscGridCount)) {
    getAxisForProcessing().getScale().setMinorGridsPerUnit(iscGridCount.getSelection());
  }
 else   if (oSource.equals(majGridStNum)) {
    getAxisForProcessing().getScale().setMajorGridsStepNumber(majGridStNum.getSelection());
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  Object oSource=e.getSource();
  if (oSource.equals(cbHidden)) {
    getAxisForProcessing().getLineAttributes().setVisible(!cbHidden.getSelection());
    lblColor.setEnabled(!cbHidden.getSelection());
    fccLine.setEnabled(!cbHidden.getSelection());
  }
 else   if (oSource.equals(cbTickBetweenCategory)) {
    getAxisForProcessing().getScale().setTickBetweenCategories(cbTickBetweenCategory.getSelection());
  }
  if (oSource.equals(iscGridCount)) {
    getAxisForProcessing().getScale().setMinorGridsPerUnit(iscGridCount.getSelection());
  }
 else   if (oSource.equals(majGridStNum)) {
    getAxisForProcessing().getScale().setMajorGridsStepNumber(majGridStNum.getSelection());
  }
}
Program: 68572
Project: 68572
Buggy source:
/** 
 * Build the style of image content.
 */
public void buildImageStyle(IImageContent image,StringBuffer styleBuffer,int display){
  buildSize(styleBuffer,HTMLTags.ATTR_WIDTH,image.getWidth());
  buildSize(styleBuffer,HTMLTags.ATTR_HEIGHT,image.getHeight());
  setDisplayProperty(display,0,styleBuffer);
  IStyle style=image.getStyle();
  String verticalAlign=style.getVerticalAlign();
  if (verticalAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(verticalAlign);
    styleBuffer.append("String_Node_Str");
  }
  style=getElementStyle(image);
  if (style == null) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
  AttributeBuilder.buildTextDecoration(styleBuffer,style);
}

Fixed version (ground truth):
/** 
 * Build the style of image content.
 */
public void buildImageStyle(IImageContent image,StringBuffer styleBuffer,int display){
  buildSize(styleBuffer,HTMLTags.ATTR_WIDTH,image.getWidth());
  buildSize(styleBuffer,HTMLTags.ATTR_HEIGHT,image.getHeight());
  setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_BLOCK,styleBuffer);
  IStyle style=image.getStyle();
  String verticalAlign=style.getVerticalAlign();
  if (verticalAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(verticalAlign);
    styleBuffer.append("String_Node_Str");
  }
  style=getElementStyle(image);
  if (style == null) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
  AttributeBuilder.buildTextDecoration(styleBuffer,style);
}
Program: 68573
Project: 68573
Buggy source:
/** 
 * Build the style of image content.
 */
public void buildImageStyle(IImageContent image,StringBuffer styleBuffer,int display){
  buildSize(styleBuffer,HTMLTags.ATTR_WIDTH,image.getWidth());
  buildSize(styleBuffer,HTMLTags.ATTR_HEIGHT,image.getHeight());
  setDisplayProperty(display,0,styleBuffer);
  IStyle imageComputedStyle=image.getComputedStyle();
  if (null != imageComputedStyle) {
    AttributeBuilder.buildTextDecoration(styleBuffer,imageComputedStyle);
  }
  IStyle style=image.getStyle();
  String verticalAlign=style.getVerticalAlign();
  if (verticalAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(verticalAlign);
    styleBuffer.append("String_Node_Str");
  }
  style=getElementStyle(image);
  if (style == null) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
}

Fixed version (ground truth):
/** 
 * Build the style of image content.
 */
public void buildImageStyle(IImageContent image,StringBuffer styleBuffer,int display){
  buildSize(styleBuffer,HTMLTags.ATTR_WIDTH,image.getWidth());
  buildSize(styleBuffer,HTMLTags.ATTR_HEIGHT,image.getHeight());
  setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_BLOCK,styleBuffer);
  IStyle imageComputedStyle=image.getComputedStyle();
  if (null != imageComputedStyle) {
    AttributeBuilder.buildTextDecoration(styleBuffer,imageComputedStyle);
  }
  IStyle style=image.getStyle();
  String verticalAlign=style.getVerticalAlign();
  if (verticalAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(verticalAlign);
    styleBuffer.append("String_Node_Str");
  }
  style=getElementStyle(image);
  if (style == null) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
}
Program: 68574
Project: 68574
Buggy source:
protected boolean needPageBreakBefore(){
  if (content == null || content.getContentType() == IContent.CELL_CONTENT) {
    return false;
  }
  if (hasMasterPageChanged()) {
    return true;
  }
  IStyle style=content.getStyle();
  CSSValue pageBreak=style.getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE);
  if (IStyle.ALWAYS_VALUE == pageBreak || IStyle.RIGHT_VALUE == pageBreak || IStyle.LEFT_VALUE == pageBreak || IStyle.SOFT_VALUE == pageBreak) {
    return true;
  }
  if (parent != null && parent instanceof HTMLListingBandLM) {
    HTMLListingBandLM bandLayout=(HTMLListingBandLM)parent;
    if (isVisible && bandLayout.needSoftPageBreak) {
      if (pageBreak == null || IStyle.AUTO_VALUE.equals(pageBreak)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
protected boolean needPageBreakBefore(){
  if (content == null || content.getContentType() == IContent.CELL_CONTENT) {
    return false;
  }
  if (hasMasterPageChanged()) {
    return true;
  }
  IStyle style=content.getStyle();
  CSSValue pageBreak=style.getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE);
  if (IStyle.ALWAYS_VALUE == pageBreak || IStyle.RIGHT_VALUE == pageBreak || IStyle.LEFT_VALUE == pageBreak || IStyle.SOFT_VALUE == pageBreak) {
    return true;
  }
  if (parent != null && parent instanceof HTMLListingBandLM) {
    HTMLListingBandLM bandLayout=(HTMLListingBandLM)parent;
    if (isVisible && bandLayout.needSoftPageBreak) {
      if (pageBreak == null || IStyle.AUTO_VALUE.equals(pageBreak)) {
        bandLayout.needSoftPageBreak=false;
        return true;
      }
    }
  }
  return false;
}
Program: 68576
Project: 68576
Buggy source:
/** 
 * Gets the binding name list in complex expression like data["year"]+" Q"+data["quarter"]
 * @param indicator indicator like row or data
 * @param expr expression
 * @return binding name list or empty list
 */
@SuppressWarnings("String_Node_Str") protected static List<String> getBindingNameList(String indicator,String expr){
  List<String> names=new ArrayList<String>();
  try {
    List<IColumnBinding> bindings=ExpressionUtil.extractColumnExpressions(expr,indicator);
    for (    IColumnBinding binding : bindings) {
      names.add(binding.getResultSetColumnName());
    }
  }
 catch (  BirtException e) {
    logger.log(e);
  }
  return names;
}

Fixed version (ground truth):
/** 
 * Gets the binding name list in complex expression like data["year"]+" Q"+data["quarter"]
 * @param indicator indicator like row or data
 * @param expr expression
 * @return binding name list or empty list
 */
protected static List<String> getBindingNameList(String indicator,String expr){
  List<String> names=new ArrayList<String>();
  fillBindingNameCollection(names,indicator,expr);
  return names;
}
Program: 68577
Project: 68577
Buggy source:
/** 
 * Checks if the expression references a data binding name
 * @param expr expression
 * @param hasOperation indicates if operation can be allowed in expression
 */
public static boolean isCubeBinding(String expr,boolean hasOperation){
  return isBinding(ExpressionUtil.DATA_INDICATOR,expr,hasOperation);
}

Fixed version (ground truth):
public boolean isCubeBinding(String expr,boolean hasOperation){
  decode(expr);
  return isCubeBinding(hasOperation);
}
Program: 68578
Project: 68578
Buggy source:
/** 
 * Return the binding name of row["binding"]
 * @param expr expression
 * @param hasOperation indicates if operation can be allowed in expression
 */
public static String getRowBindingName(String expr,boolean hasOperation){
  return getBindingName(ExpressionUtil.ROW_INDICATOR,expr,hasOperation);
}

Fixed version (ground truth):
public String getRowBindingName(String expr,boolean hasOperation){
  decode(expr);
  return getRowBindingName(hasOperation);
}
Program: 68579
Project: 68579
Buggy source:
/** 
 * Checks if the expression references a row binding name
 * @param expr expression
 * @param hasOperation indicates if operation can be allowed in expression
 */
public static boolean isRowBinding(String expr,boolean hasOperation){
  return isBinding(ExpressionUtil.ROW_INDICATOR,expr,hasOperation);
}

Fixed version (ground truth):
public boolean isRowBinding(String expr,boolean hasOperation){
  decode(expr);
  return isRowBinding(hasOperation);
}
Program: 68580
Project: 68580
Buggy source:
/** 
 * Return the binding name of data["binding"]
 * @param expr expression
 * @param hasOperation indicates if operation can be allowed in expression
 */
public static String getCubeBindingName(String expr,boolean hasOperation){
  return getBindingName(ExpressionUtil.DATA_INDICATOR,expr,hasOperation);
}

Fixed version (ground truth):
public String getCubeBindingName(String expr,boolean hasOperation){
  decode(expr);
  return getCubeBindingName(hasOperation);
}
Program: 68581
Project: 68581
Buggy source:
/** 
 * Gets the cube binding name list in complex expression like data["year"]+" Q"+data["quarter"]
 * @param expr expression
 * @return binding name list or empty list
 */
public static List<String> getCubeBindingNameList(String expr){
  return getBindingNameList(ExpressionUtil.DATA_INDICATOR,expr);
}

Fixed version (ground truth):
public List<String> getCubeBindingNameList(String expr){
  decode(expr);
  return getCubeBindingNameList();
}
Program: 68582
Project: 68582
Buggy source:
/** 
 * Returns value of aggregate function parameters.
 * @param orthSD
 * @param baseSD
 * @param orthQuery
 * @since 2.5
 */
public static String[] getAggFunParameters(SeriesDefinition orthSD,SeriesDefinition baseSD,Query orthQuery){
  if (baseSD.getGrouping() != null && baseSD.getGrouping().isEnabled()) {
    SeriesGrouping grouping=orthSD.getGrouping();
    if (grouping != null && grouping.isEnabled()) {
      if (orthQuery != null && orthQuery.getGrouping() != null) {
        return orthQuery.getGrouping().getAggregateParameters().toArray(new String[0]);
      }
      return grouping.getAggregateParameters().toArray(new String[0]);
    }
    return baseSD.getGrouping().getAggregateParameters().toArray(new String[0]);
  }
 else {
    if (orthQuery != null && orthQuery.getGrouping() != null && orthQuery.getGrouping().isEnabled()) {
      return orthQuery.getGrouping().getAggregateParameters().toArray(new String[0]);
    }
    return orthSD.getGrouping().getAggregateParameters().toArray(new String[0]);
  }
}

Fixed version (ground truth):
/** 
 * Returns value of aggregate function parameters.
 * @param orthSD
 * @param baseSD
 * @param orthQuery
 * @since 2.5
 */
public static String[] getAggFunParameters(SeriesDefinition orthSD,SeriesDefinition baseSD,Query orthQuery){
  if (baseSD.getGrouping() != null && baseSD.getGrouping().isEnabled()) {
    SeriesGrouping grouping=orthSD.getGrouping();
    if (grouping != null && grouping.isEnabled()) {
      return grouping.getAggregateParameters().toArray(new String[0]);
    }
 else     if (orthQuery != null && orthQuery.getGrouping() != null) {
      return orthQuery.getGrouping().getAggregateParameters().toArray(new String[0]);
    }
    return baseSD.getGrouping().getAggregateParameters().toArray(new String[0]);
  }
 else {
    if (orthQuery != null && orthQuery.getGrouping() != null && orthQuery.getGrouping().isEnabled()) {
      return orthQuery.getGrouping().getAggregateParameters().toArray(new String[0]);
    }
    return orthSD.getGrouping().getAggregateParameters().toArray(new String[0]);
  }
}
Program: 68583
Project: 68583
Buggy source:
/** 
 * Returns row full expression of value series.
 * @param orthQuery
 * @param orthoSD
 * @param categorySD
 * @throws ChartException
 * @since 2.3
 */
public static String getValueSeriesRowFullExpression(Query orthQuery,SeriesDefinition orthoSD,SeriesDefinition categorySD) throws ChartException {
  String fullAggExpr=getFullAggregateExpression(orthoSD,categorySD,orthQuery);
  if (fullAggExpr == null) {
    return orthQuery.getDefinition();
  }
 else {
    return ExpressionUtil.createRowExpression(escapeSpecialCharacters((orthQuery.getDefinition() + "String_Node_Str" + fullAggExpr)));
  }
}

Fixed version (ground truth):
/** 
 * Returns row full expression of value series.
 * @param orthQuery
 * @param orthoSD
 * @param categorySD
 * @throws ChartException
 * @since 2.3
 */
public static String getValueSeriesRowFullExpression(Query orthQuery,SeriesDefinition orthoSD,SeriesDefinition categorySD) throws ChartException {
  String fullAggExpr=getFullAggregateExpression(orthoSD,categorySD,orthQuery);
  if (fullAggExpr == null) {
    return orthQuery.getDefinition();
  }
 else {
    ExpressionCodec exprCodec=ChartModelHelper.instance().createExpressionCodec();
    exprCodec.decode(orthQuery.getDefinition());
    String expr=exprCodec.getExpression();
    return ExpressionUtil.createRowExpression(escapeSpecialCharacters((expr + "String_Node_Str" + fullAggExpr)));
  }
}
Program: 68584
Project: 68584
Buggy source:
/** 
 * Returns a binding name for a value series.
 * @param orthQuery
 * @param orthoSD
 * @param categorySD
 * @return binding name
 * @throws ChartException
 * @since 2.5.1
 */
public static String generateBindingNameOfValueSeries(Query orthQuery,SeriesDefinition orthoSD,SeriesDefinition categorySD) throws ChartException {
  String returnExpr=orthQuery.getDefinition();
  if (ChartExpressionUtil.isCubeBinding(returnExpr,true)) {
    if (ChartExpressionUtil.isCubeBinding(returnExpr,false)) {
      return ChartExpressionUtil.getCubeBindingName(returnExpr,false);
    }
    return escapeSpecialCharacters(returnExpr);
  }
  String fullAggExpr=getFullAggregateExpression(orthoSD,categorySD,orthQuery);
  if (fullAggExpr != null) {
    returnExpr+="String_Node_Str" + fullAggExpr;
  }
  return escapeSpecialCharacters(returnExpr);
}

Fixed version (ground truth):
/** 
 * Returns a binding name for a value series.
 * @param orthQuery
 * @param orthoSD
 * @param categorySD
 * @return binding name
 * @throws ChartException
 * @since 2.5.1
 */
public static String generateBindingNameOfValueSeries(Query orthQuery,SeriesDefinition orthoSD,SeriesDefinition categorySD) throws ChartException {
  ExpressionCodec exprCodec=ChartModelHelper.instance().createExpressionCodec();
  String returnExpr=orthQuery.getDefinition();
  exprCodec.decode(returnExpr);
  returnExpr=exprCodec.getExpression();
  if (ChartExpressionUtil.isCubeBinding(returnExpr,true)) {
    if (ChartExpressionUtil.isCubeBinding(returnExpr,false)) {
      return ChartExpressionUtil.getCubeBindingName(returnExpr,false);
    }
    return escapeSpecialCharacters(returnExpr);
  }
  String fullAggExpr=getFullAggregateExpression(orthoSD,categorySD,orthQuery);
  if (fullAggExpr != null) {
    returnExpr+="String_Node_Str" + fullAggExpr;
  }
  return escapeSpecialCharacters(returnExpr);
}
Program: 68585
Project: 68585
Buggy source:
public void setExpression(String expr){
  codec.decode(expr);
  eHelper.setExpressionType(codec.getType());
  eHelper.setExpression(codec.getExpression());
  eb.refresh();
}

Fixed version (ground truth):
public void setExpression(String expr){
  if (expr != null && expr.length() > 0) {
    codec.decode(expr);
    eHelper.setExpression(codec.getExpression());
    eHelper.setExpressionType(codec.getType());
  }
 else {
    eHelper.setExpression(codec.getExpression());
  }
  eb.refresh();
}
Program: 68586
Project: 68586
Buggy source:
/** 
 * Update query by specified expression. <p> Under shared binding case, update grouping/aggregate attributes of chart model if the selected item is group/aggregate expression.
 */
public void updateQuery(String expression){
  if (getInputControl() instanceof CCombo) {
    Object checkResult=context.getDataServiceProvider().checkData(queryType,expression);
    if (checkResult != null && checkResult instanceof Boolean) {
      if (!((Boolean)checkResult).booleanValue()) {
        return;
      }
    }
  }
  if (!isTableSharedBinding()) {
    setQueryExpression(expression,false);
    return;
  }
  updateQueryForSharedBinding(expression);
  String regex="String_Node_Str";
  if (expression.matches(regex)) {
    DataDefinitionTextManager.getInstance().updateText(query);
    final Event e=new Event();
    e.data=BaseDataDefinitionComponent.this;
    e.widget=getInputControl();
    e.type=IChartDataSheet.EVENT_QUERY;
    e.detail=IChartDataSheet.DETAIL_UPDATE_COLOR;
    Display.getCurrent().asyncExec(new Runnable(){
      public void run(){
        context.getDataSheet().notifyListeners(e);
      }
    }
);
  }
 else {
    getInputControl().setBackground(null);
  }
}

Fixed version (ground truth):
/** 
 * Update query by specified expression. <p> Under shared binding case, update grouping/aggregate attributes of chart model if the selected item is group/aggregate expression.
 */
public void updateQuery(String expression){
  if (getInputControl() instanceof CCombo) {
    Object checkResult=context.getDataServiceProvider().checkData(queryType,expression);
    if (checkResult != null && checkResult instanceof Boolean) {
      if (!((Boolean)checkResult).booleanValue()) {
        return;
      }
    }
  }
  if (!isTableSharedBinding()) {
    setQueryExpression(expression,false);
    return;
  }
  updateQueryForSharedBinding(expression);
  String regex="String_Node_Str";
  if (expression.matches(regex)) {
    DataDefinitionTextManager.getInstance().updateText(query);
    final Event e=new Event();
    e.data=BaseDataDefinitionComponent.this;
    e.widget=getInputControl();
    e.type=IChartDataSheet.EVENT_QUERY;
    e.detail=IChartDataSheet.DETAIL_UPDATE_COLOR;
    Display.getCurrent().asyncExec(new Runnable(){
      public void run(){
        context.getDataSheet().notifyListeners(e);
      }
    }
);
  }
 else {
    DataDefinitionTextManager.getInstance().findText(query).setBackground(null);
  }
}
Program: 68588
Project: 68588
Buggy source:
private List<String> getProjectDependentClasspath(IProject project,boolean needExported){
  if (!hasJavaNature(project)) {
    return Collections.emptyList();
  }
  List<String> retValue=new ArrayList<String>();
  IJavaProject fCurrJProject=JavaCore.create(project);
  IClasspathEntry[] classpathEntries=null;
  boolean projectExists=(project.exists() && project.getFile("String_Node_Str").exists());
  if (projectExists) {
    if (classpathEntries == null) {
      classpathEntries=fCurrJProject.readRawClasspath();
    }
  }
  if (classpathEntries != null) {
    retValue=resolveClasspathEntries(classpathEntries,needExported);
  }
  return retValue;
}

Fixed version (ground truth):
private List<String> getProjectDependentClasspath(IProject project,boolean needExported){
  if (!hasJavaNature(project)) {
    return Collections.emptyList();
  }
  List<String> retValue=new ArrayList<String>();
  IJavaProject fCurrJProject=JavaCore.create(project);
  IClasspathEntry[] classpathEntries=null;
  boolean projectExists=(project.exists() && project.getFile("String_Node_Str").exists());
  if (projectExists) {
    if (classpathEntries == null) {
      classpathEntries=fCurrJProject.readRawClasspath();
    }
  }
  if (classpathEntries != null) {
    retValue=resolveClasspathEntries(classpathEntries,needExported,fCurrJProject);
  }
  return retValue;
}