nus-yam/ex-repair huggingface dataset:
Program: 75003
Project: 75003
Buggy source:
/** 
 * Build fragment by adding sidebar fragment root.
 */
protected void build(){
  addChild(new TocFragment());
  addChild(new DialogContainerFragment(new SimpleExportDataDialogFragment()));
  addChild(new DialogContainerFragment(new ExceptionDialogFragment()));
  addChild(new DialogContainerFragment(new ParameterDialogFragment()));
  addChild(new DialogContainerFragment(new ExportReportDialogFragment()));
  addChild(new DialogContainerFragment(new PrintReportDialogFragment()));
  addChild(new DialogContainerFragment(new ConfirmationDialogFragment()));
}

Fixed version (ground truth):
/** 
 * Build fragment by adding sidebar fragment root.
 */
protected void build(){
  addChild(new TocFragment());
  addChild(new DialogContainerFragment(new SimpleExportDataDialogFragment()));
  addChild(new DialogContainerFragment(new ExceptionDialogFragment()));
  addChild(new DialogContainerFragment(new ParameterDialogFragment()));
  addChild(new DialogContainerFragment(new ExportReportDialogFragment()));
  addChild(new DialogContainerFragment(new PrintReportDialogFragment()));
  addChild(new DialogContainerFragment(new PrintReportServerDialogFragment()));
  addChild(new DialogContainerFragment(new ConfirmationDialogFragment()));
}
Program: 75004
Project: 75004
Buggy source:
public void startContent(IContent content,IContentEmitter emitter){
  if (emitter != null) {
    ContentEmitterUtil.startContent(content,emitter);
    ContentEmitterUtil.endContent(content,emitter);
  }
}

Fixed version (ground truth):
public void startContent(IContent content,IContentEmitter emitter){
  if (isFirstContent) {
    startPageContent(content);
    isFirstContent=false;
  }
  if (emitter != null) {
    ContentEmitterUtil.startContent(content,emitter);
    ContentEmitterUtil.endContent(content,emitter);
  }
}
Program: 75005
Project: 75005
Buggy source:
public void endContainer(IContent content,boolean finished,IContentEmitter emitter){
  if (emitter != null) {
    ContentEmitterUtil.endContent(content,emitter);
  }
}

Fixed version (ground truth):
public void endContainer(IContent content,boolean finished,IContentEmitter emitter){
  if (emitter != null) {
    if (content.getContentType() == IContent.PAGE_CONTENT) {
      ContentEmitterUtil.endContent(pageContent,emitter);
    }
 else {
      ContentEmitterUtil.endContent(content,emitter);
    }
  }
}
Program: 75006
Project: 75006
Buggy source:
public void startContainer(IContent content,boolean isFirst,IContentEmitter emitter){
  if (emitter != null) {
    ContentEmitterUtil.startContent(content,emitter);
  }
}

Fixed version (ground truth):
public void startContainer(IContent content,boolean isFirst,IContentEmitter emitter){
  if (content.getContentType() == IContent.PAGE_CONTENT) {
    isFirstContent=true;
    pageContent=content;
    pageEmitter=emitter;
  }
 else {
    if (isFirstContent) {
      startPageContent(content);
      isFirstContent=false;
    }
    if (emitter != null) {
      ContentEmitterUtil.startContent(content,emitter);
    }
  }
}
Program: 75008
Project: 75008
Buggy source:
/** 
 * Clips the renderer. Need to restore the clipping after the use.
 * @param ipr
 * @param boClientArea
 */
protected final void renderClipping(final IPrimitiveRenderer ipr,final Bounds boClientArea){
  final boolean bFirstInSequence=(iSeriesIndex == 1);
  if (bFirstInSequence && !isDimension3D() && !isShowOutside()) {
    ClipRenderEvent clip=new ClipRenderEvent(this);
    Location[] locations=new Location[4];
    locations[0]=LocationImpl.create(boClientArea.getLeft(),boClientArea.getTop());
    locations[1]=LocationImpl.create(boClientArea.getLeft(),boClientArea.getTop() + boClientArea.getHeight());
    locations[2]=LocationImpl.create(boClientArea.getLeft() + boClientArea.getWidth(),boClientArea.getTop() + boClientArea.getHeight());
    locations[3]=LocationImpl.create(boClientArea.getLeft() + boClientArea.getWidth(),boClientArea.getTop());
    clip.setVertices(locations);
    ipr.setClip(clip);
  }
}

Fixed version (ground truth):
/** 
 * Clips the renderer. Need to restore the clipping after the use.
 * @param ipr
 * @param boClientArea
 */
protected final void renderClipping(final IPrimitiveRenderer ipr,final Bounds boClientArea){
  final boolean bFirstInSequence=(iSeriesIndex == 1);
  if (bFirstInSequence && !isDimension3D() && (!isShowOutside() || !baseIsShowOutside())) {
    ClipRenderEvent clip=new ClipRenderEvent(this);
    Location[] locations=new Location[4];
    locations[0]=LocationImpl.create(boClientArea.getLeft(),boClientArea.getTop());
    locations[1]=LocationImpl.create(boClientArea.getLeft(),boClientArea.getTop() + boClientArea.getHeight());
    locations[2]=LocationImpl.create(boClientArea.getLeft() + boClientArea.getWidth(),boClientArea.getTop() + boClientArea.getHeight());
    locations[3]=LocationImpl.create(boClientArea.getLeft() + boClientArea.getWidth(),boClientArea.getTop());
    clip.setVertices(locations);
    ipr.setClip(clip);
  }
}
Program: 75009
Project: 75009
Buggy source:
/** 
 * Flushes render event of all Series before clipping
 * @throws ChartException
 */
protected void flushClipping() throws ChartException {
  getDeferredCache().flushOptions(DeferredCache.FLUSH_LINE | DeferredCache.FLUSH_PLANE);
}

Fixed version (ground truth):
/** 
 * Flushes render event of all Series before clipping
 * @throws ChartException
 */
