nus-yam/ex-repair huggingface dataset:
Program: 71587
Project: 71587
Buggy source:
/** 
 * Fill gradient.
 * @param gc
 */
protected void fillGradient(GC gc){
  if (((Gradient)fCurrent).getStartColor() == null && ((Gradient)fCurrent).getEndColor() == null) {
    return;
  }
  Color clrStart=null;
  Color clrEnd=null;
  if (((Gradient)fCurrent).getStartColor() != null) {
    clrStart=new Color(Display.getDefault(),((Gradient)fCurrent).getStartColor().getRed(),((Gradient)fCurrent).getStartColor().getGreen(),((Gradient)fCurrent).getStartColor().getBlue());
    gc.setForeground(clrStart);
  }
  if (((Gradient)fCurrent).getEndColor() != null) {
    clrEnd=new Color(Display.getDefault(),((Gradient)fCurrent).getEndColor().getRed(),((Gradient)fCurrent).getEndColor().getGreen(),((Gradient)fCurrent).getEndColor().getBlue());
    gc.setBackground(clrEnd);
  }
  gc.fillGradientRectangle(2,2,this.getSize().x - 4,this.getSize().y - 4,false);
}

Fixed version (ground truth):
/** 
 * Fill gradient.
 * @param gc
 */
protected void fillGradient(GC gc){
  idr.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT,gc);
  PolygonRenderEvent event=new PolygonRenderEvent(this);
  Location[] la=LocationImpl.create(new double[]{2,2,this.getSize().x - 2,this.getSize().x - 2},new double[]{2,this.getSize().y - 2,this.getSize().y - 2,2});
  event.setPoints(la);
  event.setBackground(fCurrent);
  try {
    idr.fillPolygon(event);
  }
 catch (  ChartException e) {
  }
}
Program: 71588
Project: 71588
Buggy source:
public void angleChanged(int iNewAngle){
  iscRotation.setValue(iNewAngle);
  gCurrent.setDirection(iNewAngle);
}

Fixed version (ground truth):
public void angleChanged(int iNewAngle){
  iscRotation.setValue(iNewAngle);
  gCurrent.setDirection(iNewAngle);
  cnvPreview.redraw();
}
Program: 71589
Project: 71589
Buggy source:
private void showChart(Dimension dSize){
  Bounds bo=BoundsImpl.create(0,0,dSize.width,dSize.height);
  bo.scale(72d / idr.getDisplayServer().getDpiResolution());
  idr.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT,gc);
  Generator gr=Generator.instance();
  ChartAdapter.beginIgnoreNotifications();
  cm.clearSections(IConstants.RUN_TIME);
  cm.createSampleRuntimeSeries();
  ChartAdapter.endIgnoreNotifications();
  try {
    RunTimeContext rtc=new RunTimeContext();
    rtc.setScriptingEnabled(false);
    rtc.setMessageLookup(new BIRTDesignerMessageLookup(crii.getHandle()));
    rtc.setRightToLeft(crii.isLayoutDirectionRTL());
    rtc.setRightToLeftText(crii.getHandle().isDirectionRTL());
    rtc.setResourceFinder(crii);
    rtc.setExternalizer(crii);
    boolean bPlotChart=ChartXTabUtil.isPlotChart(crii.getHandle());
    if (bPlotChart) {
      rtc.setScale(createSharedScaleFromSampleData());
    }
    gr.render(idr,gr.build(idr.getDisplayServer(),cm,bo,null,rtc,new ChartReportStyleProcessor(crii.getHandle(),true)));
  }
 catch (  ChartException gex) {
    showException(gc,gex);
  }
}

Fixed version (ground truth):
private void showChart(Dimension dSize){
  Bounds bo=BoundsImpl.create(0,0,dSize.width,dSize.height);
  bo.scale(72d / idr.getDisplayServer().getDpiResolution());
  idr.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT,gc);
  Generator gr=Generator.instance();
  ChartAdapter.beginIgnoreNotifications();
  cm.clearSections(IConstants.RUN_TIME);
  cm.createSampleRuntimeSeries();
  ChartAdapter.endIgnoreNotifications();
  try {
    Chart cmRunTime=(Chart)EcoreUtil.copy(cm);
    removeStepInfoForSample(cmRunTime);
    RunTimeContext rtc=new RunTimeContext();
    rtc.setScriptingEnabled(false);
    rtc.setMessageLookup(new BIRTDesignerMessageLookup(crii.getHandle()));
    rtc.setRightToLeft(crii.isLayoutDirectionRTL());
    rtc.setRightToLeftText(crii.getHandle().isDirectionRTL());
    rtc.setResourceFinder(crii);
    rtc.setExternalizer(crii);
    boolean bPlotChart=ChartXTabUtil.isPlotChart(crii.getHandle());
    if (bPlotChart) {
      rtc.setScale(createSharedScaleFromSampleData());
    }
    gr.render(idr,gr.build(idr.getDisplayServer(),cmRunTime,bo,null,rtc,new ChartReportStyleProcessor(crii.getHandle(),true)));
  }
 catch (  ChartException gex) {
    showException(gc,gex);
  }
}
Program: 71590
Project: 71590
Buggy source:
/** 
 * @param s
 * @return
 */
private String[] splitOnBreaks(String s,double maxSize){
  final ArrayList<String> al=new ArrayList<String>();
  int i=0, j;
  do {
    j=s.indexOf('\n',i);
    if (j == -1) {
      j=s.length();
    }
    String ss=s.substring(i,j);
    if (ss != null && ss.length() > 0) {
      if (maxSize > 0) {
        Rectangle2D size=fm.getStringBounds(ss,g2d);
        if (size.getWidth() > maxSize) {
          int estCount=(int)(maxSize / size.getWidth()) * ss.length();
          if (estCount < 1) {
            estCount=ss.length();
          }
          String fs;
          Rectangle2D fsize;
          int curPos=0;
          while (ss.length() > 0) {
            fs=ss.substring(0,Math.min(estCount,ss.length()));
            fsize=fm.getStringBounds(fs,g2d);
            if (fsize.getWidth() <= maxSize) {
              al.add(fs);
              curPos=fs.length();
            }
 else {
              boolean matched=false;
              int curCount=Math.min(estCount - 1,ss.length());
              while (curCount > 1) {
                fs=ss.substring(0,curCount);
                fsize=fm.getStringBounds(fs,g2d);
                if (fsize.getWidth() <= maxSize) {
                  al.add(fs);
                  curPos=fs.length();
                  matched=true;
                  break;
                }
 else {
                  curCount--;
                }
              }
              if (!matched) {
                al.add(fs);
                curPos=fs.length();
              }
            }
            ss=ss.substring(curPos);
            curPos=0;
          }
        }
 else {
          al.add(ss);
        }
      }
 else {
        al.add(ss);
      }
    }
    i=j + 1;
  }
 while (j != -1 && j < s.length());
  final int n=al.size();
  if (n == 1 || n == 0) {
    return null;
  }
  final String[] sa=new String[n];
  for (i=0; i < al.size(); i++) {
    sa[i]=al.get(i);
  }
  return sa;
}

