nus-yam/ex-repair huggingface dataset:
Program: 68479
Project: 68479
Buggy source:
private void setQueryExpression(String expression,boolean isSharing){
  if (ChartUIConstants.QUERY_VALUE.equals(queryType)) {
    if (!(context.getChartType() instanceof GanttChart) && !context.getDataServiceProvider().checkState(IDataServiceProvider.SHARE_QUERY) && context.getDataServiceProvider().checkState(IDataServiceProvider.HAS_DATA_SET)) {
      if (context.getDataServiceProvider().getDataType(expression) == DataType.DATE_TIME_LITERAL) {
        ChartAdapter.beginIgnoreNotifications();
        if (query.getGrouping() == null) {
          query.setGrouping(DataFactoryImpl.init().createSeriesGrouping());
        }
        SeriesGrouping group=query.getGrouping();
        group.setEnabled(true);
        group.setAggregateExpression("String_Node_Str");
        ChartAdapter.endIgnoreNotifications();
      }
    }
  }
  if (query != null) {
    if (isSharing) {
      query.setDefinition(expression);
    }
 else {
      query.setDefinition(btnBuilder.getExpression());
    }
  }
 else {
    query=QueryImpl.create(expression);
    query.eAdapters().addAll(seriesdefinition.eAdapters());
    seriesdefinition.setQuery(query);
  }
}

Fixed version (ground truth):
private void setQueryExpression(String expression,boolean isSharing){
  if (ChartUIConstants.QUERY_VALUE.equals(queryType)) {
    if (!(context.getChartType() instanceof GanttChart) && !context.getDataServiceProvider().checkState(IDataServiceProvider.SHARE_QUERY) && context.getDataServiceProvider().checkState(IDataServiceProvider.HAS_DATA_SET)) {
      if (context.getDataServiceProvider().getDataType(expression) == DataType.DATE_TIME_LITERAL) {
        ChartAdapter.beginIgnoreNotifications();
        if (query.getGrouping() == null) {
          query.setGrouping(DataFactoryImpl.init().createSeriesGrouping());
        }
        SeriesGrouping group=query.getGrouping();
        group.setEnabled(true);
        group.setAggregateExpression("String_Node_Str");
        ChartAdapter.endIgnoreNotifications();
      }
    }
  }
 else   if (ChartUIConstants.QUERY_CATEGORY.equals(queryType)) {
    DataType type=context.getDataServiceProvider().getDataType(expression);
    ChartAdapter.beginIgnoreNotifications();
    if (seriesdefinition.getGrouping() == null) {
      query.setGrouping(DataFactoryImpl.init().createSeriesGrouping());
    }
    seriesdefinition.getGrouping().setGroupType(type);
    if (type == DataType.DATE_TIME_LITERAL) {
      seriesdefinition.getGrouping().setGroupingUnit(GroupingUnitType.YEARS_LITERAL);
    }
    ChartAdapter.endIgnoreNotifications();
  }
  if (query != null) {
    if (isSharing) {
      query.setDefinition(expression);
    }
 else {
      query.setDefinition(btnBuilder.getExpression());
    }
  }
 else {
    query=QueryImpl.create(expression);
    query.eAdapters().addAll(seriesdefinition.eAdapters());
    seriesdefinition.setQuery(query);
  }
}
Program: 68480
Project: 68480
Buggy source:
public AbstractParseState startElement(String tagName){
  ElementDefn defn=(ElementDefn)getElement().getDefn();
  if (DesignSchemaConstants.OVERRIDDEN_VALUES_TAG.equalsIgnoreCase(tagName)) {
    if ((defn.getSlotCount() > 0 || getElement().getContents().size() > 0) && getElement().canContainVirtualElements()) {
      return new OverriddenValuesState((ModuleParserHandler)getHandler(),getElement(),this);
    }
  }
  return super.startElement(tagName);
}

Fixed version (ground truth):
public AbstractParseState startElement(String tagName){
  ElementDefn defn=(ElementDefn)getElement().getDefn();
  if (DesignSchemaConstants.OVERRIDDEN_VALUES_TAG.equalsIgnoreCase(tagName)) {
    if (((defn.getSlotCount() > 0 || getElement().getContents().size() > 0) && defn.canExtend()) || (!defn.canExtend() && getElement().canContainVirtualElements())) {
      return new OverriddenValuesState((ModuleParserHandler)getHandler(),getElement(),this);
    }
  }
  return super.startElement(tagName);
}
Program: 68482
Project: 68482
Buggy source:
private float getContentHeight(IContent content){
  return ExcelUtil.convertDimensionType(content.getHeight(),0) / 1000;
}