protected void flushClipping() throws ChartException {
  getDeferredCacheManager().flushOptions(DeferredCache.FLUSH_LINE | DeferredCache.FLUSH_PLANE);
}
Program: 75010
Project: 75010
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()) {
    flushClipping();
    ClipRenderEvent clip=new ClipRenderEvent(this);
    clip.setVertices(null);
    ipr.setClip(clip);
  }
}

Fixed version (ground truth):
/** 
 * Restores the clipping
 * @param ipr
 * @throws ChartException
 */
protected void restoreClipping(final IPrimitiveRenderer ipr) throws ChartException {
  final boolean bLastInSequence=(iSeriesIndex == iSeriesCount - 1);
  if (bLastInSequence && !isDimension3D() && (!isShowOutside() || !baseIsShowOutside())) {
    flushClipping();
    ClipRenderEvent clip=new ClipRenderEvent(this);
    clip.setVertices(null);
    ipr.setClip(clip);
  }
}
Program: 75011
Project: 75011
Buggy source:
/** 
 * Flush all <code>DeferredCache</code> in the mananger.
 * @throws ChartException
 */
public void flushAll() throws ChartException {
  fFirstDC.flushOptions(DeferredCache.FLUSH_PLANE_SHADOW | DeferredCache.FLUSH_PLANE | DeferredCache.FLUSH_LINE| DeferredCache.FLUSH_3D);
  for (java.util.Iterator iter=fDeferredCacheList.iterator(); iter.hasNext(); ) {
    Object obj=iter.next();
    if (obj instanceof DeferredCache) {
      ((DeferredCache)obj).flushOptions(DeferredCache.FLUSH_PLANE_SHADOW | DeferredCache.FLUSH_PLANE | DeferredCache.FLUSH_LINE| DeferredCache.FLUSH_3D);
    }
  }
  fLastDC.flushOptions(DeferredCache.FLUSH_PLANE_SHADOW | DeferredCache.FLUSH_PLANE | DeferredCache.FLUSH_LINE| DeferredCache.FLUSH_3D);
  flushMarkersNLabels();
  clearDC();
}

Fixed version (ground truth):
/** 
 * Flush all <code>DeferredCache</code> in the mananger.
 * @throws ChartException
 */
public void flushAll() throws ChartException {
  int options=DeferredCache.FLUSH_PLANE_SHADOW | DeferredCache.FLUSH_PLANE | DeferredCache.FLUSH_LINE| DeferredCache.FLUSH_3D;
  flushOptions(options);
  flushMarkersNLabels();
  clearDC();
}
Program: 75012
Project: 75012
Buggy source:
/** 
 * Updates the current selected entry with the specified fill
 * @param cdi
 */
public final void updateSelectionFill(Fill f){
  if (iSelectedIndex == -1) {
    return;
  }
  elPaletteEntries1.set(iSelectedIndex,f);
  if (vSeriesDefns != null) {
    int size=elPaletteEntries1.size();
    for (int i=0; i < vSeriesDefns.length; i++) {
      if ((iSelectedIndex - i) >= 0) {
        vSeriesDefns[i].getSeriesPalette().getEntries().set(iSelectedIndex - i,EcoreUtil.copy(f));
      }
 else {
        int index=size - i + iSelectedIndex;
        while (index < 0) {
          index+=size;
        }
        vSeriesDefns[i].getSeriesPalette().getEntries().set(index,EcoreUtil.copy(f));
      }
    }
  }
  coPaletteEntries.redraw();
}

Fixed version (ground truth):
/** 
 * Updates the current selected entry with the specified fill
 * @param cdi
 */
public final void updateSelectionFill(Fill f){
  if (iSelectedIndex == -1) {
    return;
  }
  elPaletteEntries1.set(iSelectedIndex,f);
  if (vSeriesDefns != null) {
    int size=elPaletteEntries1.size();
    for (int i=0; i < vSeriesDefns.length; i++) {
      if ((iSelectedIndex - i) >= 0) {
        vSeriesDefns[i].getSeriesPalette().getEntries().set(iSelectedIndex - i,EcoreUtil.copy(f));
      }
 else {
        int index=size - i + iSelectedIndex;
        while (index < 0) {
          index+=size;
        }
        if (index < vSeriesDefns[i].getSeriesPalette().getEntries().size()) {
          vSeriesDefns[i].getSeriesPalette().getEntries().set(index,EcoreUtil.copy(f));
        }
      }
    }
  }
  coPaletteEntries.redraw();
}
Program: 75013
Project: 75013
Buggy source:
protected void setState(){
  boolean bEnabled=!(getAxisForProcessing().isCategoryAxis() || getAxisForProcessing().getType() == AxisType.TEXT_LITERAL);
  setState(bEnabled);
  if (axisAngleType != AngleType.Y) {
    btnShowOutside.setEnabled(false);
  }
}

Fixed version (ground truth):
protected void setState(){
  boolean bEnabled=!(getAxisForProcessing().isCategoryAxis() || getAxisForProcessing().getType() == AxisType.TEXT_LITERAL);
  setState(bEnabled);
  if (axisAngleType != AngleType.Y) {
    btnShowOutside.setEnabled(false);
    btnShowOutside.setSelection(false);
    getScale().setShowOutside(false);
  }
}
Program: 75016
Project: 75016
Buggy source:
public IReportItemExecutor getNextChild(){
  if (childIterator.hasNext()) {
    IContent child=(IContent)childIterator.next();
    return manager.createExecutor(child);
  }
  return null;
}

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

Fixed version (ground truth):
public IContent execute(){
  if (null == content) {
    return null;
  }
  childIterator=content.getChildren().iterator();
  return content;
}
Program: 75018
Project: 75018
Buggy source:
public boolean hasNextChild(){
  return childIterator.hasNext();
}

Fixed version (ground truth):
public boolean hasNextChild(){
  if (null == childIterator) {
    return false;
  }
  return childIterator.hasNext();
}
Program: 75021
Project: 75021
Buggy source:
public void endContainer(IContent content,boolean finished,IContentEmitter emitter){
  if (emitter != null) {
    if (content.getContentType() == IContent.PAGE_CONTENT) {
      ContentEmitterUtil.endContent(pageContent,emitter);
    }
 else {
      ContentEmitterUtil.endContent(content,emitter);
    }
  }
}