Fixed version (ground truth):
/** 
 * @param s
 * @return
 */
private String[] splitOnBreaks(String s,double maxSize){
  List al=new ArrayList();
  int i=0, j;
  do {
    j=s.indexOf('\n',i);
    if (j == -1) {
      j=s.length();
    }
    String ss=s.substring(i,j);
    if (ss != null && ss.length() > 0) {
      al.add(ss);
    }
    i=j + 1;
  }
 while (j != -1 && j < s.length());
  if (maxSize > 0) {
    List nal=new ArrayList();
    for (Iterator itr=al.iterator(); itr.hasNext(); ) {
      String ns=(String)itr.next();
      AttributedString as=new AttributedString(ns,fm.getFont().getAttributes());
      LineBreakMeasurer lbm=new LineBreakMeasurer(as.getIterator(),g2d.getFontRenderContext());
      while (lbm.getPosition() < ns.length()) {
        int next=lbm.nextOffset((float)maxSize);
        String ss=ns.substring(lbm.getPosition(),next);
        lbm.setPosition(next);
        nal.add(ss);
      }
    }
    al=nal;
  }
  final int n=al.size();
  if (n == 1 || n == 0) {
    return null;
  }
  final String[] sa=new String[n];
  for (i=0; i < al.size(); i++) {
    sa[i]=(String)al.get(i);
  }
  return sa;
}
Program: 71592
Project: 71592
Buggy source:
/** 
 * Updates the dimension combo according to chart type and axes number
 * @param sSelectedType Chart type
 * @return whether the dimension is changed after updating
 */
private boolean updateDimensionCombo(String sSelectedType){
  boolean isOldExist=false;
  IChartType chartType=htTypes.get(sSelectedType);
  String[] dimensionArray=chartType.getSupportedDimensions();
  int axesNum=ChartUIUtil.getOrthogonalAxisNumber(chartModel);
  if (sDimension == null) {
    sDimension=chartType.getDefaultDimension();
    isOldExist=true;
  }
  cbDimension.removeAll();
  for (int i=0; i < dimensionArray.length; i++) {
    boolean isSupported=chartType.isDimensionSupported(dimensionArray[i],(ChartWizardContext)context,axesNum,0);
    if (isSupported) {
      cbDimension.add(dimensionArray[i]);
    }
    if (!isOldExist && sDimension.equals(dimensionArray[i])) {
      isOldExist=isSupported;
    }
  }
  if (!isOldExist) {
    sDimension=chartType.getDefaultDimension();
  }
  cbDimension.setText(sDimension);
  return !isOldExist;
}

Fixed version (ground truth):
/** 
 * Updates the dimension combo according to chart type and axes number
 * @param sSelectedType Chart type
 * @return whether the dimension is changed after updating
 */
private boolean updateDimensionCombo(String sSelectedType){
  boolean isOldExist=false;
  IChartType chartType=htTypes.get(sSelectedType);
  String[] dimensionArray=chartType.getSupportedDimensions();
  int axesNum=ChartUIUtil.getOrthogonalAxisNumber(chartModel);
  if (sDimension == null) {
    sDimension=chartType.getDefaultDimension();
    isOldExist=true;
  }
  cbDimension.removeAll();
  for (int i=0; i < dimensionArray.length; i++) {
    boolean isSupported=chartType.isDimensionSupported(dimensionArray[i],(ChartWizardContext)context,axesNum,0);
    if (isSupported) {
      cbDimension.add(dimensionArray[i]);
    }
    if (!isOldExist && sDimension.equals(dimensionArray[i])) {
      isOldExist=isSupported;
    }
  }
  String cache=ChartCacheManager.getInstance().getDimension(sSelectedType);
  if (cache != null) {
    sDimension=cache;
    isOldExist=true;
  }
  if (!isOldExist) {
    sDimension=chartType.getDefaultDimension();
  }
  cbDimension.setText(sDimension);
  return !isOldExist;
}
Program: 71593
Project: 71593
Buggy source:
public void before() throws ChartException {
  super.before();
  _bImageExternallySpecified=(_img != null);
  if (!_bImageExternallySpecified) {
    if (_bo == null) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.RENDERING,"String_Node_Str",Messages.getResourceBundle(getULocale()));
    }
    if ((int)_bo.getWidth() < 0 || (int)_bo.getHeight() < 0) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.INVALID_IMAGE_SIZE,"String_Node_Str",Messages.getResourceBundle(getULocale()));
    }
    if ((int)_bo.getWidth() == 0 || (int)_bo.getHeight() == 0) {
      _bo.setWidth(1);
      _bo.setHeight(1);
    }
    _img=new BufferedImage((int)_bo.getWidth(),(int)_bo.getHeight(),getImageType());
  }
  super.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT,_img.getGraphics());
  if (!supportsTransparency()) {
    _g2d.setPaint(Color.WHITE);
    _g2d.fillRect(0,0,_img.getWidth(null),_img.getHeight(null));
  }
}

Fixed version (ground truth):
public void before() throws ChartException {
  super.before();
  _bImageExternallySpecified=(_img != null);
  if (!_bImageExternallySpecified) {
    if (_bo == null) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.RENDERING,"String_Node_Str",Messages.getResourceBundle(getULocale()));
    }
    if ((int)_bo.getWidth() < 0 || (int)_bo.getHeight() < 0) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.INVALID_IMAGE_SIZE,"String_Node_Str",Messages.getResourceBundle(getULocale()));
    }
    if ((int)_bo.getWidth() == 0 || (int)_bo.getHeight() == 0) {
      _bo.setWidth(1);
      _bo.setHeight(1);
    }
    _img=new BufferedImage((int)Math.round(_bo.getWidth()),(int)Math.round(_bo.getHeight()),getImageType());
  }
  super.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT,_img.getGraphics());
  if (!supportsTransparency()) {
    _g2d.setPaint(Color.WHITE);
    _g2d.fillRect(0,0,_img.getWidth(null),_img.getHeight(null));
  }
}
Program: 71595
Project: 71595
Buggy source:
protected void updateButtons(){
  super.updateButtons();
  btnAddAgg.setEnabled(btnAdd.isEnabled());
  updateButtonStatusForReadOnly();
}