Fixed version (ground truth):
private float getContentHeight(IContent content){
  return ExcelUtil.convertDimensionType(content.getHeight(),0,reportDpi) / 1000;
}
Program: 68483
Project: 68483
Buggy source:
private void parsePageSize(IReportContent report){
  SimpleMasterPageDesign masterPage=(SimpleMasterPageDesign)report.getDesign().getPageSetup().getMasterPage(0);
  this.pageWidth=ExcelUtil.convertDimensionType(masterPage.getPageWidth(),0);
  int leftmargin=ExcelUtil.convertDimensionType(masterPage.getLeftMargin(),pageWidth);
  int rightmargin=ExcelUtil.convertDimensionType(masterPage.getRightMargin(),pageWidth);
  this.contentwidth=pageWidth - leftmargin - rightmargin;
  this.pageHeight=ExcelUtil.convertDimensionType(masterPage.getPageHeight(),0);
}

Fixed version (ground truth):
private void parsePageSize(IReportContent report){
  reportDpi=PropertyUtil.getRenderDpi(report,0);
  SimpleMasterPageDesign masterPage=(SimpleMasterPageDesign)report.getDesign().getPageSetup().getMasterPage(0);
  this.pageWidth=ExcelUtil.convertDimensionType(masterPage.getPageWidth(),0,reportDpi);
  int leftmargin=ExcelUtil.convertDimensionType(masterPage.getLeftMargin(),pageWidth,reportDpi);
  int rightmargin=ExcelUtil.convertDimensionType(masterPage.getRightMargin(),pageWidth,reportDpi);
  this.contentwidth=pageWidth - leftmargin - rightmargin;
  this.pageHeight=ExcelUtil.convertDimensionType(masterPage.getPageHeight(),0,reportDpi);
}
Program: 68484
Project: 68484
Buggy source:
public void startTable(ITableContent table){
  ContainerSizeInfo sizeInfo=engine.getCurrentContainer().getSizeInfo();
  int width=sizeInfo.getWidth();
  ColumnsInfo info=null;
  boolean isAutoTable=true;
  if (isAutoTable) {
    info=LayoutUtil.createTable(table,width);
  }
 else {
    int[] columns=LayoutUtil.createFixedTable(table,LayoutUtil.getElementWidth(table,width));
    info=new ColumnsInfo(columns);
  }
  if (info == null)   return;
  String caption=table.getCaption();
  if (caption != null) {
    engine.addCaption(caption,table.getComputedStyle());
  }
  engine.addTable(table,info,sizeInfo);
}

Fixed version (ground truth):
public void startTable(ITableContent table){
  ContainerSizeInfo sizeInfo=engine.getCurrentContainer().getSizeInfo();
  int width=sizeInfo.getWidth();
  ColumnsInfo info=null;
  boolean isAutoTable=true;
  if (isAutoTable) {
    info=LayoutUtil.createTable(table,width,reportDpi);
  }
 else {
    int[] columns=LayoutUtil.createFixedTable(table,LayoutUtil.getElementWidth(table,width,reportDpi),reportDpi);
    info=new ColumnsInfo(columns);
  }
  if (info == null)   return;
  String caption=table.getCaption();
  if (caption != null) {
    engine.addCaption(caption,table.getComputedStyle());
  }
  engine.addTable(table,info,sizeInfo);
}
Program: 68485
Project: 68485
Buggy source:
public void startList(IListContent list){
  ContainerSizeInfo size=engine.getCurrentContainer().getSizeInfo();
  ColumnsInfo table=LayoutUtil.createTable(list,size.getWidth());
  engine.addTable(list,table,size);
  if (list.getChildren() == null) {
    HyperlinkDef link=parseHyperLink(list);
    BookmarkDef bookmark=getBookmark(list);
    float height=getContentHeight(list);
    engine.addData(ExcelLayoutEngine.EMPTY,list.getComputedStyle(),link,bookmark,height);
  }
}

Fixed version (ground truth):
public void startList(IListContent list){
  ContainerSizeInfo size=engine.getCurrentContainer().getSizeInfo();
  ColumnsInfo table=LayoutUtil.createTable(list,size.getWidth(),reportDpi);
  engine.addTable(list,table,size);
  if (list.getChildren() == null) {
    HyperlinkDef link=parseHyperLink(list);
    BookmarkDef bookmark=getBookmark(list);
    float height=getContentHeight(list);
    engine.addData(ExcelLayoutEngine.EMPTY,list.getComputedStyle(),link,bookmark,height);
  }
}
Program: 68486
Project: 68486
Buggy source:
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();
}

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,reportDpi);
  createWriter();
}
Program: 68487
Project: 68487
Buggy source:
public void endRow(IRowContent row){
  DimensionType height=row.getHeight();
  float rowHeight=ExcelUtil.convertDimensionType(height,0) / 1000;
  engine.endRow(rowHeight);
}