Fixed version (ground truth):
public void endContainer(IContent content,boolean finished,IContentEmitter emitter){
  if (isFirstContent) {
    startPageContent(content);
    isFirstContent=false;
  }
  if (emitter != null) {
    if (content.getContentType() == IContent.PAGE_CONTENT) {
      ContentEmitterUtil.endContent(pageContent,emitter);
    }
 else {
      ContentEmitterUtil.endContent(content,emitter);
    }
  }
}
Program: 75022
Project: 75022
Buggy source:
/** 
 * @throws Exception
 */
public void testEstablishDataGroup() throws Exception {
  openDesign("String_Node_Str");
  TableHandle table2=(TableHandle)designHandle.findElement("String_Node_Str");
  TableHandle table1=(TableHandle)designHandle.findElement("String_Node_Str");
  table2.setDataBindingReference(table1);
  save();
  compareFile("String_Node_Str");
  designHandle.getCommandStack().undo();
  save();
  compareFile("String_Node_Str");
  designHandle.getCommandStack().redo();
  save();
  compareFile("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @throws Exception
 */
public void testEstablishDataGroup() throws Exception {
  openDesign("String_Node_Str");
  TableHandle table2=(TableHandle)designHandle.findElement("String_Node_Str");
  TableHandle table1=(TableHandle)designHandle.findElement("String_Node_Str");
  table2.setDataBindingReference(table1);
  save();
  compareFile("String_Node_Str");
  designHandle.getCommandStack().undo();
  save();
  compareFile("String_Node_Str");
  designHandle.getCommandStack().redo();
  save();
  compareFile("String_Node_Str");
  table2.setDataBindingReference(null);
  save();
  compareFile("String_Node_Str");
  designHandle.getCommandStack().undo();
  save();
  compareFile("String_Node_Str");
  table2.setDataBindingReference(designHandle.getElementFactory().newTableItem("String_Node_Str"));
  save();
  compareFile("String_Node_Str");
}
Program: 75024
Project: 75024
Buggy source:
public void writeText(String txt){
  writer.openTag("String_Node_Str");
  try {
    Integer.parseInt(txt);
    writer.attribute("String_Node_Str","String_Node_Str");
  }
 catch (  Exception e) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
  writer.text(txt);
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
public void writeText(String txt){
  writer.openTag("String_Node_Str");
  try {
    new java.math.BigDecimal(txt);
    writer.attribute("String_Node_Str","String_Node_Str");
  }
 catch (  Exception e) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
  writer.text(txt);
  writer.closeTag("String_Node_Str");
}
Program: 75025
Project: 75025
Buggy source:
protected boolean isRootEmpty(){
  if (isLast) {
    return false;
  }
  return super.isRootEmpty();
}

Fixed version (ground truth):
protected boolean isRootEmpty(){
  if (isLast) {
    return false;
  }
  if (parent.root != null && parent.root.getChildrenCount() > 0) {
    return false;
  }
  return super.isRootEmpty();
}
Program: 75026
Project: 75026
Buggy source:
/** 
 * @param queryDefn
 * @throws AdapterException
 * @throws BirtException
 */
private void defineDataSourceDataSet(QueryDefinition queryDefn) throws AdapterException, BirtException {
  String dataSetName=queryDefn.getDataSetName();
  ModuleHandle module=sessionContext.getModuleHandle();
  if (module != null) {
    List l=module.getAllDataSets();
    DataSetHandle handle=null;
    for (int i=0; i < l.size(); i++) {
      if (((DataSetHandle)l.get(i)).getQualifiedName() != null && ((DataSetHandle)l.get(i)).getQualifiedName().equals(dataSetName)) {
        handle=(DataSetHandle)l.get(i);
      }
    }
    defineDataSet(handle);
  }
}

Fixed version (ground truth):
/** 
 * @param queryDefn
 * @throws AdapterException
 * @throws BirtException
 */
private void defineDataSourceDataSet(QueryDefinition queryDefn) throws AdapterException, BirtException {
  String dataSetName=queryDefn.getDataSetName();
  ModuleHandle module=sessionContext.getModuleHandle();
  if (module != null) {
    List l=module.getAllDataSets();
    DataSetHandle handle=null;
    for (int i=0; i < l.size(); i++) {
      if (((DataSetHandle)l.get(i)).getQualifiedName() != null && ((DataSetHandle)l.get(i)).getQualifiedName().equals(dataSetName)) {
        handle=(DataSetHandle)l.get(i);
      }
    }
    major=handle;
    defineDataSet(handle);
  }
}
Program: 75027
Project: 75027
Buggy source:
/** 
 * @param dataSetName
 * @throws AdapterException
 * @throws BirtException
 */
private void defineDataSet(DataSetHandle handle) throws AdapterException, BirtException {
  if (handle == null)   throw new AdapterException(ResourceConstants.DATASETHANDLE_NULL_ERROR);
  DataSourceHandle dataSourceHandle=handle.getDataSource();
  if (dataSourceHandle != null) {
    IBaseDataSourceDesign dsourceDesign=this.modelAdaptor.adaptDataSource(dataSourceHandle);
    dataEngine.defineDataSource(dsourceDesign);
  }
  if (handle instanceof JointDataSetHandle) {
    defineSourceDataSets((JointDataSetHandle)handle);
  }
  BaseDataSetDesign baseDS=this.modelAdaptor.adaptDataSet(handle);
  if (useResultHints == false)   baseDS.getResultSetHints().clear();
  dataEngine.defineDataSet(baseDS);
}

Fixed version (ground truth):
/** 
 * @param dataSetName
 * @throws AdapterException
 * @throws BirtException
 */
private void defineDataSet(DataSetHandle handle) throws AdapterException, BirtException {
  if (handle == null)   throw new AdapterException(ResourceConstants.DATASETHANDLE_NULL_ERROR);
  DataSourceHandle dataSourceHandle=handle.getDataSource();
  if (dataSourceHandle != null) {
    IBaseDataSourceDesign dsourceDesign=this.modelAdaptor.adaptDataSource(dataSourceHandle);
    dataEngine.defineDataSource(dsourceDesign);
  }
  if (handle instanceof JointDataSetHandle) {
    defineSourceDataSets((JointDataSetHandle)handle);
  }
  BaseDataSetDesign baseDS=this.modelAdaptor.adaptDataSet(handle);
  if (useResultHints == false && handle.equals(major)) {
    baseDS.getResultSetHints().clear();
  }
  dataEngine.defineDataSet(baseDS);
}
Program: 75028
Project: 75028
Buggy source:
private void refreshDataPointButtons(){
  btnFormatSpecifier.setEnabled(lstComponents.getSelectionIndex() != -1);
  btnRemoveComponent.setEnabled(lstComponents.getSelectionIndex() != -1);
  if (btnFormatSpecifier.isEnabled()) {
    DataPointComponentType dpct=DataPointComponentType.getByName(LiteralHelper.dataPointComponentTypeSet.getNameByDisplayName(lstComponents.getItem(lstComponents.getSelectionIndex())));
    btnFormatSpecifier.setEnabled(dpct != DataPointComponentType.SERIES_VALUE_LITERAL);
  }
}

Fixed version (ground truth):
private void refreshDataPointButtons(){
  btnRemoveComponent.setEnabled(lstComponents.getSelectionIndex() != -1);
  boolean formatEnable=(lstComponents.getSelectionIndex() != -1);
  if (formatEnable) {
    DataPointComponentType dpct=DataPointComponentType.getByName(LiteralHelper.dataPointComponentTypeSet.getNameByDisplayName(lstComponents.getItem(lstComponents.getSelectionIndex())));
    if (dpct == DataPointComponentType.SERIES_VALUE_LITERAL) {
      formatEnable=false;
    }
 else     if (getAxisType(dpct) == AxisType.TEXT_LITERAL) {
      formatEnable=false;
    }
  }
  btnFormatSpecifier.setEnabled(formatEnable);
}
Program: 75029
Project: 75029
Buggy source:
private void setDataPointComponentFormatSpecifier(int iComponentIndex){
  DataPointComponent dpc=(DataPointComponent)getSeriesForProcessing().getDataPoint().getComponents().get(getIndexOfListItem(iComponentIndex));
  FormatSpecifier formatspecifier=dpc.getFormatSpecifier();
  String sContext=new MessageFormat(Messages.getString("String_Node_Str")).format(new Object[]{dpc.getType().getName()});
  if (sContext == null) {
    sContext=Messages.getString("String_Node_Str");
  }
  FormatSpecifierDialog editor=new FormatSpecifierDialog(cmpContent.getShell(),formatspecifier,sContext);
  if (editor.open() == Window.OK) {
    if (editor.getFormatSpecifier() == null) {
      dpc.eUnset(AttributePackage.eINSTANCE.getDataPointComponent_FormatSpecifier());
      return;
    }
    dpc.setFormatSpecifier(editor.getFormatSpecifier());
  }
}

Fixed version (ground truth):
private void setDataPointComponentFormatSpecifier(int iComponentIndex){
  DataPointComponent dpc=(DataPointComponent)getSeriesForProcessing().getDataPoint().getComponents().get(getIndexOfListItem(iComponentIndex));
  FormatSpecifier formatspecifier=dpc.getFormatSpecifier();
  String sContext=new MessageFormat(Messages.getString("String_Node_Str")).format(new Object[]{dpc.getType().getName()});
  if (sContext == null) {
    sContext=Messages.getString("String_Node_Str");
  }
  FormatSpecifierDialog editor=null;
  if (getAxisType(dpc.getType()) == AxisType.DATE_TIME_LITERAL) {
    editor=new FormatSpecifierDialog(cmpContent.getShell(),formatspecifier,AxisType.DATE_TIME_LITERAL,sContext);
  }
 else {
    editor=new FormatSpecifierDialog(cmpContent.getShell(),formatspecifier,sContext);
  }
  if (editor.open() == Window.OK) {
    if (editor.getFormatSpecifier() == null) {
      dpc.eUnset(AttributePackage.eINSTANCE.getDataPointComponent_FormatSpecifier());
      return;
    }
    dpc.setFormatSpecifier(editor.getFormatSpecifier());
  }
}
Program: 75030
Project: 75030
Buggy source:
/** 
 * Convert IGroupDefn to IQuery.GroupSpec
 * @param cx
 * @param src
 * @return
 * @throws DataException
 */
static IQuery.GroupSpec groupDefnToSpec(Context cx,IGroupDefinition src,String expr,String columnName,int index) throws DataException {
  ColumnInfo groupKeyInfo=new ColumnInfo(index,columnName);
  int groupIndex=groupKeyInfo.getColumnIndex();
  String groupKey=groupKeyInfo.getColumnName();
  boolean isComplexExpression=true;
  IQuery.GroupSpec dest=new IQuery.GroupSpec(groupIndex,groupKey);
  dest.setName(src.getName());
  dest.setInterval(src.getInterval());
  dest.setIntervalRange(src.getIntervalRange());
  dest.setIntervalStart(src.getIntervalStart());
  dest.setFilters(src.getFilters());
  if (src.getSorts().size() == 0) {
    List sorts=new ArrayList();
    SortDefinition sd=new SortDefinition();
    sd.setExpression(expr);
    sd.setSortDirection(src.getSortDirection() != ISortDefinition.SORT_DESC ? ISortDefinition.SORT_ASC : ISortDefinition.SORT_DESC);
    sorts.add(sd);
    dest.setSorts(sorts);
  }
 else {
    dest.setSorts(src.getSorts());
  }
  dest.setIsComplexExpression(isComplexExpression);
  return dest;
}

Fixed version (ground truth):
/** 
 * Convert IGroupDefn to IQuery.GroupSpec
 * @param cx
 * @param src
 * @return
 * @throws DataException
 */
static IQuery.GroupSpec groupDefnToSpec(Context cx,IGroupDefinition src,String expr,String columnName,int index) throws DataException {
  ColumnInfo groupKeyInfo=new ColumnInfo(index,columnName);
  int groupIndex=groupKeyInfo.getColumnIndex();
  String groupKey=groupKeyInfo.getColumnName();
  boolean isComplexExpression=true;
  IQuery.GroupSpec dest=new IQuery.GroupSpec(groupIndex,groupKey);
  dest.setName(src.getName());
  dest.setInterval(src.getInterval());
  dest.setIntervalRange(src.getIntervalRange());
  dest.setIntervalStart(src.getIntervalStart());
  dest.setSortDirection(src.getSortDirection() != ISortDefinition.SORT_DESC ? ISortDefinition.SORT_ASC : ISortDefinition.SORT_DESC);
  dest.setFilters(src.getFilters());
  if (src.getSorts().size() != 0) {
    dest.setSorts(src.getSorts());
  }
  dest.setIsComplexExpression(isComplexExpression);
  return dest;
}
Program: 75031
Project: 75031
Buggy source:
public boolean layoutChildren(){
  if (root == null) {
    return false;
  }
  assert(parent instanceof ILineStackingLayoutManager);
  ILineStackingLayoutManager lineParent=(ILineStackingLayoutManager)parent;
  if (root.getAllocatedHeight() > lineParent.getCurrentMaxContentHeight()) {
    if (!parent.isPageEmpty()) {
      return true;
    }
 else {
      root.setAllocatedHeight(lineParent.getCurrentMaxContentHeight());
      parent.addArea(root,false,false);
      return false;
    }
  }
 else {
    if (parent.getCurrentIP() + root.getAllocatedWidth() > maxWidth) {
      if (!lineParent.isEmptyLine()) {
        boolean ret=lineParent.endLine();
        assert(ret);
        return layoutChildren();
      }
 else {
        parent.addArea(root,false,false);
        return false;
      }
    }
 else {
      parent.addArea(root,false,false);
      return false;
    }
  }
}

Fixed version (ground truth):
public boolean layoutChildren(){
  if (root == null) {
    return false;
  }
  assert(parent instanceof ILineStackingLayoutManager);
  ILineStackingLayoutManager lineParent=(ILineStackingLayoutManager)parent;
  if (root.getAllocatedHeight() > lineParent.getCurrentMaxContentHeight()) {
    if (!parent.isPageEmpty()) {
      context.setAutoPageBreak(true);
      return true;
    }
 else {
      root.setAllocatedHeight(lineParent.getCurrentMaxContentHeight());
      parent.addArea(root,false,false);
      return false;
    }
  }
 else {
    if (parent.getCurrentIP() + root.getAllocatedWidth() > maxWidth) {
      if (!lineParent.isEmptyLine()) {
        boolean ret=lineParent.endLine();
        assert(ret);
        return layoutChildren();
      }
 else {
        parent.addArea(root,false,false);
        return false;
      }
    }
 else {
      parent.addArea(root,false,false);
      return false;
    }
  }
}
Program: 75033
Project: 75033
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(org.eclipse.birt.report.engine.emitter.postscript.PostScriptRenderTest.class);
  suite.addTestSuite(org.eclipse.birt.report.engine.emitter.postscript.util.BackgroundImageLayoutTest.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(org.eclipse.birt.report.engine.emitter.postscript.PostScriptRenderTest.class);
  return suite;
}
Program: 75035
Project: 75035
Buggy source:
/** 
 * Cancel the current engine task by task id
 * @param request
 * @param taskid
 * @throws Exception
 */
public static void cancelTask(HttpServletRequest request,String taskid) throws Exception {
  if (taskid == null)   return;
  HttpSession session=request.getSession();
  if (session == null)   return;
  Map map=(Map)session.getAttribute(IBirtConstants.TASK_MAP);
  if (map != null && map.containsKey(taskid)) {
    BaseTaskBean bean=(BaseTaskBean)map.get(taskid);
    if (bean == null)     return;
    IEngineTask task=bean.getTask();
    if (task != null) {
      task.cancel();
      task.close();
    }
synchronized (map) {
      map.remove(taskid);
    }
  }
}

Fixed version (ground truth):
/** 
 * Cancel the current engine task by task id
 * @param request
 * @param taskid
 * @throws Exception
 */
public static void cancelTask(HttpServletRequest request,String taskid) throws Exception {
  if (taskid == null)   return;
  HttpSession session=request.getSession();
  if (session == null)   return;
  Map map=(Map)session.getAttribute(IBirtConstants.TASK_MAP);
  if (map != null && map.containsKey(taskid)) {
    BaseTaskBean bean=(BaseTaskBean)map.get(taskid);
    if (bean == null)     return;
    IEngineTask task=bean.getTask();
    if (task != null) {
      task.cancel();
    }
synchronized (map) {
      map.remove(taskid);
    }
  }
}
Program: 75036
Project: 75036
Buggy source:
/** 
 * Build the style of foreign content.
 */
public void buildForeignStyle(IForeignContent foreign,StringBuffer styleBuffer,int display,String url){
  IStyle style=foreign.getStyle();
  handleShrink(display,style,foreign.getHeight(),foreign.getWidth(),styleBuffer);
  if (url != null) {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_BLOCK | HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
 else {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
  style=getElementStyle(foreign);
  if (style == null) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
  AttributeBuilder.buildTextDecoration(styleBuffer,style);
  String textAlign=style.getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Build the style of foreign content.
 */
public void buildForeignStyle(IForeignContent foreign,StringBuffer styleBuffer,int display,String url){
  IStyle style=foreign.getStyle();
  handleShrink(display,style,foreign.getHeight(),foreign.getWidth(),styleBuffer);
  if (url != null) {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_BLOCK | HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
 else {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
  String textAlign=style.getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
  style=getElementStyle(foreign);
  if (style == null) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
  AttributeBuilder.buildTextDecoration(styleBuffer,style);
}
Program: 75037
Project: 75037
Buggy source:
/** 
 * Build the style of text content.
 */
public void buildTextStyle(ITextContent text,StringBuffer styleBuffer,int display,String url){
  IStyle style=text.getStyle();
  handleShrink(display,style,text.getHeight(),text.getWidth(),styleBuffer);
  if (url != null) {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_BLOCK | HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
 else {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
  style=getElementStyle(text);
  if (style == null) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
  AttributeBuilder.buildTextDecoration(styleBuffer,style);
  String textAlign=style.getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Build the style of text content.
 */
public void buildTextStyle(ITextContent text,StringBuffer styleBuffer,int display,String url){
  IStyle style=text.getStyle();
  handleShrink(display,style,text.getHeight(),text.getWidth(),styleBuffer);
  if (url != null) {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_BLOCK | HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
 else {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
  String textAlign=style.getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
  style=getElementStyle(text);
  if (style == null) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
  AttributeBuilder.buildTextDecoration(styleBuffer,style);
}
Program: 75038
Project: 75038
Buggy source:
/** 
 * Build the style of text content.
 */
public void buildTextStyle(ITextContent text,StringBuffer styleBuffer,int display,String url){
  IStyle style=text.getStyle();
  handleShrink(display,style,text.getHeight(),text.getWidth(),styleBuffer);
  if (url != null) {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_BLOCK | HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
 else {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
  IStyle textComputedStyle=text.getComputedStyle();
  if (null != textComputedStyle) {
    AttributeBuilder.buildTextDecoration(styleBuffer,textComputedStyle);
  }
  style=getElementStyle(text);
  if (style == null) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
  String textAlign=style.getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Build the style of text content.
 */
public void buildTextStyle(ITextContent text,StringBuffer styleBuffer,int display,String url){
  IStyle style=text.getStyle();
  handleShrink(display,style,text.getHeight(),text.getWidth(),styleBuffer);
  if (url != null) {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_BLOCK | HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
 else {
    setDisplayProperty(display,HTMLEmitterUtil.DISPLAY_INLINE_BLOCK,styleBuffer);
  }
  IStyle textComputedStyle=text.getComputedStyle();
  if (null != textComputedStyle) {
    AttributeBuilder.buildTextDecoration(styleBuffer,textComputedStyle);
  }
  String textAlign=style.getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
  style=getElementStyle(text);
  if (style == null) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
}
Program: 75039
Project: 75039
Buggy source:
/** 
 * end output the content
 */
protected void end(){
  if (emitter != null) {
    ContentEmitterUtil.endContent(content,emitter);
  }
}

Fixed version (ground truth):
protected abstract void end(boolean finished);
Program: 75040
Project: 75040
Buggy source:
/** 
 * output the content.
 */
protected abstract void start();

Fixed version (ground truth):
protected abstract void start(boolean isFirst);
Program: 75041
Project: 75041
Buggy source:
/** 
 * layout the content and its children. It can be called in three status: 1. start, the first time it is called, in this status, it first check if it need page-break-before, 2. inprogress, the second or more time it is called. In this status, it tries to layout the content and its children to the current page. 3. end, the last time it is called. In this status, it means all the content has been layout, it is the time to handle the page-break-after.
 */
public boolean layout(){
switch (status) {
case STATUS_INTIALIZE:
    if (handleVisibility()) {
      status=STATUS_END;
      return false;
    }
  if (isPageBreakBefore()) {
    status=STATUS_START;
    context.endContentWithPageBreak(null);
    return true;
  }
case STATUS_START:
context.startContent(content);
case STATUS_INPROGRESS:
if (status == STATUS_INPROGRESS) {
context.continueContent(content);
}
start();
boolean hasNext=layoutChildren();
end();
if (isChildrenFinished()) {
status=STATUS_END;
}
 else {
status=STATUS_INPROGRESS;
}
if (hasNext) {
context.endContentWithPageBreak(content);
return true;
}
context.endContent(content);
if (isPageBreakAfter()) {
return true;
}
return false;
}
return false;
}

Fixed version (ground truth):
/** 
 * layout the content and its children. It can be called in three status: 1. start, the first time it is called, in this status, it first check if it need page-break-before, 2. inprogress, the second or more time it is called. In this status, it tries to layout the content and its children to the current page. 3. end, the last time it is called. In this status, it means all the content has been layout, it is the time to handle the page-break-after.
 */
public boolean layout(){
switch (status) {
case STATUS_INTIALIZE:
    if (handleVisibility()) {
      status=STATUS_END;
      return false;
    }
  if (isPageBreakBefore()) {
    status=STATUS_START;
    return true;
  }
case STATUS_START:
case STATUS_INPROGRESS:
start(status == STATUS_START || status == STATUS_INTIALIZE);
boolean hasNext=layoutChildren();
end(!hasNext);
if (isChildrenFinished()) {
status=STATUS_END;
}
 else {
status=STATUS_INPROGRESS;
}
if (hasNext) {
return true;
}
if (isPageBreakAfter()) {
return true;
}
return false;
}
return false;
}
Program: 75042
Project: 75042
Buggy source:
protected boolean layoutChildren(){
  repeatHeader();
  boolean hasNext=super.layoutChildren();
  if (hasNext) {
    context.addLayoutHint(content,!hasNext);
  }
  return hasNext;
}

Fixed version (ground truth):
protected boolean layoutChildren(){
  repeatHeader();
  boolean hasNext=super.layoutChildren();
  return hasNext;
}
Program: 75043
Project: 75043
Buggy source:
protected void repeatHeader(){
  if (!isFirstLayout) {
    IGroupContent group=(IGroupContent)content;
    IBandContent header=group.getHeader();
    if (group.isHeaderRepeat() && header != null) {
      boolean pageBreak=context.allowPageBreak();
      boolean isEmpty=context.isPageEmpty();
      context.setPageEmpty(true);
      context.setAllowPageBreak(false);
      engine.layout(this,header,emitter);
      context.setAllowPageBreak(pageBreak);
      context.setPageEmpty(isEmpty);
      context.continueContent(null);
    }
  }
  isFirstLayout=false;
}

Fixed version (ground truth):
protected void repeatHeader(){
  if (!isFirstLayout) {
    IGroupContent group=(IGroupContent)content;
    IBandContent header=group.getHeader();
    if (group.isHeaderRepeat() && header != null) {
      boolean pageBreak=context.allowPageBreak();
      context.setAllowPageBreak(false);
      IPageBuffer buffer=context.getPageBufferManager();
      boolean isRepeated=buffer.isRepeated();
      buffer.setRepeated(true);
      engine.layout(this,header,emitter);
      buffer.setRepeated(isRepeated);
      context.setAllowPageBreak(pageBreak);
    }
  }
  isFirstLayout=false;
}
Program: 75044
Project: 75044
Buggy source:
/** 
 * layout the children, return if it should create a  new page after this layout.
 * @return
 */
protected boolean resumeLayout(){
  boolean hasNextPage=false;
  for (int i=0; i < childrenLayouts.size(); i++) {
    boolean childFinished=((Boolean)childrenFinished.get(i)).booleanValue();
    if (!childFinished) {
      ILayoutManager childLayout=(ILayoutManager)childrenLayouts.get(i);
      boolean childHasNewPage=childLayout.layout();
      if (childHasNewPage) {
        hasNextPage=true;
      }
      childFinished=childLayout.isFinished();
      if (childFinished) {
        childLayout.close();
        IReportItemExecutor childExecutor=(IReportItemExecutor)childrenExecutors.get(i);
        childExecutor.close();
      }
      childrenFinished.set(i,Boolean.valueOf(childFinished));
    }
 else {
      context.skipContent(null);
    }
  }
  return hasNextPage;
}

Fixed version (ground truth):
/** 
 * layout the children, return if it should create a  new page after this layout.
 * @return
 */
protected boolean resumeLayout(){
  boolean hasNextPage=false;
  for (int i=0; i < childrenLayouts.size(); i++) {
    boolean childFinished=((Boolean)childrenFinished.get(i)).booleanValue();
    if (!childFinished) {
      ILayoutManager childLayout=(ILayoutManager)childrenLayouts.get(i);
      boolean childHasNewPage=childLayout.layout();
      if (childHasNewPage) {
        hasNextPage=true;
      }
      childFinished=childLayout.isFinished();
      if (childFinished) {
        childLayout.close();
        IReportItemExecutor childExecutor=(IReportItemExecutor)childrenExecutors.get(i);
        childExecutor.close();
      }
      childrenFinished.set(i,Boolean.valueOf(childFinished));
    }
  }
  return hasNextPage;
}
Program: 75046
Project: 75046
Buggy source:
/** 
 * Returns oda type name
 * @param odaTypeCode
 * @return
 */
public static String getOdaTypeName(int odaTypeCode){
switch (odaTypeCode) {
case Types.INTEGER:
    return "String_Node_Str";
case Types.DOUBLE:
  return "String_Node_Str";
case Types.VARCHAR:
return "String_Node_Str";
case Types.DATE:
return "String_Node_Str";
case Types.TIME:
return "String_Node_Str";
case Types.TIMESTAMP:
return "String_Node_Str";
case Types.NUMERIC:
return "String_Node_Str";
case Types.BLOB:
return "String_Node_Str";
case Types.CLOB:
return "String_Node_Str";
default :
return "String_Node_Str";
}
}

Fixed version (ground truth):
/** 
 * Returns oda type name
 * @param odaTypeCode
 * @return
 */
public static String getOdaTypeName(int odaTypeCode){
switch (odaTypeCode) {
case Types.INTEGER:
    return "String_Node_Str";
case Types.DOUBLE:
case Types.FLOAT:
  return "String_Node_Str";
case Types.VARCHAR:
return "String_Node_Str";
case Types.DATE:
return "String_Node_Str";
case Types.TIME:
return "String_Node_Str";
case Types.TIMESTAMP:
return "String_Node_Str";
case Types.NUMERIC:
case Types.DECIMAL:
return "String_Node_Str";
case Types.BLOB:
return "String_Node_Str";
case Types.CLOB:
return "String_Node_Str";
case Types.BOOLEAN:
return "String_Node_Str";
default :
return "String_Node_Str";
}
}
Program: 75047
Project: 75047
Buggy source:
/** 
 * Look for the Driver from drivers directory if it not in plugin class path
 * @param className
 * @return Driver instance
 * @throws JDBCException
 */
private Driver findDriver(String className) throws JDBCException {
  Class driverClass=null;
  boolean driverInClassPath=false;
  try {
    Class.forName(className);
    logger.info("String_Node_Str" + className);
    driverInClassPath=true;
  }
 catch (  ClassNotFoundException e) {
    if (logger.isLoggable(Level.FINE)) {
      logger.info("String_Node_Str" + className + "String_Node_Str");
    }
    driverClass=loadExtraDriver(className,true);
    if (driverClass == null) {
      logger.warning("String_Node_Str" + className);
      throw new JDBCException(ResourceConstants.CANNOT_LOAD_DRIVER,null,className);
    }
  }
  Driver driver=null;
  try {
    driver=(Driver)driverClass.newInstance();
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str" + className,e);
    throw new JDBCException(ResourceConstants.CANNOT_INSTANTIATE_DRIVER,null,className);
  }
  return driver;
}

Fixed version (ground truth):
/** 
 * Look for the Driver from drivers directory if it not in plugin class path
 * @param className
 * @return Driver instance
 * @throws JDBCException
 */
private Driver findDriver(String className) throws JDBCException {
  Class driverClass=null;
  boolean driverInClassPath=false;
  try {
    driverClass=Class.forName(className);
    logger.info("String_Node_Str" + className);
    driverInClassPath=true;
  }
 catch (  ClassNotFoundException e) {
    if (logger.isLoggable(Level.FINE)) {
      logger.info("String_Node_Str" + className + "String_Node_Str");
    }
    driverClass=loadExtraDriver(className,true);
    if (driverClass == null) {
      logger.warning("String_Node_Str" + className);
      throw new JDBCException(ResourceConstants.CANNOT_LOAD_DRIVER,null,className);
    }
  }
  Driver driver=null;
  try {
    driver=(Driver)driverClass.newInstance();
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str" + className,e);
    throw new JDBCException(ResourceConstants.CANNOT_INSTANTIATE_DRIVER,null,className);
  }
  return driver;
}
Program: 75048
Project: 75048
Buggy source:
protected Object getRenderContext(IReportContext context){
  Map appContext=context.getAppContext();
  if (appContext != null) {
    String renderContextKey=EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT;
    String format=context.getOutputFormat();
    if ("String_Node_Str".equalsIgnoreCase(format)) {
      renderContextKey=EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT;
    }
    return appContext.get(renderContextKey);
  }
  return null;
}

Fixed version (ground truth):
protected Object getRenderContext(IReportContext context){
  if (context == null) {
    return null;
  }
  Map appContext=context.getAppContext();
  if (appContext != null) {
    String renderContextKey=EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT;
    String format=context.getOutputFormat();
    if ("String_Node_Str".equalsIgnoreCase(format)) {
      renderContextKey=EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT;
    }
    return appContext.get(renderContextKey);
  }
  return null;
}
Program: 75049
Project: 75049
Buggy source:
/** 
 * Get BindingColumn object with specified name.
 * @param name
 * @return
 * @throws DataException there is no BindingColumn in manualBindingExprs
 */
private BindingColumn getBindingFromManualBinding(IBaseExpression expr,String name) throws DataException {
  BindingColumn bindingColumn=null;
  for (int i=0; i < allManualBindingExprs.size(); i++) {
    List list=(List)allManualBindingExprs.get(i);
    Iterator it=list.iterator();
    while (it.hasNext()) {
      bindingColumn=(BindingColumn)it.next();
      if (bindingColumn.columnName.equals(name)) {
        return bindingColumn;
      }
    }
  }
  if (expr != null) {
    bindingColumn=new BindingColumn(name,expr,ExpressionCompilerUtil.hasAggregationInExpr(expr),expr.getDataType());
    return bindingColumn;
  }
  throw new DataException(ResourceConstants.INVALID_BOUND_COLUMN_NAME,name);
}

Fixed version (ground truth):
/** 
 * Get BindingColumn object with specified name.
 * @param name
 * @return
 * @throws DataException there is no BindingColumn in manualBindingExprs
 */
private BindingColumn getBindingFromManualBinding(String name) throws DataException {
  for (int i=0; i < allManualBindingExprs.size(); i++) {
    List list=(List)allManualBindingExprs.get(i);
    Iterator it=list.iterator();
    while (it.hasNext()) {
      BindingColumn bindingColumn=(BindingColumn)it.next();
      if (bindingColumn.columnName.equals(name))       return bindingColumn;
    }
  }
  throw new DataException(ResourceConstants.INVALID_BOUND_COLUMN_NAME,name);
}
Program: 75050
Project: 75050
Buggy source:
/** 
 * Evaluate the specified binding column in MANUAL_BINDING mode.
 * @param baseExpr
 * @param exprType
 * @param valueMap
 * @throws DataException
 */
Object evaluateValue(IBaseExpression expr,String bindingName) throws DataException {
  return this.evaluateValue(getBindingFromManualBinding(expr,bindingName),MANUAL_BINDING);
}

Fixed version (ground truth):
/** 
 * Evaluate the specified binding column in MANUAL_BINDING mode.
 * @param baseExpr
 * @param exprType
 * @param valueMap
 * @throws DataException
 */
Object evaluateValue(String bindingName) throws DataException {
  return this.evaluateValue(getBindingFromManualBinding(bindingName),MANUAL_BINDING);
}
Program: 75051
Project: 75051
Buggy source:
/** 
 * An exprManager object is to manipulate all available column bindings for specified query definition.
 * @param baseQueryDefn
 */
public ExprManager(IBaseQueryDefinition baseQueryDefn){
  this(baseQueryDefn,null);
}

Fixed version (ground truth):
/** 
 * An exprManager object is to manipulate all available column bindings for specified query definition.
 */
public ExprManager(IBaseQueryDefinition baseQueryDefn){
  bindingExprs=new ArrayList();
  autoBindingExprMap=new HashMap();
  entryLevel=OVERALL_GROUP;
  this.baseQueryDefn=baseQueryDefn;
  this.autoBindingMap=new HashMap();
}
Program: 75052
Project: 75052
Buggy source:
/** 
 * @param name
 * @return
 * @throws DataException
 */
public IBinding getBinding(String name) throws DataException {
  for (int i=0; i < bindingExprs.size(); i++) {
    GroupBindingColumn gcb=(GroupBindingColumn)bindingExprs.get(i);
    if (entryLevel != OVERALL_GROUP) {
      if (gcb.getGroupLevel() > entryLevel)       continue;
    }
    if (gcb.getBinding(name) != null)     return gcb.getBinding(name);
  }
  if (this.autoBindingMap.containsKey(name)) {
    return (IBinding)this.autoBindingMap.get(name);
  }
  if (this.parent != null) {
    return parent.getBinding(name);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param name
 * @return
 * @throws DataException
 */
public IBinding getBinding(String name) throws DataException {
  for (int i=0; i < bindingExprs.size(); i++) {
    GroupBindingColumn gcb=(GroupBindingColumn)bindingExprs.get(i);
    if (entryLevel != OVERALL_GROUP) {
      if (gcb.getGroupLevel() > entryLevel)       continue;
    }
    if (gcb.getBinding(name) != null)     return gcb.getBinding(name);
  }
  if (this.autoBindingMap.containsKey(name)) {
    return (IBinding)this.autoBindingMap.get(name);
  }
  return null;
}