Fixed version (ground truth):
protected void updateButtons(){
  super.updateButtons();
  getAggregationButton().setEnabled(btnAdd.isEnabled());
  updateButtonStatusForReadOnly();
}
Program: 71596
Project: 71596
Buggy source:
public ChartColumnBindingDialog(ReportItemHandle input,Shell parent,ChartWizardContext context){
  super(input,parent,false,false);
  this.context=context;
}

Fixed version (ground truth):
public ChartColumnBindingDialog(ReportItemHandle input,Shell parent,ChartWizardContext context){
  super(input,parent,false,true);
  this.context=context;
}
Program: 71597
Project: 71597
Buggy source:
/** 
 * Disable/enable button to make all items in the dialog read-only.
 * @since 2.3
 */
private void updateButtonStatusForReadOnly(){
  if (fIsReadOnly) {
    btnAdd.setEnabled(false);
    btnEdit.setEnabled(false);
    btnDel.setEnabled(false);
    btnAddAgg.setEnabled(false);
    btnRefresh.setEnabled(false);
  }
}

Fixed version (ground truth):
/** 
 * Disable/enable button to make all items in the dialog read-only.
 * @since 2.3
 */
private void updateButtonStatusForReadOnly(){
  if (fIsReadOnly) {
    btnAdd.setEnabled(false);
    btnEdit.setEnabled(false);
    btnDel.setEnabled(false);
    getAggregationButton().setEnabled(false);
    btnRefresh.setEnabled(false);
  }
}
Program: 71598
Project: 71598
Buggy source:
private void deleteRow(ComputedColumnHandle handle){
  try {
    if (handle.getName().equals(selectedColumnName)) {
      selectedColumnName=null;
    }
    handle.drop();
  }
 catch (  PropertyValueException e) {
    ExceptionHandler.handle(e);
  }
}

Fixed version (ground truth):
protected void deleteRow(ComputedColumnHandle handle){
  try {
    if (handle.getName().equals(selectedColumnName)) {
      selectedColumnName=null;
    }
    handle.drop();
  }
 catch (  PropertyValueException e) {
    ExceptionHandler.handle(e);
  }
}
Program: 71599
Project: 71599
Buggy source:
protected void updateButtons(){
  super.updateButtons();
  getAggregationButton().setEnabled(btnAdd.isEnabled());
  updateButtonStatusForReadOnly();
}

Fixed version (ground truth):
protected void updateButtons(){
  super.updateButtons();
  getAggregationButton().setEnabled(btnAdd.isEnabled());
  if (!isOwnColumnBinding(bindingTable.getTable().getSelectionIndex())) {
    btnDel.setEnabled(false);
    btnEdit.setEnabled(false);
  }
  updateButtonStatusForReadOnly();
}
Program: 71600
Project: 71600
Buggy source:
protected void handleEditEvent(){
  ComputedColumnHandle bindingHandle=null;
  int pos=bindingTable.getTable().getSelectionIndex();
  if (pos > -1) {
    bindingHandle=(ComputedColumnHandle)(DEUtil.getBindingHolder(inputElement)).getColumnBindings().getAt(pos);
  }
  if (bindingHandle == null)   return;
  DataColumnBindingDialog dialog=new DataColumnBindingDialog(false);
  dialog.setInput(inputElement,bindingHandle,context);
  dialog.setExpressionProvider(expressionProvider);
  if (dialog.open() == Dialog.OK) {
    if (bindingTable != null)     bindingTable.getTable().setSelection(pos);
  }
}

Fixed version (ground truth):
protected void handleEditEvent(){
  ComputedColumnHandle bindingHandle=null;
  int pos=getColumnBindingIndexFromTableSelection();
  if (pos > -1) {
    bindingHandle=(ComputedColumnHandle)(DEUtil.getBindingHolder(inputElement)).getColumnBindings().getAt(pos);
  }
  if (bindingHandle == null)   return;
  DataColumnBindingDialog dialog=new DataColumnBindingDialog(false);
  dialog.setInput(inputElement,bindingHandle,context);
  dialog.setExpressionProvider(expressionProvider);
  if (dialog.open() == Dialog.OK) {
    if (bindingTable != null)     bindingTable.getTable().setSelection(pos);
  }
}
Program: 71601
Project: 71601
Buggy source:
protected List getBindingList(DesignElementHandle inputElement){
  Iterator iterator=ChartReportItemUtil.getColumnDataBindings((ReportItemHandle)inputElement);
  List list=new ArrayList();
  while (iterator.hasNext()) {
    list.add(iterator.next());
  }
  return list;
}

Fixed version (ground truth):
protected List<ComputedColumnHandle> getBindingList(DesignElementHandle inputElement){
  Iterator iterator=ChartReportItemUtil.getColumnDataBindings((ReportItemHandle)inputElement);
  List<ComputedColumnHandle> list=new ArrayList<ComputedColumnHandle>();
  while (iterator.hasNext()) {
    list.add((ComputedColumnHandle)iterator.next());
  }
  return list;
}
Program: 71602
Project: 71602
Buggy source:
public boolean layout(){
  if (context.getCancelFlag()) {
    close();
    isLastPage=true;
    return false;
  }
  start(isFirstPage);
  boolean hasNextPage=layoutNodes();
  if (isChildrenFinished()) {
    isLastPage=true;
  }
  if (hasNextPage && !isLastPage) {
    context.addLayoutHint(pageContent,false);
  }
 else {
    context.removeLayoutHint(pageContent);
  }
  isFirstPage=false;
  end(isLastPage);
  context.initilizePage();
  return hasNextPage;
}

Fixed version (ground truth):
public boolean layout(){
  if (context.getCancelFlag()) {
    close();
    isLastPage=true;
    return false;
  }
  start(isFirstPage);
  boolean hasNextPage=layoutNodes();
  if (isChildrenFinished()) {
    isLastPage=true;
  }
  isFirstPage=false;
  end(isLastPage);
  context.initilizePage();
  return hasNextPage;
}
Program: 71603
Project: 71603
Buggy source:
protected void initialize(){
  currentContext=new ContainerContext();
  contextList.add(currentContext);
  calculateSpecifiedHeight();
  createRoot();
  currentContext.maxAvaWidth=parent.getCurrentMaxContentWidth();
  currentContext.root.setWidth(getCurrentMaxContentWidth());
  currentContext.root.setAllocatedHeight(parent.getCurrentMaxContentHeight());
  currentContext.maxAvaHeight=currentContext.root.getContentHeight();
}