Fixed version (ground truth):
public void endRow(IRowContent row){
  DimensionType height=row.getHeight();
  float rowHeight=ExcelUtil.convertDimensionType(height,0,reportDpi) / 1000;
  engine.endRow(rowHeight);
}
Program: 68488
Project: 68488
Buggy source:
public static double convertColWidth(int width){
  if (width < 0)   return 0;
  double result=0;
  double widthInPixel=width / PX_PT;
  double digitalWidth=7;
  result=(int)((widthInPixel - 5) / digitalWidth * 100 + 0.5);
  double characterNumber=(double)result / 100;
  result=(int)((characterNumber * digitalWidth + 5) / digitalWidth * 256);
  return result / 256;
}

Fixed version (ground truth):
public static double convertColWidth(int width,int dpi){
  float PX_PT=INCH_PT / dpi;
  if (width < 0)   return 0;
  double result=0;
  double widthInPixel=width / PX_PT;
  double digitalWidth=7;
  result=(int)((widthInPixel - 5) / digitalWidth * 100 + 0.5);
  double characterNumber=(double)result / 100;
  result=(int)((characterNumber * digitalWidth + 5) / digitalWidth * 256);
  return result / 256;
}
Program: 68489
Project: 68489
Buggy source:
/** 
 * @param value
 * @param parent with of parent, the unit is 1/1000 point.
 * @return
 */
public static int convertDimensionType(DimensionType value,float parent){
  if (value == null) {
    return (int)(parent * 1000);
  }
  if (DimensionType.UNITS_PERCENTAGE.equals(value.getUnits())) {
    return (int)(value.getMeasure() / 100 * parent);
  }
  if (DimensionType.UNITS_PX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * PX_PT * 1000);
  }
  if (DimensionType.UNITS_EM.equalsIgnoreCase(value.getUnits()) || DimensionType.UNITS_EX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * 12 * 1000);
  }
 else {
    return (int)(value.convertTo(DimensionType.UNITS_PT) * 1000);
  }
}

Fixed version (ground truth):
/** 
 * @param value
 * @param parent with of parent, the unit is 1/1000 point.
 * @return
 */
public static int convertDimensionType(DimensionType value,float parent,float dpi){
  float INCH_PX=dpi;
  float PX_PT=INCH_PT / INCH_PX;
  if (value == null) {
    return (int)(parent * 1000);
  }
  if (DimensionType.UNITS_PERCENTAGE.equals(value.getUnits())) {
    return (int)(value.getMeasure() / 100 * parent);
  }
  if (DimensionType.UNITS_PX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * PX_PT * 1000);
  }
  if (DimensionType.UNITS_EM.equalsIgnoreCase(value.getUnits()) || DimensionType.UNITS_EX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * 12 * 1000);
  }
 else {
    return (int)(value.convertTo(DimensionType.UNITS_PT) * 1000);
  }
}
Program: 68490
Project: 68490
Buggy source:
public ImageData(IImageContent image,int styleId,int datatype,Image imageInfo,XlsContainer currentContainer){
  super();
  this.dataType=datatype;
  this.styleId=styleId;
  height=ExcelUtil.convertDimensionType(image.getHeight(),imageInfo.getHeight() * ExcelUtil.PX_PT) / 1000;
  int imageWidth=(int)ExcelUtil.convertDimensionType(image.getWidth(),imageInfo.getWidth() * ExcelUtil.PX_PT);
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  altText=image.getAltText();
  imageUrl=image.getURI();
  this.imageData=imageInfo.getData();
  rowSpanInDesign=0;
  this.imageInfo=imageInfo;
}

Fixed version (ground truth):
public ImageData(IImageContent image,int styleId,int datatype,Image imageInfo,XlsContainer currentContainer,int heightDpi,int widthDpi){
  super();
  this.dataType=datatype;
  this.styleId=styleId;
  height=ExcelUtil.convertDimensionType(image.getHeight(),imageInfo.getHeight() * ExcelUtil.INCH_PT / heightDpi,heightDpi) / 1000;
  int imageWidth=(int)ExcelUtil.convertDimensionType(image.getWidth(),imageInfo.getWidth() * ExcelUtil.INCH_PT / widthDpi,widthDpi);
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  altText=image.getAltText();
  imageUrl=image.getURI();
  this.imageData=imageInfo.getData();
  rowSpanInDesign=0;
  this.imageInfo=imageInfo;
}
Program: 68491
Project: 68491
Buggy source:
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));
}

Fixed version (ground truth):
public void initalize(int contentWidth,IStyle style,int dpi){
  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));
  this.reportDpi=dpi;
}
Program: 68492
Project: 68492
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;
    }
    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 {
      entry.setProperty(StyleConstant.DATA_TYPE_PROP,SheetData.STRING);
      return createData(image.getAltText(),entry);
    }
  }
 catch (  IOException e) {
    logger.log(Level.WARNING,e.getLocalizedMessage());
    entry.setProperty(StyleConstant.DATA_TYPE_PROP,SheetData.STRING);
    return createData(image.getAltText(),entry);
  }
}

Fixed version (ground truth):
private SheetData createImageData(IImageContent image,StyleEntry entry,XlsContainer container,int imageHeightDpi,int imageWidhtDpi){
  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,imageHeightDpi,imageWidhtDpi);
    }
 else {
      entry.setProperty(StyleConstant.DATA_TYPE_PROP,SheetData.STRING);
      return createData(image.getAltText(),entry);
    }
  }
 catch (  IOException e) {
    logger.log(Level.WARNING,e.getLocalizedMessage());
    entry.setProperty(StyleConstant.DATA_TYPE_PROP,SheetData.STRING);
    return createData(image.getAltText(),entry);
  }
}
Program: 68493
Project: 68493
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,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);
}

Fixed version (ground truth):
public void addImageData(IImageContent image,IStyle style,HyperlinkDef link,BookmarkDef bookmark){
  int imageWidthDpi;
  int imageHeightDpi;
  try {
    Image imageInfo=EmitterUtil.parseImage(image,image.getImageSource(),image.getURI(),image.getMIMEType(),image.getExtension());
    int imageFileWidthDpi=imageInfo.getPhysicalWidthDpi() == -1 ? 0 : imageInfo.getPhysicalWidthDpi();
    int imageFileHeightDpi=imageInfo.getPhysicalHeightDpi() == -1 ? 0 : imageInfo.getPhysicalHeightDpi();
    imageWidthDpi=PropertyUtil.getImageDpi(image,imageFileWidthDpi,0);
    imageHeightDpi=PropertyUtil.getImageDpi(image,imageFileHeightDpi,0);
  }
 catch (  IOException ex) {
    imageWidthDpi=reportDpi;
    imageHeightDpi=reportDpi;
  }
  XlsContainer container=getCurrentContainer();
  ContainerSizeInfo parentSizeInfo=container.getSizeInfo();
  ColumnsInfo imageColumnsInfo=LayoutUtil.createImage(image,parentSizeInfo.getWidth(),imageWidthDpi);
  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,imageHeightDpi,imageWidthDpi);
  data.setHyperlinkDef(link);
  data.setBookmark(bookmark);
  data.setStartX(imageSize.getStartCoordinate());
  data.setEndX(imageSize.getEndCoordinate());
  addData(data);
}
Program: 68494
Project: 68494
Buggy source:
protected Bounds computeBounds() throws ChartException {
  final Bounds originalBounds=cm.getBlock().getBounds();
  Bounds bounds=originalBounds.copyInstance();
  if (cm instanceof ChartWithAxes) {
    try {
      ChartWithAxes chart=(ChartWithAxes)cm;
      AggregationCellHandle xtabCell=ChartCubeUtil.getXtabContainerCell(modelHandle);
      if (chart.isTransposed()) {
        bounds.setHeight(0);
        double dWidth=ChartReportItemPresentationPlotImpl.getColumnCellWidth(xtabCell.getCrosstab(),dpi);
        if (!ChartUtil.mathEqual(dWidth,0) && !ChartUtil.mathEqual(dWidth,ChartCubeUtil.DEFAULT_COLUMN_WIDTH.getMeasure())) {
          bounds.setWidth(dWidth);
        }
      }
 else {
        bounds.setWidth(0);
        double dHeight=ChartReportItemPresentationPlotImpl.getRowCellHeight(xtabCell.getCrosstab(),dpi);
        if (!ChartUtil.mathEqual(dHeight,0) && !ChartUtil.mathEqual(dHeight,ChartCubeUtil.DEFAULT_ROW_HEIGHT.getMeasure())) {
          bounds.setHeight(dHeight);
        }
      }
    }
 catch (    BirtException e) {
      throw new ChartException(ChartReportItemConstants.ID,ChartException.GENERATION,e);
    }
  }
  return bounds;
}