Fixed version (ground truth):
protected void initialize(){
  calculateSpecifiedHeight();
  if (specifiedHeight > parent.getCurrentMaxContentHeight()) {
    if (!parent.isPageEmpty()) {
      parent.autoPageBreak();
      if (isInBlockStacking) {
        parent.flushFinishedPage();
      }
    }
  }
  currentContext=new ContainerContext();
  contextList.add(currentContext);
  createRoot();
  currentContext.maxAvaWidth=parent.getCurrentMaxContentWidth();
  currentContext.root.setWidth(getCurrentMaxContentWidth());
  currentContext.root.setAllocatedHeight(parent.getCurrentMaxContentHeight());
  currentContext.maxAvaHeight=currentContext.root.getContentHeight();
}
Program: 71604
Project: 71604
Buggy source:
protected void closeLayout(){
}

Fixed version (ground truth):
protected void closeLayout(){
  if (!PropertyUtil.isInlineElement(image))   parent.align(root);
}
Program: 71605
Project: 71605
Buggy source:
public static boolean isRightAligned(IContent content,CSSValue align,boolean lastLine){
  return IStyle.RIGHT_VALUE.equals(align) || (content != null && content.isDirectionRTL() && (null == align || lastLine && IStyle.JUSTIFY_VALUE.equals(align)));
}

Fixed version (ground truth):
public static boolean isRightAligned(IContent content,CSSValue align,boolean lastLine){
  return align != null && isRightAligned(content,align.getCssText(),lastLine);
}
Program: 71608
Project: 71608
Buggy source:
private void setEnabledForButtons(){
  if (isCubeMode()) {
    boolean disabled=getDataServiceProvider().checkState(IDataServiceProvider.SHARE_QUERY) || getDataServiceProvider().isInXTabAggrCell() || getDataServiceProvider().isInXTabMeasureCell();
    btnFilters.setEnabled(!disabled);
    btnBinding.setEnabled(getDataServiceProvider().isInvokingSupported() || getDataServiceProvider().isSharedBinding());
    btnParameters.setEnabled(false);
  }
 else {
    btnFilters.setEnabled(hasDataSet() && getDataServiceProvider().isInvokingSupported());
    btnParameters.setEnabled(getDataServiceProvider().getBoundDataSet() != null && getDataServiceProvider().isInvokingSupported());
    btnBinding.setEnabled(hasDataSet() && (getDataServiceProvider().isInvokingSupported() || getDataServiceProvider().isSharedBinding()));
  }
}

Fixed version (ground truth):
private void setEnabledForButtons(){
  if (isCubeMode()) {
    boolean disabled=getDataServiceProvider().isInXTabAggrCell() || getDataServiceProvider().isInXTabMeasureCell();
    btnFilters.setEnabled(!disabled);
    btnBinding.setEnabled(getDataServiceProvider().isInvokingSupported() || getDataServiceProvider().isSharedBinding());
    btnParameters.setEnabled(false);
  }
 else {
    btnFilters.setEnabled(hasDataSet());
    btnParameters.setEnabled(getDataServiceProvider().getBoundDataSet() != null && getDataServiceProvider().isInvokingSupported());
    btnBinding.setEnabled(hasDataSet() && (getDataServiceProvider().isInvokingSupported() || getDataServiceProvider().isSharedBinding()));
  }
}
Program: 71609
Project: 71609
Buggy source:
int invokeEditFilter(){
  ExtendedItemHandle handle=getItemHandle();
  handle.getModuleHandle().getCommandStack().startTrans(null);
  ExtendedItemFilterDialog page=new ExtendedItemFilterDialog(handle);
  if (handle.getCube() != null && getDataServiceProvider().isInvokingSupported()) {
    try {
      if (handle.getReportItem() instanceof ChartReportItemImpl) {
        ((ChartReportItemImpl)handle.getReportItem()).setModel(getContext().getModel());
      }
    }
 catch (    ExtendedElementException e) {
      WizardBase.displayException(e);
      return Window.CANCEL;
    }
    page.setFilterHandleProvider(new ChartCubeUIFilterHandleProvider());
  }
  int openStatus=page.open();
  if (openStatus == Window.OK) {
    handle.getModuleHandle().getCommandStack().commit();
  }
 else {
    handle.getModuleHandle().getCommandStack().rollback();
  }
  return openStatus;
}

Fixed version (ground truth):
int invokeEditFilter(){
  ExtendedItemHandle handle=getItemHandle();
  handle.getModuleHandle().getCommandStack().startTrans(null);
  ExtendedItemFilterDialog page=new ExtendedItemFilterDialog(handle);
  AbstractFilterHandleProvider provider=ChartFilterProviderDelegate.createFilterProvider(handle,handle);
  if (provider instanceof ChartCubeFilterHandleProvider) {
    ((ChartCubeFilterHandleProvider)provider).setContext(getContext());
  }
  page.setFilterHandleProvider(provider);
  int openStatus=page.open();
  if (openStatus == Window.OK) {
    handle.getModuleHandle().getCommandStack().commit();
  }
 else {
    handle.getModuleHandle().getCommandStack().rollback();
  }
  return openStatus;
}
Program: 71610
Project: 71610
Buggy source:
public boolean next() throws BirtException {
  if (it.getQueryResults().getPreparedQuery().getReportQueryDefn().getGroups().size() == 0)   return it.next();
  if (!started) {
    started=true;
    return it.next();
  }
 else {
    it.skipToEnd(it.getQueryResults().getPreparedQuery().getReportQueryDefn().getGroups().size());
    return it.next();
  }
}

Fixed version (ground truth):
public boolean next() throws BirtException {
  boolean hasNext=false;
  if (it.getQueryResults().getPreparedQuery().getReportQueryDefn().getGroups().size() == 0) {
    hasNext=it.next();
  }
 else   if (!started) {
    started=true;
    hasNext=it.next();
  }
 else {
    it.skipToEnd(it.getQueryResults().getPreparedQuery().getReportQueryDefn().getGroups().size());
    hasNext=it.next();
  }
  if (!hasNext) {
    it.close();
  }
  return hasNext;
}
Program: 71611
Project: 71611
Buggy source:
PreparedIVDataExtractionQuery(DataEngineImpl dataEngine,IQueryDefinition queryDefn) throws DataException {
  super(dataEngine,queryDefn);
}