Fixed version (ground truth):
protected Bounds computeBounds() throws ChartException {
  final Bounds originalBounds=cm.getBlock().getBounds();
  Bounds bounds=originalBounds.copyInstance();
  if (cm instanceof ChartWithAxes) {
    try {
      ChartWithAxes chart=(ChartWithAxes)cm;
      AggregationCellHandle xtabCell=ChartCubeUtil.getXtabContainerCell(modelHandle);
      if (chart.isTransposed()) {
        bounds.setHeight(0);
        double dWidth=ChartReportItemPresentationPlotImpl.getColumnCellWidth(xtabCell.getCrosstab(),dpi);
        if (!ChartUtil.mathEqual(dWidth,0) && !ChartUtil.mathEqual(dWidth,ChartCubeUtil.DEFAULT_COLUMN_WIDTH.getMeasure())) {
          bounds.setWidth(dWidth);
        }
 else         if (!bounds.isSetWidth() || ChartUtil.mathEqual(bounds.getWidth(),0)) {
          bounds.setWidth(ChartCubeUtil.DEFAULT_COLUMN_WIDTH.getMeasure());
        }
      }
 else {
        bounds.setWidth(0);
        double dHeight=ChartReportItemPresentationPlotImpl.getRowCellHeight(xtabCell.getCrosstab(),dpi);
        if (!ChartUtil.mathEqual(dHeight,0) && !ChartUtil.mathEqual(dHeight,ChartCubeUtil.DEFAULT_ROW_HEIGHT.getMeasure())) {
          bounds.setHeight(dHeight);
        }
 else         if (!bounds.isSetHeight() || ChartUtil.mathEqual(bounds.getHeight(),0)) {
          bounds.setHeight(ChartCubeUtil.DEFAULT_ROW_HEIGHT.getMeasure());
        }
      }
    }
 catch (    BirtException e) {
      throw new ChartException(ChartReportItemConstants.ID,ChartException.GENERATION,e);
    }
  }
  return bounds;
}
Program: 68501
Project: 68501
Buggy source:
protected Control createContents(Composite parent){
  String title=Messages.getFormattedString("String_Node_Str",new String[]{getHandle().getName()});
  getShell().setText(title);
  Control control=super.createContents(parent);
  Utility.setSystemHelp(control,IHelpConstants.CONEXT_ID_DATASET_EDIT);
  return control;
}

Fixed version (ground truth):
protected Control createContents(Composite parent){
  String title=Messages.getFormattedString("String_Node_Str",new String[]{getHandle().getName()});
  getShell().setText(title);
  Control control=super.createContents(parent);
  setPageHelpContent(control);
  return control;
}
Program: 68503
Project: 68503
Buggy source:
/** 
 * 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);
  }
}

Fixed version (ground truth):
/** 
 * Restores the clipping
 * @param ipr
 * @throws ChartException
 */
protected void restoreClipping(final IPrimitiveRenderer ipr) throws ChartException {
  final boolean bLastInSequence=isLastSeries();
  if (bLastInSequence && !isDimension3D() && (!isShowOutside() || !baseIsShowOutside())) {
    flushClipping();
    ClipRenderEvent clip=new ClipRenderEvent(this);
    clip.setVertices(null);
    ipr.setClip(clip);
  }
}
Program: 68507
Project: 68507
Buggy source:
private void populateAggFuncNames(){
  String aggFuncName=null;
  fCmbAggregate.removeAll();
  populateAggregationCombo(fCmbAggregate);
  if (fGrouping.isEnabled() && fGrouping.getAggregateExpression() != null) {
    int idx=getAggregateIndexByName(fGrouping.getAggregateExpression());
    if (fCmbAggregate.getItemCount() > idx) {
      fCmbAggregate.select(idx);
    }
  }
 else   if (fCmbAggregate.getItemCount() > 0) {
    fCmbAggregate.select(0);
  }
  aggFuncName=((String[])fCmbAggregate.getData())[fCmbAggregate.getSelectionIndex()];
  showAggregateParameters(aggFuncName);
}

Fixed version (ground truth):
private void populateAggFuncNames(){
  String aggFuncName=null;
  fCmbAggregate.removeAll();
  populateAggregationCombo(fCmbAggregate);
  fCmbAggregate.setVisibleItemCount(30);
  if (fGrouping.isEnabled() && fGrouping.getAggregateExpression() != null) {
    int idx=getAggregateIndexByName(fGrouping.getAggregateExpression());
    if (fCmbAggregate.getItemCount() > idx) {
      fCmbAggregate.select(idx);
    }
  }
 else   if (fCmbAggregate.getItemCount() > 0) {
    fCmbAggregate.select(0);
  }
  aggFuncName=((String[])fCmbAggregate.getData())[fCmbAggregate.getSelectionIndex()];
  showAggregateParameters(aggFuncName);
}
Program: 68512
Project: 68512
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;
    }
    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);
  }
}

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 {
      entry.setProperty(StyleConstant.DATA_TYPE_PROP,SheetData.STRING);
      return createData(image.getAltText(),entry);
    }
  }
 catch (  IOException e) {
    logger.log(Level.WARNING,e.getLocalizedMessage());
    entry.setProperty(StyleConstant.DATA_TYPE_PROP,SheetData.STRING);
    return createData(image.getAltText(),entry);
  }
}
Program: 68513
Project: 68513
Buggy source:
private Location[] computeRiserRectangle2D(boolean bInverted,int i,double[] faX,double[] faY,double dX,double dY,double dHeight,double dWidth){
  Location[] loaFrontFace=new Location[4];
  dX=Math.round(dX);
  dY=Math.round(dY);
  dWidth=Math.round(dWidth);
  dHeight=Math.round(dHeight);
  loaFrontFace[0]=goFactory.createLocation(dX,dY);
  loaFrontFace[1]=goFactory.createLocation(dX,dY + dHeight);
  loaFrontFace[2]=goFactory.createLocation(dX + dWidth,dY + dHeight);
  loaFrontFace[3]=goFactory.createLocation(dX + dWidth,dY);
  if (isTransposed()) {
    faX[i]=bInverted ? dX + dWidth : dX;
    faY[i]=(dY + dHeight / 2);
  }
 else {
    faX[i]=(dX + dWidth / 2);
    faY[i]=bInverted ? dY + dHeight : dY;
  }
  return loaFrontFace;
}

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

Fixed version (ground truth):
private Location[] computeRiserTube2D(boolean bInverted,int i,double[] faX,double[] faY,double dX,double dY,double dHeight,double dWidth){
  Location[] loaFrontFace=new Location[4];
  loaFrontFace[0]=goFactory.createLocation(dX,dY);
  loaFrontFace[1]=goFactory.createLocation(dX,dY + dHeight);
  loaFrontFace[2]=goFactory.createLocation(dX + dWidth,dY + dHeight);
  loaFrontFace[3]=goFactory.createLocation(dX + dWidth,dY);
  if (isTransposed()) {
    faX[i]=bInverted ? (dX + dWidth) : dX;
    faY[i]=(dY + dHeight / 2);
  }
 else {
    faX[i]=(dX + dWidth / 2);
    faY[i]=bInverted ? dY + dHeight : dY;
  }
  return loaFrontFace;
}
Program: 68515
Project: 68515
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];
  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;
}

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];
  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: 68516
Project: 68516
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];
  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;
}

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];
  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: 68517
Project: 68517
Buggy source:
private void updateBindings(){
  LevelViewHandle level=null;
  if (comboGroupLevel.getSelectionIndex() != -1 && groupLevelList != null && groupLevelList.size() > 0) {
    level=(LevelViewHandle)groupLevelList.get(comboGroupLevel.getSelectionIndex());
  }
  if (level == null) {
    textKey.setItems(new String[]{DEUtil.resolveNull(null)});
    return;
  }
  textKey.removeAll();
  List bindingList=getReferableBindings(level);
  for (int i=0; i < bindingList.size(); i++) {
    textKey.add(((IBindingMetaInfo)(bindingList.get(i))).getBindingName());
  }
  if (textKey.getItemCount() == 0) {
    textKey.add(DEUtil.resolveNull(null));
  }
  if (textKey.indexOf(textKey.getText()) < 0) {
    textKey.setText(ExpressionUtil.createJSDataExpression(textKey.getItem(0)));
  }
}

Fixed version (ground truth):
private void updateBindings(){
  LevelViewHandle level=null;
  if (comboGroupLevel.getSelectionIndex() != -1 && groupLevelList != null && groupLevelList.size() > 0) {
    level=(LevelViewHandle)groupLevelList.get(comboGroupLevel.getSelectionIndex());
  }
  if (level == null) {
    textKey.setItems(new String[]{DEUtil.resolveNull(null)});
    return;
  }
  textKey.removeAll();
  List bindingList=getReferableBindings(level);
  for (int i=0; i < bindingList.size(); i++) {
    textKey.add(((IBindingMetaInfo)(bindingList.get(i))).getBindingName());
  }
  if (textKey.getItemCount() == 0) {
    textKey.add(DEUtil.resolveNull(null));
  }
  if (textKey.indexOf(textKey.getText()) < 0) {
    if (ExpressionButtonUtil.getCurrentExpressionConverter(textKey) != null) {
      textKey.setText(ExpressionButtonUtil.getCurrentExpressionConverter(textKey).getCubeBindingExpression(textKey.getItem(0)));
    }
  }
}
Program: 68518
Project: 68518
Buggy source:
protected boolean isNullValue(CSSValue value){
  if (value == null) {
    return true;
  }
  if (value instanceof DataFormatValue) {
    return true;
  }
  String cssText=value.getCssText();
  return "String_Node_Str".equalsIgnoreCase(cssText) || "String_Node_Str".equalsIgnoreCase(cssText);
}

Fixed version (ground truth):
protected boolean isNullValue(CSSValue value){
  if (value == null) {
    return true;
  }
  if (value instanceof DataFormatValue) {
    return true;
  }
  if (value instanceof FloatValue) {
    return false;
  }
  String cssText=value.getCssText();
  return "String_Node_Str".equalsIgnoreCase(cssText) || "String_Node_Str".equalsIgnoreCase(cssText);
}
Program: 68519
Project: 68519
Buggy source:
public int compare(ShapedAction o1,ShapedAction o2){
  return o2.getZOrder() - o1.getZOrder();
}