Fixed version (ground truth):
PreparedIVDataExtractionQuery(DataEngineImpl dataEngine,IQueryDefinition queryDefn,Map appContext) throws DataException {
  super(dataEngine,queryDefn,appContext);
}
Program: 71612
Project: 71612
Buggy source:
/** 
 * @param dataEngine
 * @param queryDefn
 * @throws DataException
 */
PreparedIVQuerySourceQuery(DataEngineImpl dataEngine,IQueryDefinition queryDefn) throws DataException {
  super(dataEngine,queryDefn,null,null);
  Object[] params={dataEngine,queryDefn};
  logger.entering(PreparedIVDataSourceQuery.class.getName(),"String_Node_Str",params);
  this.queryDefn=queryDefn;
  this.engine=dataEngine;
  prepareQuery();
  preparedQuery=new PreparedQuery(dataEngine.getSession(),dataEngine.getContext(),this.queryDefn,this,appContext);
  logger.exiting(PreparedIVDataSourceQuery.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param dataEngine
 * @param queryDefn
 * @throws DataException
 */
PreparedIVQuerySourceQuery(DataEngineImpl dataEngine,IQueryDefinition queryDefn,Map appContext) throws DataException {
  super(dataEngine,queryDefn,null,appContext);
  Object[] params={dataEngine,queryDefn};
  logger.entering(PreparedIVDataSourceQuery.class.getName(),"String_Node_Str",params);
  this.queryDefn=queryDefn;
  this.engine=dataEngine;
  prepareQuery();
  preparedQuery=new PreparedQuery(dataEngine.getSession(),dataEngine.getContext(),this.queryDefn,this,appContext);
  logger.exiting(PreparedIVDataSourceQuery.class.getName(),"String_Node_Str");
}
Program: 71614
Project: 71614
Buggy source:
public Image getNodeIcon(Object model){
  DesignElementHandle handle=(DesignElementHandle)model;
  String iconPath=ChartUIConstants.IMAGE_OUTLINE;
  if (DEUtil.isLinkedElement(handle)) {
    iconPath=ChartUIConstants.IMAGE_OUTLINE_LIB;
  }
  if (ChartReportItemUtil.getChartFromHandle((ExtendedItemHandle)handle) == null) {
    iconPath=ChartUIConstants.IMAGE_OUTLINE_ERROR;
  }
  return UIHelper.getImage(iconPath);
}

Fixed version (ground truth):
public Image getNodeIcon(Object model){
  DesignElementHandle handle=(DesignElementHandle)model;
  String iconPath=ChartUIConstants.IMAGE_OUTLINE;
  if (DEUtil.isLinkedElement(handle)) {
    iconPath=ChartUIConstants.IMAGE_OUTLINE_LIB;
  }
  if (ChartReportItemUtil.getChartFromHandle((ExtendedItemHandle)handle) == null && !ChartReportItemBuilderImpl.isChartWizardOpen()) {
    iconPath=ChartUIConstants.IMAGE_OUTLINE_ERROR;
  }
  return UIHelper.getImage(iconPath);
}
Program: 71615
Project: 71615
Buggy source:
/** 
 * Constructor 
 * @param resource
 * @param name
 * @param subName
 * @param lineNumber
 * @throws CoreException
 */
public ScriptLineBreakpoint(final IResource resource,final String name,final String subName,final int lineNumber) throws CoreException {
}

Fixed version (ground truth):
/** 
 * Constructor 
 * @param resource
 * @param name
 * @param subName
 * @param lineNumber
 * @throws CoreException
 */
public ScriptLineBreakpoint(final IResource resource,final String name,final String subName,final int lineNumber,final String displayName) throws CoreException {
}
Program: 71617
Project: 71617
Buggy source:
/** 
 * Returns if all objects are in the same column
 * @param objs the array of the object
 */
static boolean isInSameColumn(Object[] objs){
}

Fixed version (ground truth):
/** 
 * Returns if all objects are in the same column
 * @param objs the array of the object
 */
public static boolean isInSameColumn(Object[] objs){
}
Program: 71618
Project: 71618
Buggy source:
/** 
 * create a row in the table model
 * @param content row content
 */
public Row createRow(Object rowContent,boolean isHidden){
  if (!isHidden) {
    isRowHidden=false;
    ensureSize(rowCount + 1,realColCount);
    Row row=rows[rowCount];
    row.rowId=rowCount;
    row.content=rowContent;
    if (rowCount > 0) {
      Cell[] cells=row.cells;
      Cell[] lastCells=rows[rowCount - 1].cells;
      ;
      for (int cellId=0; cellId < realColCount; cellId++) {
        Cell lastCell=lastCells[cellId];
        if (lastCell.status == Cell.CELL_SPANED) {
          lastCell=lastCell.getCell();
        }
        if (lastCell.status == Cell.CELL_USED) {
          if (lastCell.rowSpan < 0 || lastCell.rowId + lastCell.rowSpan > rowCount) {
            cells[cellId]=Cell.createSpanCell(rowCount,cellId,lastCell);
          }
        }
      }
    }
    rowCount++;
    return row;
  }
  isRowHidden=true;
  if (rowCount > 0) {
    Cell[] lastCells=rows[rowCount - 1].cells;
    ;
    for (int cellId=0; cellId < realColCount; cellId++) {
      Cell lastCell=lastCells[cellId];
      if (lastCell.status == Cell.CELL_SPANED) {
        lastCell=lastCell.getCell();
      }
      if (lastCell.status == Cell.CELL_USED) {
        if (lastCell.rowId + lastCell.rowSpan >= rowCount + 1) {
          lastCell.rowSpan--;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * create a row in the table model
 * @param content row content
 */
public Row createRow(Object rowContent,boolean isHidden){
  if (!isHidden) {
    isRowHidden=false;
    ensureSize(rowCount + 1,realColCount);
    Row row=rows[rowCount];
    row.rowId=rowCount;
    row.content=rowContent;
    if (rowCount > 0) {
      Cell[] cells=row.cells;
      Cell[] lastCells=rows[rowCount - 1].cells;
      ;
      for (int cellId=0; cellId < realColCount; cellId++) {
        Cell lastCell=lastCells[cellId];
        if (lastCell.status == Cell.CELL_SPANED) {
          lastCell=lastCell.getCell();
        }
        if (lastCell.status == Cell.CELL_USED) {
          if (lastCell.rowSpan < 0 || lastCell.rowId + lastCell.rowSpan > rowCount) {
            cells[cellId]=Cell.createSpanCell(rowCount,cellId,lastCell);
          }
        }
      }
    }
    rowCount++;
    return row;
  }
  isRowHidden=true;
  if (rowCount > 0) {
    Cell[] lastCells=rows[rowCount - 1].cells;
    for (int cellId=0; cellId < realColCount; cellId++) {
      Cell lastCell=lastCells[cellId];
      if (lastCell.status == Cell.CELL_SPANED) {
        lastCell=lastCell.getCell();
      }
      if (lastCell.status == Cell.CELL_USED) {
        if (lastCell.rowId + lastCell.rowSpan >= rowCount + 1) {
          lastCell.rowSpan--;
        }
      }
    }
  }
  return null;
}
Program: 71619
Project: 71619
Buggy source:
/** 
 * Returns the element handle which can save binding columns the given element
 * @param handle the handle of the element which needs binding columns
 * @return the holder for the element,or itself if no holder available
 */
public static ReportItemHandle getBindingHolder(DesignElementHandle handle){
  if (handle instanceof ReportElementHandle) {
    if (handle instanceof ListingHandle) {
      return (ReportItemHandle)handle;
    }
    if (handle instanceof ReportItemHandle) {
      if (((ReportItemHandle)handle).getDataBindingReference() != null || ((ReportItemHandle)handle).getCube() != null || ((ReportItemHandle)handle).getDataSet() != null) {
        return (ReportItemHandle)handle;
      }
    }
    return getBindingHolder(handle.getContainer());
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the element handle which can save binding columns the given element
 * @param handle the handle of the element which needs binding columns
 * @return the holder for the element,or itself if no holder available
 */
public static ReportItemHandle getBindingHolder(DesignElementHandle handle){
  if (handle instanceof ReportElementHandle) {
    if (handle instanceof ReportItemHandle) {
      if (((ReportItemHandle)handle).getDataBindingReference() != null || ((ReportItemHandle)handle).getCube() != null || ((ReportItemHandle)handle).getDataSet() != null) {
        return (ReportItemHandle)handle;
      }
    }
    return getBindingHolder(handle.getContainer());
  }
  return null;
}
Program: 71621
Project: 71621
Buggy source:
protected void addBorderSegment(Border border,int start,int end,String style,int width,Color color){
  if (style == null || color == null || width == 0 || border == null) {
    return;
  }
  ArrayList segments=border.segments;
  BorderSegment last=null;
  if (!segments.isEmpty()) {
    last=(BorderSegment)segments.get(segments.size() - 1);
    if (last.end == start && last.width == width && last.color.equals(color) && last.style.equals(style)) {
      last.end=end;
      return;
    }
  }
  segments.add(new BorderSegment(start,end,style,width,color));
  if (border.width < width) {
    border.width=width;
  }
}

Fixed version (ground truth):
protected void addBorderSegment(Border border,int start,int end,String style,int width,Color color){
  if (style == null || color == null || width == 0 || border == null) {
    return;
  }
  ArrayList segments=border.segments;
  BorderSegment last=null;
  if (!segments.isEmpty()) {
    last=(BorderSegment)segments.get(segments.size() - 1);
    if (last.width == width && last.color.equals(color) && last.style.equals(style)) {
      if (last.end == start) {
        last.end=end;
        return;
      }
      if (last.start == end) {
        last.start=start;
        return;
      }
    }
  }
  segments.add(new BorderSegment(start,end,style,width,color));
  if (border.width < width) {
    border.width=width;
  }
}
Program: 71622
Project: 71622
Buggy source:
public TableLayoutInfo(int[] colWidth){
  this.colWidth=colWidth;
  this.columnNumber=colWidth.length;
  this.xPositions=new int[columnNumber];
  this.tableWidth=0;
  if (tableContent.isRTL()) {
    for (int i=0; i < columnNumber; i++) {
      xPositions[i]=parent.getCurrentMaxContentWidth() - tableWidth - colWidth[i];
      tableWidth+=colWidth[i];
    }
  }
 else {
    for (int i=0; i < columnNumber; i++) {
      xPositions[i]=tableWidth;
      tableWidth+=colWidth[i];
    }
  }
}

Fixed version (ground truth):
public TableLayoutInfo(int[] colWidth){
  this.colWidth=colWidth;
  this.columnNumber=colWidth.length;
  this.xPositions=new int[columnNumber];
  this.tableWidth=0;
  if (tableContent.isRTL()) {
    int parentMaxWidth=parent != null ? parent.getCurrentMaxContentWidth() : context.getMaxWidth();
    for (int i=0; i < columnNumber; i++) {
      xPositions[i]=parentMaxWidth - tableWidth - colWidth[i];
      tableWidth+=colWidth[i];
    }
    if (xPositions[columnNumber - 1] != 0) {
      addDummyColumnForRTL(colWidth);
    }
  }
 else {
    for (int i=0; i < columnNumber; i++) {
      xPositions[i]=tableWidth;
      tableWidth+=colWidth[i];
    }
  }
}
Program: 71623
Project: 71623
Buggy source:
protected void initialize(){
  checkInlineBlock();
  currentContext=new TableContext();
  contextList.add(currentContext);
  tableContext=(TableContext)currentContext;
  createRoot();
  buildTableLayoutInfo();
  currentContext.root.setWidth(layoutInfo.getTableWidth());
  currentContext.maxAvaWidth=layoutInfo.getTableWidth();
  if (parent != null) {
    currentContext.root.setAllocatedHeight(parent.getCurrentMaxContentHeight());
  }
 else {
    currentContext.root.setAllocatedHeight(context.getMaxHeight());
  }
  if (tableContext.layout == null) {
    int start=0;
    int end=tableContent.getColumnCount() - 1;
    tableContext.layout=new TableAreaLayout(tableContent,layoutInfo,start,end);
  }
  currentContext.maxAvaHeight=currentContext.root.getContentHeight() - getBottomBorderWidth();
  addCaption(tableContent.getCaption());
  repeatHeader();
}

Fixed version (ground truth):
protected void initialize(){
  checkInlineBlock();
  currentContext=new TableContext();
  contextList.add(currentContext);
  tableContext=(TableContext)currentContext;
  createRoot();
  buildTableLayoutInfo();
  currentContext.root.setWidth(layoutInfo.getTableWidth());
  currentContext.maxAvaWidth=layoutInfo.getTableWidth();
  if (this.columnNumber < layoutInfo.columnNumber) {
    addDummyColumnForRTL();
  }
  if (parent != null) {
    currentContext.root.setAllocatedHeight(parent.getCurrentMaxContentHeight());
  }
 else {
    currentContext.root.setAllocatedHeight(context.getMaxHeight());
  }
  if (tableContext.layout == null) {
    int start=0;
    int end=tableContent.getColumnCount() - 1;
    tableContext.layout=new TableAreaLayout(tableContent,layoutInfo,start,end);
  }
  currentContext.maxAvaHeight=currentContext.root.getContentHeight() - getBottomBorderWidth();
  addCaption(tableContent.getCaption());
  repeatHeader();
}
Program: 71624
Project: 71624
Buggy source:
/** 
 * constructor
 * @param page the viewer
 * @param registry the registry
 */
public LibraryExplorerContextMenuProvider(LibraryExplorerTreeViewPage page){
  super(page.getTreeViewer());
  this.page=page;
  clipboard=new Clipboard(page.getSite().getShell().getDisplay());
  filterAction=new FilterResourceAction(page);
  refreshExplorerAction=new RefreshResourceExplorerAction(page);
  useCSSAction=new UseCSSAction(page);
  useLibraryAction=new AddSelectedLibToCurrentReportDesignAction(page.getTreeViewer());
  deleteResourceAction=new DeleteResourceAction(page);
  addResourceAction=new AddResourceAction(page);
  renameResourceAction=new RenameResourceAction(page);
  newFolderAction=new NewFolderAction(page);
  moveResourceAction=new MoveResourceAction(page);
  newLibraryAction=new NewLibraryAction(page);
  copyResourceAction=new CopyResourceAction(page,clipboard);
  pasteResourceAction=new PasteResourceAction(page,clipboard);
  newMenuGroup.add(newFolderAction);
  newMenuGroup.add(newLibraryAction);
  handleGlobalAction();
  page.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      resetActionStatus();
      updateActionBars();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * constructor
 * @param page the viewer
 * @param registry the registry
 */
public LibraryExplorerContextMenuProvider(LibraryExplorerTreeViewPage page){
  super(page.getTreeViewer());
  this.page=page;
  clipboard=new Clipboard(page.getSite().getShell().getDisplay());
  filterAction=new FilterResourceAction(page);
  refreshExplorerAction=new RefreshResourceExplorerAction(page);
  useCSSAction=new UseCSSAction(page);
  useLibraryAction=new AddSelectedLibToCurrentReportDesignAction(page.getTreeViewer());
  deleteResourceAction=new DeleteResourceAction(page);
  addResourceAction=new AddResourceAction(page);
  renameResourceAction=new RenameResourceAction(page);
  newFolderAction=new NewFolderAction(page);
  moveResourceAction=new MoveResourceAction(page);
  newLibraryAction=new NewLibraryAction(page);
  copyResourceAction=new CopyResourceAction(page,clipboard);
  pasteResourceAction=new PasteResourceAction(page,clipboard);
  handleGlobalAction();
  page.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      resetActionStatus();
      updateActionBars();
    }
  }
);
}
Program: 71627
Project: 71627
Buggy source:
/** 
 * set ReportDesignHandle properties.
 * @param fileName
 * @throws DesignFileException
 * @throws SemanticException
 * @throws IOException
 */
private void setDesignFile(String fileName) throws DesignFileException, SemanticException, IOException {
  ReportDesignHandle handle=SessionHandleAdapter.getInstance().getSessionHandle().openDesign(fileName);
  if (!page.getDisplayName().equals("String_Node_Str"))   handle.setDisplayName(page.getDisplayName());
  handle.setProperty(ModuleHandle.DESCRIPTION_PROP,page.getDescription());
  if (!page.getPreviewImagePath().equals("String_Node_Str")) {
    handle.setIconFile(page.getPreviewImagePath());
  }
 else {
    handle.setIconFile("String_Node_Str");
  }
  handle.save();
  handle.close();
}

Fixed version (ground truth):
/** 
 * set ReportDesignHandle properties.
 * @param fileName
 * @throws DesignFileException
 * @throws SemanticException
 * @throws IOException
 */
private void setDesignFile(String fileName) throws DesignFileException, SemanticException, IOException {
  ReportDesignHandle newHandle=SessionHandleAdapter.getInstance().getSessionHandle().openDesign(fileName);
  if (!page.getDisplayName().equals("String_Node_Str"))   newHandle.setDisplayName(page.getDisplayName());
  newHandle.setProperty(ModuleHandle.DESCRIPTION_PROP,page.getDescription());
  if (!page.getPreviewImagePath().equals("String_Node_Str")) {
    newHandle.setIconFile(page.getPreviewImagePath());
  }
 else {
    newHandle.setIconFile("String_Node_Str");
  }
  if (!newHandle.getIconFile().equals(handle.getIconFile())) {
    newHandle.deleteThumbnail();
  }
  newHandle.save();
  newHandle.close();
}
Program: 71630
Project: 71630
Buggy source:
public HashMap getExpressions(){
  if (text == null) {
    return null;
  }
  if (exprs != null) {
    return exprs;
  }
  if (HTML_TEXT.equals(textType) || (AUTO_TEXT.equals(textType) && (text.substring(0,6).equalsIgnoreCase("String_Node_Str")))) {
    exprs=new HashMap();
    TextTemplate template=new TemplateParser().parse(text);
    if (template != null && template.getNodes() != null) {
      Iterator itor=template.getNodes().iterator();
      Object obj;
      String expression=null;
      while (itor.hasNext()) {
        obj=itor.next();
        if (obj instanceof TextTemplate.ValueNode) {
          expression=((TextTemplate.ValueNode)obj).getValue();
        }
 else         if (obj instanceof TextTemplate.ImageNode) {
          expression=((TextTemplate.ImageNode)obj).getExpr();
        }
        if (expression != null && !expression.trim().equals("String_Node_Str")) {
          exprs.put(expression,expression);
          expression=null;
        }
      }
    }
  }
  return exprs;
}

Fixed version (ground truth):
public HashMap getExpressions(){
  if (text == null) {
    return null;
  }
  if (exprs != null) {
    return exprs;
  }
  if (HTML_TEXT.equals(textType) || (AUTO_TEXT.equals(textType) && startsWithIgnoreCase(text,"String_Node_Str"))) {
    exprs=new HashMap();
    TextTemplate template=new TemplateParser().parse(text);
    if (template != null && template.getNodes() != null) {
      Iterator itor=template.getNodes().iterator();
      Object obj;
      String expression=null;
      while (itor.hasNext()) {
        obj=itor.next();
        if (obj instanceof TextTemplate.ValueNode) {
          expression=((TextTemplate.ValueNode)obj).getValue();
        }
 else         if (obj instanceof TextTemplate.ImageNode) {
          expression=((TextTemplate.ImageNode)obj).getExpr();
        }
        if (expression != null && !expression.trim().equals("String_Node_Str")) {
          exprs.put(expression,expression);
          expression=null;
        }
      }
    }
  }
  return exprs;
}
Program: 71632
Project: 71632
Buggy source:
/** 
 * Calculates the absolute positions of image map when given the position of image. The image map position is relative to the left up corner of the image. The argument and returned value are both 4 length integer area, the four value of which are x, y of up left corner, width and height respectively.
 * @param area rectangle area of a image map.
 * @param imageArea image area of the image in which the image map is.
 * @return absolute position of the image map.
 */
private int[] getAbsoluteArea(int[] area,IImageArea imageArea){
  assert(intrinsic != null);
  for (int i=0; i < 4; i++) {
    area[i]=getTranslatedLength(area[i]);
  }
  int[] result=new int[4];
  int imageX=imageArea.getX();
  int imageY=imageArea.getY();
  int imageHeight=imageArea.getHeight();
  int imageWidth=imageArea.getWidth();
  int intrinsicWidth=intrinsic.getWidth();
  int intrinsicHeight=intrinsic.getHeight();
  float ratio=(float)imageWidth / (float)intrinsicWidth;
  result[0]=imageX + (int)(area[0] * ratio);
  result[2]=(int)(area[2] * ratio);
  ratio=(float)imageHeight / (float)intrinsicHeight;
  result[1]=imageY + (int)(area[1] * ratio);
  result[3]=(int)(area[3] * ratio);
  return result;
}

Fixed version (ground truth):
/** 
 * Calculates the absolute positions of image map when given the position of image. The image map position is relative to the left up corner of the image. The argument and returned value are both 4 length integer area, the four value of which are x, y of up left corner, width and height respectively.
 * @param area rectangle area of a image map.
 * @param imageArea image area of the image in which the image map is.
 * @return absolute position of the image map.
 */
private int[] getAbsoluteArea(int[] area,IImageArea imageArea){
  assert(intrinsic != null);
  for (int i=0; i < 4; ) {
    area[i]=getTranslatedLengthX(area[i]);
    i++;
    area[i]=getTranslatedLengthY(area[i]);
    i++;
  }
  int[] result=new int[4];
  int imageX=imageArea.getX();
  int imageY=imageArea.getY();
  int imageHeight=imageArea.getHeight();
  int imageWidth=imageArea.getWidth();
  int intrinsicWidth=intrinsic.getWidth();
  int intrinsicHeight=intrinsic.getHeight();
  float ratio=(float)imageWidth / (float)intrinsicWidth;
  result[0]=imageX + (int)(area[0] * ratio);
  result[2]=(int)(area[2] * ratio);
  ratio=(float)imageHeight / (float)intrinsicHeight;
  result[1]=imageY + (int)(area[1] * ratio);
  result[3]=(int)(area[3] * ratio);
  return result;
}
Program: 71633
Project: 71633
Buggy source:
public void dataEngineShutdown(){
  Map<ConnectionProp,Set<CacheConnection>> odaConnectionsMap=DataSource.dataEngineLevelConnectionPool.remove(this.session);
  if (odaConnectionsMap == null)   return;
  ConnectionProp connProp=new ConnectionProp(DataSource.this.driverName,DataSource.this.connectionProps,DataSource.this.appContext);
  Set<CacheConnection> odaConnections=odaConnectionsMap.get(connProp);
  if (odaConnections == null)   return;
  for (  CacheConnection conn : odaConnections) {
    try {
      conn.odaConn.close();
    }
 catch (    DataException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void dataEngineShutdown(){
  Map<ConnectionProp,Set<CacheConnection>> odaConnectionsMap=DataSource.dataEngineLevelConnectionPool.remove(this.session);
  if (odaConnectionsMap == null)   return;
  for (  Set<CacheConnection> set : odaConnectionsMap.values()) {
    for (    CacheConnection conn : set) {
      try {
        conn.odaConn.close();
      }
 catch (      DataException e) {
        e.printStackTrace();
      }
    }
  }
}
Program: 71636
Project: 71636
Buggy source:
public ReportDocumentWriter(IReportEngine engine,IDocArchiveWriter archive,String[] extensions) throws EngineException {
  this.engine=engine;
  this.archive=archive;
  if (extensions != null) {
    StringBuilder sb=new StringBuilder();
    for (    String ext : extensions) {
      sb.append(ext);
      sb.append("String_Node_Str");
    }
    if (sb.length() > 0) {
      sb.setLength(sb.length() - 1);
    }
    this.extensions=sb.toString();
  }
  try {
    archive.initialize();
    saveCoreStreams();
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public ReportDocumentWriter(IReportEngine engine,IDocArchiveWriter archive,String[] extensions) throws EngineException {
  this.engine=engine;
  this.archive=archive;
  if (extensions != null && extensions.length > 0) {
    StringBuilder sb=new StringBuilder();
    for (    String ext : extensions) {
      sb.append(ext);
      sb.append("String_Node_Str");
    }
    if (sb.length() > 0) {
      sb.setLength(sb.length() - 1);
    }
    this.extensions=sb.toString();
  }
  try {
    archive.initialize();
    saveCoreStreams();
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
  }
}
Program: 71637
Project: 71637
Buggy source:
public DummyEngineTask(ReportEngine engine,IReportRunnable runnable){
  super(engine,runnable);
}

Fixed version (ground truth):
public DummyEngineTask(ReportEngine engine,IReportRunnable runnable,ModuleHandle moduleHandle){
  super(engine,runnable);
  setEngineTaskParameters(this,moduleHandle);
}
Program: 71638
Project: 71638
Buggy source:
private java.sql.Date doValidateSqlDateTimeByPattern(String value) throws ValidationValueException {
  try {
    long time=Long.parseLong(value);
    return new java.sql.Date(time);
  }
 catch (  Exception e) {
    throw new ValidationValueException(value,PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,DesignChoiceConstants.PARAM_TYPE_DATETIME);
  }
}

Fixed version (ground truth):
private java.sql.Date doValidateSqlDateTimeByPattern(String value,String dataType) throws ValidationValueException {
  try {
    long time=Long.parseLong(value);
    return new java.sql.Date(time);
  }
 catch (  Exception e) {
    Object obj=null;
    try {
      obj=convert(value,dataType);
    }
 catch (    BirtException e1) {
    }
    if (obj instanceof java.sql.Date) {
      return (java.sql.Date)obj;
    }
    throw new ValidationValueException(value,PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,DesignChoiceConstants.PARAM_TYPE_DATETIME);
  }
}