Fixed version (ground truth):
public int compare(ShapedAction o1,ShapedAction o2){
  if (o1.getZOrder() == 0 || o2.getZOrder() == 0) {
    return 0;
  }
 else {
    return o2.getZOrder() - o1.getZOrder();
  }
}
Program: 68520
Project: 68520
Buggy source:
public String getImageMap(){
  List<ShapedAction> saList=getShapeActions();
  Collections.sort(saList,new Comparator<ShapedAction>(){
    public int compare(    ShapedAction o1,    ShapedAction o2){
      return o2.getZOrder() - o1.getZOrder();
    }
  }
);
  if (saList == null || saList.size() == 0) {
    return null;
  }
  StringBuffer sb=new StringBuffer();
  for (ListIterator<ShapedAction> iter=saList.listIterator(saList.size()); iter.hasPrevious(); ) {
    ShapedAction sa=iter.previous();
    userCallback(sa,sb);
    String coords=shape2polyCoords(sa.getShape());
    if (coords != null) {
      HTMLTag tag=new HTMLTag("String_Node_Str");
      tag.addAttribute(HTMLAttribute.SHAPE,POLY_SHAPE);
      tag.addAttribute(HTMLAttribute.COORDS,coords);
      tag.addAttribute(HTMLAttribute.ALT,_bAltEnabled ? sa.getSource().getSource().toString() : "String_Node_Str");
      setCursorAttribute(tag,sa);
      boolean changed=false;
      changed|=processOnFocus(sa,tag);
      changed|=processOnBlur(sa,tag);
      changed|=processOnClick(sa,tag);
      changed|=processOnDoubleClick(sa,tag);
      changed|=processOnMouseOver(sa,tag);
      if (changed) {
        sb.append(tag);
      }
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
public String getImageMap(){
  List<ShapedAction> saList=getShapeActions();
  Collections.sort(saList,new Comparator<ShapedAction>(){
    public int compare(    ShapedAction o1,    ShapedAction o2){
      if (o1.getZOrder() == 0 || o2.getZOrder() == 0) {
        return 0;
      }
 else {
        return o2.getZOrder() - o1.getZOrder();
      }
    }
  }
);
  if (saList == null || saList.size() == 0) {
    return null;
  }
  StringBuffer sb=new StringBuffer();
  for (ListIterator<ShapedAction> iter=saList.listIterator(saList.size()); iter.hasPrevious(); ) {
    ShapedAction sa=iter.previous();
    userCallback(sa,sb);
    String coords=shape2polyCoords(sa.getShape());
    if (coords != null) {
      HTMLTag tag=new HTMLTag("String_Node_Str");
      tag.addAttribute(HTMLAttribute.SHAPE,POLY_SHAPE);
      tag.addAttribute(HTMLAttribute.COORDS,coords);
      tag.addAttribute(HTMLAttribute.ALT,_bAltEnabled ? sa.getSource().getSource().toString() : "String_Node_Str");
      setCursorAttribute(tag,sa);
      boolean changed=false;
      changed|=processOnFocus(sa,tag);
      changed|=processOnBlur(sa,tag);
      changed|=processOnClick(sa,tag);
      changed|=processOnDoubleClick(sa,tag);
      changed|=processOnMouseOver(sa,tag);
      if (changed) {
        sb.append(tag);
      }
    }
  }
  return sb.toString();
}
Program: 68521
Project: 68521
Buggy source:
/** 
 * Tests name space. nameSpace of element can only be one of followings: <ul> <li>none</li> <li>masterPage</li> <li>parameter</li> <li>element</li> <li>dataSource</li> <li>dataSet</li> <li>style</li> </ul> <p> In this case, input file set the DataSource.namespace = "invalid-namespace"
 */
public void test_INVALID_NAME_SPACE(){
  loadMeta("String_Node_Str");
  assertEquals(1,errorList.size());
  assertErrorCode(MetaDataParserException.DESIGN_EXCEPTION_INVALID_NAME_SPACE,0,METAREADER_EXCEPTION);
}

Fixed version (ground truth):
/** 
 * Tests name space. nameSpace of element can only be one of followings: <ul> <li>none</li> <li>masterPage</li> <li>parameter</li> <li>element</li> <li>dataSource</li> <li>dataSet</li> <li>style</li> </ul> <p> In this case, input file set the DataSource.namespace = "invalid-namespace"
 */
public void test_INVALID_NAME_SPACE(){
  loadMeta("String_Node_Str");
  assertEquals(1,errorList.size());
  assertErrorCode(MetaDataException.DESIGN_EXCEPTION_INVALID_NAME_SPACE,0,METAREADER_EXCEPTION);
}
Program: 68522
Project: 68522
Buggy source:
public boolean isSupportSchema(){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return false;
    }
    try {
      return connection.getMetaData().supportsSchemasInTableDefinitions();
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return false;
    }
  }
  try {
    return connection.getMetaData().supportsSchemasInTableDefinitions();
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().supportsSchemasInTableDefinitions();
    }
 catch (    Exception e1) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return false;
    }
  }
}

Fixed version (ground truth):
public boolean isSupportSchema(){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return false;
    }
    try {
      return connection.getMetaData().supportsSchemasInTableDefinitions();
    }
 catch (    SQLException e) {
      try {
        ResultSet rs=connection.getMetaData().getSchemas();
        if (rs != null)         return true;
 else         return false;
      }
 catch (      SQLException e1) {
        logger.log(Level.WARNING,e.getMessage(),e);
        return false;
      }
    }
  }
  try {
    return connection.getMetaData().supportsSchemasInTableDefinitions();
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().supportsSchemasInTableDefinitions();
    }
 catch (    Exception e1) {
      try {
        ResultSet rs=connection.getMetaData().getSchemas();
        if (rs != null)         return true;
 else         return false;
      }
 catch (      SQLException e2) {
        logger.log(Level.WARNING,e.getMessage(),e1);
        return false;
      }
    }
  }
}
Program: 68523
Project: 68523
Buggy source:
public boolean isSupportProcedure(){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return false;
    }
    try {
      return connection.getMetaData().supportsStoredProcedures();
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return false;
    }
  }
  try {
    return connection.getMetaData().supportsStoredProcedures();
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().supportsStoredProcedures();
    }
 catch (    Exception e1) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return false;
    }
  }
}

Fixed version (ground truth):
public boolean isSupportProcedure(){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return false;
    }
    try {
      return connection.getMetaData().supportsStoredProcedures();
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return false;
    }
  }
  try {
    return connection.getMetaData().supportsStoredProcedures();
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().supportsStoredProcedures();
    }
 catch (    Exception e1) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return true;
    }
  }
}
Program: 68524
Project: 68524
Buggy source:
public int getMaxQueries() throws OdaException {
  if (jdbcConn != null) {
    try {
      DatabaseMetaData dbMetadata=jdbcConn.getMetaData();
      return dbMetadata.getMaxStatements();
    }
 catch (    SQLException e) {
      throw new JDBCException(ResourceConstants.CANNOT_GET_MAXQUERIES,e);
    }
  }
  return 0;
}

Fixed version (ground truth):
public int getMaxQueries() throws OdaException {
  if (jdbcConn != null) {
    try {
      DatabaseMetaData dbMetadata=jdbcConn.getMetaData();
      return dbMetadata.getMaxStatements();
    }
 catch (    SQLException e) {
      return 0;
    }
  }
  return 0;
}
Program: 68526
Project: 68526
Buggy source:
private Location[] computeRiserRectangle2D(boolean bInverted,int i,double[] faX,double[] faY,double dX,double dY,double dHeight,double dWidth){
  Location[] loaFrontFace=new Location[4];
  loaFrontFace[0]=goFactory.createLocation(dX,dY);
  loaFrontFace[1]=goFactory.createLocation(dX,dY + dHeight);
  loaFrontFace[2]=goFactory.createLocation(dX + dWidth,dY + dHeight);
  loaFrontFace[3]=goFactory.createLocation(dX + dWidth,dY);
  if (isTransposed()) {
    faX[i]=bInverted ? dX + dWidth : dX;
    faY[i]=(dY + dHeight / 2);
  }
 else {
    faX[i]=(dX + dWidth / 2);
    faY[i]=bInverted ? dY + dHeight : dY;
  }
  return loaFrontFace;
}

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

Fixed version (ground truth):
private Location[] computeRiserTube2D(boolean bInverted,int i,double[] faX,double[] faY,double dX,double dY,double dHeight,double dWidth){
  Location[] loaFrontFace=new Location[4];
  dX=Math.round(dX);
  dY=Math.round(dY);
  dWidth=Math.round(dWidth);
  dHeight=Math.round(dHeight);
  loaFrontFace[0]=goFactory.createLocation(dX,dY);
  loaFrontFace[1]=goFactory.createLocation(dX,dY + dHeight);
  loaFrontFace[2]=goFactory.createLocation(dX + dWidth,dY + dHeight);
  loaFrontFace[3]=goFactory.createLocation(dX + dWidth,dY);
  if (isTransposed()) {
    faX[i]=bInverted ? (dX + dWidth) : dX;
    faY[i]=(dY + dHeight / 2);
  }
 else {
    faX[i]=(dX + dWidth / 2);
    faY[i]=bInverted ? dY + dHeight : dY;
  }
  return loaFrontFace;
}