nus-yam/ex-repair huggingface dataset:
Program: 75053
Project: 75053
Buggy source:
/** 
 * @param name
 * @return
 * @throws DataException 
 */
private IBaseExpression getBindingExpr(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;
    }
    Object o=gcb.getExpression(name);
    if (o != null)     return (IBaseExpression)o;
  }
  if (this.parent != null) {
    return this.parent.getBindingExpr(name);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param name
 * @return
 * @throws DataException 
 */
private IBaseExpression getBindingExpr(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;
    }
    Object o=gcb.getExpression(name);
    if (o != null)     return (IBaseExpression)o;
  }
  return null;
}
Program: 75054
Project: 75054
Buggy source:
/** 
 * @return
 */
private List getColumnNames(){
  List bindingExprs=exprManager.getBindingExprs();
  Map autoBindingExprMap=exprManager.getAutoBindingExprMap();
  List l=new ArrayList();
  l.addAll(autoBindingExprMap.keySet());
  for (int i=0; i < bindingExprs.size(); i++) {
    l.addAll(((GroupBindingColumn)bindingExprs.get(i)).getColumnNames());
  }
  ExprManager exprManager1=exprManager;
  while (exprManager1.getParentExprManager() != null) {
    bindingExprs=exprManager1.getParentExprManager().getBindingExprs();
    autoBindingExprMap=exprManager1.getParentExprManager().getAutoBindingExprMap();
    l.addAll(autoBindingExprMap.keySet());
    for (int i=0; i < bindingExprs.size(); i++) {
      l.addAll(((GroupBindingColumn)bindingExprs.get(i)).getColumnNames());
    }
    exprManager1=exprManager1.getParentExprManager();
  }
  return l;
}

Fixed version (ground truth):
/** 
 * @return
 */
private List getColumnNames(){
  List bindingExprs=exprManager.getBindingExprs();
  Map autoBindingExprMap=exprManager.getAutoBindingExprMap();
  List l=new ArrayList();
  l.addAll(autoBindingExprMap.keySet());
  for (int i=0; i < bindingExprs.size(); i++) {
    l.addAll(((GroupBindingColumn)bindingExprs.get(i)).getColumnNames());
  }
  return l;
}
Program: 75056
Project: 75056
Buggy source:
/** 
 * @param session
 * @param deContext
 * @param queryDefn
 * @param queryService
 * @param appContext
 * @param parentExprManager
 * @throws DataException
 */
PreparedQuery(DataEngineSession session,DataEngineContext deContext,IBaseQueryDefinition queryDefn,IPreparedQueryService queryService,Map appContext) throws DataException {
  this(session,deContext,queryDefn,queryService,appContext,null);
}

Fixed version (ground truth):
/** 
 * @param deContext
 * @param scope
 * @param queryDefn
 * @param queryService
 * @param appContext
 * @throws DataException
 */
PreparedQuery(DataEngineSession session,DataEngineContext deContext,IBaseQueryDefinition queryDefn,IPreparedQueryService queryService,Map appContext) throws DataException {
}
Program: 75058
Project: 75058
Buggy source:
/** 
 * @param subquery Subquery definition
 * @param parentQuery Parent query (which can be a subquery itself, or a PreparedReportQuery)
 * @param groupLevel Index of group in which this subquery is defined within the parent query. If 0, subquery is defined outside of any groups.
 * @param parentExprManager Parent query's expression manager
 * @throws DataException
 */
PreparedSubquery(DataEngineSession session,DataEngineContext context,ISubqueryDefinition subquery,IPreparedQueryService queryService,int groupLevel,ExprManager parentExprManager) throws DataException {
  Object[] params={session,context,subquery,queryService,new Integer(groupLevel)};
  logger.entering(PreparedSubquery.class.getName(),"String_Node_Str",params);
  this.groupLevel=groupLevel;
  this.queryService=queryService;
  this.subQueryOnGroup=subquery.applyOnGroup();
  logger.logp(Level.FINER,PreparedSubquery.class.getName(),"String_Node_Str","String_Node_Str");
  this.session=session;
  this.preparedQuery=new PreparedQuery(session,context,subquery,this,null,parentExprManager);
  logger.exiting(PreparedSubquery.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param subquery Subquery definition
 * @param parentQuery Parent query (which can be a subquery itself, or a PreparedReportQuery)
 * @param groupLevel Index of group in which this subquery is defined within the parent query. If 0, subquery is defined outside of any groups.
 * @throws DataException
 */
PreparedSubquery(DataEngineSession session,DataEngineContext context,ISubqueryDefinition subquery,IPreparedQueryService queryService,int groupLevel) throws DataException {
  Object[] params={session,context,subquery,queryService,new Integer(groupLevel)};
  logger.entering(PreparedSubquery.class.getName(),"String_Node_Str",params);
  this.groupLevel=groupLevel;
  this.queryService=queryService;
  this.subQueryOnGroup=subquery.applyOnGroup();
  logger.logp(Level.FINER,PreparedSubquery.class.getName(),"String_Node_Str","String_Node_Str");
  this.session=session;
  this.preparedQuery=new PreparedQuery(session,context,subquery,this,null);
  logger.exiting(PreparedSubquery.class.getName(),"String_Node_Str");
}
Program: 75059
Project: 75059
Buggy source:
/** 
 * Evaluate the specified column binding in case of its value still not calculate yet.
 * @param exprName
 * @return
 * @throws DataException
 */
private Object prepareBindingColumn(IBaseExpression expr,String bindingName) throws DataException {
}

Fixed version (ground truth):
/** 
 * Evaluate the specified column binding in case of its value still not calculate yet.
 * @param exprName
 * @return
 * @throws DataException
 */
private Object prepareBindingColumn(String exprName) throws DataException {
}
Program: 75060
Project: 75060
Buggy source:
public Object getValue(String exprName) throws BirtException {
  checkStarted();
  logger.logp(Level.FINER,ResultIterator.class.getName(),"String_Node_Str","String_Node_Str" + LogUtil.toString(exprName));
  if (this.isFirstRowPepared)   this.prepareCurrentRow();
  if (!this.boundColumnValueMap.containsKey(exprName)) {
    if (this.resultService.getBindingExpr(exprName) != null) {
      return prepareBindingColumn(this.resultService.getBindingExpr(exprName),exprName);
    }
    throw new DataException(ResourceConstants.INVALID_BOUND_COLUMN_NAME,exprName);
  }
  Object exprValue=boundColumnValueMap.get(exprName);
  if (exprValue instanceof BirtException)   throw (BirtException)exprValue;
  return exprValue;
}

Fixed version (ground truth):
public Object getValue(String exprName) throws BirtException {
  checkStarted();
  logger.logp(Level.FINER,ResultIterator.class.getName(),"String_Node_Str","String_Node_Str" + LogUtil.toString(exprName));
  if (this.isFirstRowPepared)   this.prepareCurrentRow();
  if (!this.boundColumnValueMap.containsKey(exprName)) {
    if (this.resultService.getBindingExpr(exprName) != null) {
      return prepareBindingColumn(exprName);
    }
    throw new DataException(ResourceConstants.INVALID_BOUND_COLUMN_NAME,exprName);
  }
  Object exprValue=boundColumnValueMap.get(exprName);
  if (exprValue instanceof BirtException)   throw (BirtException)exprValue;
  return exprValue;
}
Program: 75061
Project: 75061
Buggy source:
/** 
 * @param currIndex
 * @param exprID
 * @param exprValue
 * @throws DataException
 */
private int saveExprValue(Map valueMap) throws DataException {
  ByteArrayOutputStream tempBaos=new ByteArrayOutputStream();
  BufferedOutputStream tempBos=new BufferedOutputStream(tempBaos);
  DataOutputStream tempDos=new DataOutputStream(tempBos);
  try {
    IOUtil.writeInt(tempDos,exprNameSet.size());
    Iterator it=exprNameSet.iterator();
    while (it.hasNext()) {
      Object key=it.next();
      Object value=valueMap.get(key);
      if (value instanceof DataException)       value=EXCEPTION_INDICATOR;
      IOUtil.writeObject(tempDos,value);
    }
    tempDos.flush();
    tempBos.flush();
    tempBaos.flush();
    byte[] bytes=tempBaos.toByteArray();
    int rowBytes=bytes.length;
    IOUtil.writeRawBytes(this.rowExprsDos,bytes);
    tempBaos=null;
    tempBos=null;
    tempDos=null;
    return rowBytes;
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * @param currIndex
 * @param exprID
 * @param exprValue
 * @throws DataException
 */
private int saveExprValue(Map valueMap) throws DataException {
  ByteArrayOutputStream tempBaos=new ByteArrayOutputStream();
  BufferedOutputStream tempBos=new BufferedOutputStream(tempBaos);
  DataOutputStream tempDos=new DataOutputStream(tempBos);
  try {
    IOUtil.writeInt(tempDos,valueMap.size());
    Iterator it=exprNameSet.iterator();
    while (it.hasNext()) {
      Object key=it.next();
      Object value=valueMap.get(key);
      if (value instanceof DataException)       value=EXCEPTION_INDICATOR;
      IOUtil.writeObject(tempDos,value);
    }
    tempDos.flush();
    tempBos.flush();
    tempBaos.flush();
    byte[] bytes=tempBaos.toByteArray();
    int rowBytes=bytes.length;
    IOUtil.writeRawBytes(this.rowExprsDos,bytes);
    tempBaos=null;
    tempBos=null;
    tempDos=null;
    return rowBytes;
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e,"String_Node_Str");
  }
}
Program: 75062
Project: 75062
Buggy source:
public int canDrag(Object object){
  if (object instanceof MeasureHandle)   return DNDService.LOGIC_TRUE;
  return DNDService.LOGIC_UNKNOW;
}

Fixed version (ground truth):
public int canDrag(Object object){
  if (object instanceof MeasureHandle || object instanceof MeasureGroupHandle)   return DNDService.LOGIC_TRUE;
  return DNDService.LOGIC_UNKNOW;
}
Program: 75063
Project: 75063
Buggy source:
public boolean performDrop(Object transfer,Object target,int operation,DNDLocation location){
  if (transfer instanceof Object[]) {
    Object[] objects=(Object[])transfer;
    for (int i=0; i < objects.length; i++) {
      if (!performDrop(objects[i],target,operation,location))       return false;
    }
    return true;
  }
  if (target instanceof EditPart) {
    EditPart editPart=(EditPart)target;
    if (editPart != null) {
      CreateRequest request=new CreateRequest();
      request.getExtendedData().put(DesignerConstants.KEY_NEWOBJECT,transfer);
      request.setLocation(location.getPoint());
      Command command=editPart.getCommand(request);
      if (command != null && command.canExecute()) {
        editPart.getViewer().getEditDomain().getCommandStack().execute(command);
        return true;
      }
 else       return false;
    }
    return false;
  }
  return false;
}

Fixed version (ground truth):
public boolean performDrop(Object transfer,Object target,int operation,DNDLocation location){
  if (target instanceof EditPart) {
    EditPart editPart=(EditPart)target;
    if (editPart != null) {
      CreateRequest request=new CreateRequest();
      request.getExtendedData().put(DesignerConstants.KEY_NEWOBJECT,transfer);
      request.setLocation(location.getPoint());
      Command command=editPart.getCommand(request);
      if (command != null && command.canExecute()) {
        editPart.getViewer().getEditDomain().getCommandStack().execute(command);
        return true;
      }
 else       return false;
    }
    return false;
  }
  return false;
}
Program: 75064
Project: 75064
Buggy source:
public boolean handleValidate(Object obj){
  if (obj instanceof Object[]) {
    Object[] objects=(Object[])obj;
    int len=objects.length;
    if (len != 1) {
      return false;
    }
    return handleValidate(objects[0]);
  }
  CrosstabReportItemHandle crosstab=getCrosstabCellHandle().getCrosstab();
  if (obj instanceof DimensionHandle) {
    if ((getPositionType().equals(ICrosstabCellAdapterFactory.CELL_LEVEL_HANDLE) || getPositionType().equals(ICrosstabCellAdapterFactory.CELL_FIRST_LEVEL_HANDLE)) && CrosstabUtil.canContain(crosstab,(DimensionHandle)obj)) {
      return true;
    }
  }
  if (obj instanceof LevelHandle) {
    return handleValidate(CrosstabAdaptUtil.getDimensionHandle((LevelHandle)obj));
  }
  if (obj instanceof MeasureHandle) {
    if (getPositionType().equals(ICrosstabCellAdapterFactory.CELL_MEASURE) && CrosstabUtil.canContain(crosstab,(MeasureHandle)obj)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean handleValidate(Object obj){
  CrosstabReportItemHandle crosstab=getCrosstabCellHandle().getCrosstab();
  if (obj instanceof Object[]) {
    Object[] objects=(Object[])obj;
    int len=objects.length;
    if (len == 0) {
      return false;
    }
    if (len == 1) {
      return handleValidate(objects[0]);
    }
 else {
      for (int i=0; i < len; i++) {
        Object temp=objects[i];
        if (temp instanceof MeasureHandle || temp instanceof MeasureGroupHandle) {
          if (crosstab.getCube() == CrosstabAdaptUtil.getCubeHandle((DesignElementHandle)temp)) {
            continue;
          }
 else {
            return false;
          }
        }
 else {
          return false;
        }
      }
      return true;
    }
  }
  if (obj instanceof DimensionHandle) {
    if ((getPositionType().equals(ICrosstabCellAdapterFactory.CELL_LEVEL_HANDLE) || getPositionType().equals(ICrosstabCellAdapterFactory.CELL_FIRST_LEVEL_HANDLE)) && CrosstabUtil.canContain(crosstab,(DimensionHandle)obj)) {
      return true;
    }
  }
  if (obj instanceof LevelHandle) {
    return handleValidate(CrosstabAdaptUtil.getDimensionHandle((LevelHandle)obj));
  }
  if (obj instanceof MeasureHandle) {
    if (getPositionType().equals(ICrosstabCellAdapterFactory.CELL_MEASURE) && CrosstabUtil.canContain(crosstab,(MeasureHandle)obj)) {
      return true;
    }
  }
  if (obj instanceof MeasureGroupHandle) {
    if (getPositionType().equals(ICrosstabCellAdapterFactory.CELL_MEASURE) && crosstab.getCube() == CrosstabAdaptUtil.getCubeHandle((DesignElementHandle)obj)) {
      return true;
    }
  }
  return false;
}
Program: 75065
Project: 75065
Buggy source:
public boolean handleValidate(Object obj){
  if (obj instanceof Object[]) {
    Object[] objects=(Object[])obj;
    int len=objects.length;
    if (len != 1) {
      return false;
    }
    return handleValidate(objects[0]);
  }
  if (getType() == ICrosstabConstants.ROW_AXIS_TYPE || getType() == ICrosstabConstants.COLUMN_AXIS_TYPE) {
    if (obj instanceof DimensionHandle && CrosstabUtil.canContain(crosstab,(DimensionHandle)obj)) {
      return true;
    }
    if (obj instanceof LevelHandle) {
      return handleValidate(CrosstabAdaptUtil.getDimensionHandle((LevelHandle)obj));
    }
  }
  if (getType() == MEASURE_TYPE) {
    if (obj instanceof MeasureHandle && CrosstabUtil.canContain(crosstab,(MeasureHandle)obj)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean handleValidate(Object obj){
  if (obj instanceof Object[]) {
    Object[] objects=(Object[])obj;
    int len=objects.length;
    if (len == 0) {
      return false;
    }
    if (len == 1) {
      return handleValidate(objects[0]);
    }
 else {
      for (int i=0; i < len; i++) {
        Object temp=objects[i];
        if (temp instanceof MeasureHandle || temp instanceof MeasureGroupHandle) {
          if (crosstab.getCube() == CrosstabAdaptUtil.getCubeHandle((DesignElementHandle)temp) || crosstab.getCube() == null) {
            continue;
          }
 else {
            return false;
          }
        }
 else {
          return false;
        }
      }
      return true;
    }
  }
  if (getType() == ICrosstabConstants.ROW_AXIS_TYPE || getType() == ICrosstabConstants.COLUMN_AXIS_TYPE) {
    if (obj instanceof DimensionHandle && CrosstabUtil.canContain(crosstab,(DimensionHandle)obj)) {
      return true;
    }
    if (obj instanceof LevelHandle) {
      return handleValidate(CrosstabAdaptUtil.getDimensionHandle((LevelHandle)obj));
    }
  }
  if (getType() == MEASURE_TYPE) {
    if (obj instanceof MeasureHandle && CrosstabUtil.canContain(crosstab,(MeasureHandle)obj)) {
      return true;
    }
    if (obj instanceof MeasureGroupHandle && (crosstab.getCube() == CrosstabAdaptUtil.getCubeHandle((DesignElementHandle)obj) || crosstab.getCube() == null)) {
      return true;
    }
  }
  return false;
}
Program: 75067
Project: 75067
Buggy source:
public boolean handleValidate(Object obj){
  if (obj instanceof Object[]) {
    Object[] objects=(Object[])obj;
    int len=objects.length;
    if (len == 0) {
      return false;
    }
    if (len == 1) {
      return handleValidate(objects[0]);
    }
 else {
      for (int i=0; i < len; i++) {
        Object temp=objects[i];
        if (temp instanceof MeasureHandle || temp instanceof MeasureGroupHandle) {
          if (crosstab.getCube() == CrosstabAdaptUtil.getCubeHandle((DesignElementHandle)temp) || crosstab.getCube() == null) {
            continue;
          }
 else {
            return false;
          }
        }
 else {
          return false;
        }
      }
      return true;
    }
  }
  if (getType() == ICrosstabConstants.ROW_AXIS_TYPE || getType() == ICrosstabConstants.COLUMN_AXIS_TYPE) {
    if (obj instanceof DimensionHandle && CrosstabUtil.canContain(crosstab,(DimensionHandle)obj)) {
      return true;
    }
    if (obj instanceof LevelHandle) {
      return handleValidate(CrosstabAdaptUtil.getDimensionHandle((LevelHandle)obj));
    }
  }
  if (getType() == MEASURE_TYPE) {
    if (obj instanceof MeasureHandle && CrosstabUtil.canContain(crosstab,(MeasureHandle)obj)) {
      return true;
    }
    if (obj instanceof MeasureGroupHandle && (crosstab.getCube() == CrosstabAdaptUtil.getCubeHandle((DesignElementHandle)obj) || crosstab.getCube() == null)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean handleValidate(Object obj){
  if (obj instanceof Object[]) {
    Object[] objects=(Object[])obj;
    int len=objects.length;
    if (len == 0) {
      return false;
    }
    if (len == 1) {
      return handleValidate(objects[0]);
    }
 else {
      for (int i=0; i < len; i++) {
        Object temp=objects[i];
        if (temp instanceof MeasureHandle || temp instanceof MeasureGroupHandle) {
          if ((getType() == MEASURE_TYPE) && (crosstab.getCube() == CrosstabAdaptUtil.getCubeHandle((DesignElementHandle)temp) || crosstab.getCube() == null)) {
            continue;
          }
 else {
            return false;
          }
        }
 else {
          return false;
        }
      }
      return true;
    }
  }
  if (getType() == ICrosstabConstants.ROW_AXIS_TYPE || getType() == ICrosstabConstants.COLUMN_AXIS_TYPE) {
    if (obj instanceof DimensionHandle && CrosstabUtil.canContain(crosstab,(DimensionHandle)obj)) {
      return true;
    }
    if (obj instanceof LevelHandle) {
      return handleValidate(CrosstabAdaptUtil.getDimensionHandle((LevelHandle)obj));
    }
  }
  if (getType() == MEASURE_TYPE) {
    if (obj instanceof MeasureHandle && CrosstabUtil.canContain(crosstab,(MeasureHandle)obj)) {
      return true;
    }
    if (obj instanceof MeasureGroupHandle && (crosstab.getCube() == CrosstabAdaptUtil.getCubeHandle((DesignElementHandle)obj) || crosstab.getCube() == null)) {
      return true;
    }
  }
  return false;
}
Program: 75070
Project: 75070
Buggy source:
/** 
 * When export property binding , should change 'id' property. See bugzilla 198076
 * @throws Exception
 */
public void testExportPropertyBinding() throws Exception {
  openDesign("String_Node_Str");
  openLibrary("String_Node_Str");
  ElementExportUtil.exportDesign(designHandle,libraryHandle,false,false);
  DataSetHandle dsHandle=(DataSetHandle)libraryHandle.getDataSets().get(0);
  long id=dsHandle.getID();
  List propertyBindings=libraryHandle.getListProperty(ReportDesignHandle.PROPERTY_BINDINGS_PROP);
  PropertyBinding propBinding=(PropertyBinding)propertyBindings.get(0);
  assertEquals(id,propBinding.getID().longValue());
  DataSetHandle designDsHandle=(DataSetHandle)designHandle.getDataSets().get(0);
  System.out.println("String_Node_Str" + designDsHandle.getID() + "String_Node_Str"+ id);
  assertNotSame(designDsHandle.getID(),id);
}

Fixed version (ground truth):
/** 
 * When export property binding , should change 'id' property. See bugzilla 198076
 * @throws Exception
 */
public void testExportPropertyBinding() throws Exception {
  openDesign("String_Node_Str");
  openLibrary("String_Node_Str");
  ElementExportUtil.exportDesign(designHandle,libraryHandle,false,false);
  DataSetHandle dsHandle=(DataSetHandle)libraryHandle.getDataSets().get(0);
  long id=dsHandle.getID();
  List propertyBindings=libraryHandle.getListProperty(ReportDesignHandle.PROPERTY_BINDINGS_PROP);
  PropertyBinding propBinding=(PropertyBinding)propertyBindings.get(0);
  assertEquals(id,propBinding.getID().longValue());
  DataSetHandle designDsHandle=(DataSetHandle)designHandle.getDataSets().get(0);
  assertNotSame(designDsHandle.getID(),id);
}
Program: 75071
Project: 75071
Buggy source:
/** 
 * When export property binding , should change 'id' property. See bugzilla 198076
 * @throws Exception
 */
public void testExportPropertyBinding() throws Exception {
  openDesign("String_Node_Str");
  openLibrary("String_Node_Str");
  ElementExportUtil.exportDesign(designHandle,libraryHandle,false,false);
  DataSetHandle dsHandle=(DataSetHandle)libraryHandle.getDataSets().get(0);
  long id=dsHandle.getID();
  List propertyBindings=libraryHandle.getListProperty(ReportDesignHandle.PROPERTY_BINDINGS_PROP);
  PropertyBinding propBinding=(PropertyBinding)propertyBindings.get(0);
  assertEquals(id,propBinding.getID().longValue());
  DataSetHandle designDsHandle=(DataSetHandle)designHandle.getDataSets().get(0);
  assertNotSame(designDsHandle.getID(),id);
}

Fixed version (ground truth):
/** 
 * When export property binding , should change 'id' property. See bugzilla 198076
 * @throws Exception
 */
public void testExportPropertyBinding() throws Exception {
  openDesign("String_Node_Str");
  openLibrary("String_Node_Str");
  ElementExportUtil.exportDesign(designHandle,libraryHandle,false,false);
  DataSetHandle dsHandle=(DataSetHandle)libraryHandle.getDataSets().get(0);
  long id=dsHandle.getID();
  List propertyBindings=libraryHandle.getListProperty(ReportDesignHandle.PROPERTY_BINDINGS_PROP);
  PropertyBinding propBinding=(PropertyBinding)propertyBindings.get(0);
  assertEquals(id,propBinding.getID().longValue());
  DataSetHandle designDsHandle=(DataSetHandle)designHandle.getDataSets().get(0);
  assertFalse(designDsHandle.getID() == id);
}
Program: 75072
Project: 75072
Buggy source:
/** 
 * Build the style of the page
 */
public void buildPageStyle(IPageContent page,StringBuffer styleBuffer){
  IStyle style=page.getStyle();
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  DimensionType width=page.getPageWidth();
  if (width != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(width.toString());
    styleBuffer.append("String_Node_Str");
  }
  if (HTMLRenderOption.LAYOUT_PREFERENCE_FIXED.equals(layoutPreference)) {
    styleBuffer.append("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Build the style of the page
 */
public void buildPageStyle(IPageContent page,StringBuffer styleBuffer){
  IStyle style=page.getStyle();
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  if (HTMLRenderOption.LAYOUT_PREFERENCE_FIXED.equals(layoutPreference)) {
    DimensionType width=page.getPageWidth();
    if (width != null) {
      styleBuffer.append("String_Node_Str");
      styleBuffer.append(width.toString());
      styleBuffer.append("String_Node_Str");
    }
    styleBuffer.append("String_Node_Str");
  }
}
Program: 75073
Project: 75073
Buggy source:
protected void init(){
  assert(content instanceof IImageContent);
  image=(IImageContent)content;
  maxWidth=parent.getCurrentMaxContentWidth();
  Dimension contentDimension=getSpecifiedDimension(image);
  root=(ContainerArea)createInlineContainer(image,true,true);
  validateBoxProperty(root.getStyle(),maxWidth,context.getMaxHeight());
  root.setAllocatedWidth(maxWidth);
  int maxContentWidth=root.getContentWidth();
  ImageArea imageArea=(ImageArea)AreaFactory.createImageArea(image);
  imageArea.setWidth(contentDimension.getWidth());
  imageArea.setHeight(contentDimension.getHeight());
  root.addChild(imageArea);
  imageArea.setPosition(root.getContentX(),root.getContentY());
  processChartLegend(image,imageArea);
  root.setContentWidth(contentDimension.getWidth());
  root.setContentHeight(Math.min(context.getMaxHeight(),contentDimension.getHeight()));
}

Fixed version (ground truth):
protected void init(){
  assert(content instanceof IImageContent);
  image=(IImageContent)content;
  maxWidth=parent.getCurrentMaxContentWidth();
  Dimension contentDimension=getSpecifiedDimension(image);
  root=(ContainerArea)createInlineContainer(image,true,true);
  validateBoxProperty(root.getStyle(),maxWidth,context.getMaxHeight());
  root.setAllocatedWidth(maxWidth);
  ImageArea imageArea=(ImageArea)AreaFactory.createImageArea(image);
  imageArea.setWidth(contentDimension.getWidth());
  imageArea.setHeight(contentDimension.getHeight());
  root.addChild(imageArea);
  imageArea.setPosition(root.getContentX(),root.getContentY());
  processChartLegend(image,imageArea);
  root.setContentWidth(contentDimension.getWidth());
  root.setContentHeight(Math.min(context.getMaxHeight(),contentDimension.getHeight()));
}
Program: 75074
Project: 75074
Buggy source:
private void createImageMap(String imageMapObject,IImageArea imageArea){
  Pattern pattern=Pattern.compile("String_Node_Str");
  Matcher matcher=pattern.matcher(imageMapObject);
  String url=null;
  String targetWindow=null;
  ArrayList areas=new ArrayList();
  while (matcher.find()) {
    try {
      areas.add(getArea(matcher.group(1)));
      if (url == null)       url=matcher.group(2);
      if (targetWindow == null)       targetWindow=matcher.group(3);
    }
 catch (    NumberFormatException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
  if (url == null) {
    return;
  }
  ActionContent link=new ActionContent();
  if (isBookmark(url)) {
    String bookmark=getBookmark(url);
    link.setBookmark(bookmark);
  }
 else {
    link.setHyperlink(url,targetWindow);
  }
  createImageMaps(areas,imageArea,link);
}

Fixed version (ground truth):
private void createImageMap(int[] area,IImageArea imageArea,String url,String targetWindow){
  if (url == null) {
    return;
  }
  ActionContent link=new ActionContent();
  if (isBookmark(url)) {
    String bookmark=getBookmark(url);
    link.setBookmark(bookmark);
  }
 else {
    link.setHyperlink(url,targetWindow);
  }
  area=getAbsoluteArea(area,imageArea);
  createImageMapContainer(area[0],area[1],area[2],area[3],link);
}
Program: 75075
Project: 75075
Buggy source:
/** 
 * processes after pressing ok button
 */
private void okPressedProcess(){
  Utility.setPreferenceStoredMap(JdbcPlugin.JAR_MAP_PREFERENCE_KEY,jarMap);
  Utility.setPreferenceStoredMap(JdbcPlugin.DRIVER_MAP_PREFERENCE_KEY,driverMap);
  Iterator jarsCopyIterator=jarsToBeCopied.values().iterator();
  while (jarsCopyIterator.hasNext()) {
    JarFile jar=(JarFile)jarsCopyIterator.next();
    jar.copyJarToODADir();
    Utility.removeMapEntryFromPreferenceStoredMap(JdbcPlugin.DELETED_JAR_MAP_PREFERENCE_KEY,jar.getFileName());
  }
  Iterator jarsDeleteIterator=jarsToBeDeleted.values().iterator();
  while (jarsDeleteIterator.hasNext()) {
    JarFile jar=(JarFile)jarsDeleteIterator.next();
    jar.deleteJarFromODADir();
    Utility.putPreferenceStoredMapValue(JdbcPlugin.DELETED_JAR_MAP_PREFERENCE_KEY,jar.getFileName(),jar);
  }
  refreshDriverPage();
  super.okPressed();
}

Fixed version (ground truth):
/** 
 * processes after pressing ok button
 */
private void okPressedProcess(){
  Utility.setPreferenceStoredMap(JdbcPlugin.JAR_MAP_PREFERENCE_KEY,jarMap);
  Utility.setPreferenceStoredMap(JdbcPlugin.DRIVER_MAP_PREFERENCE_KEY,driverMap);
  Iterator jarsCopyIterator=jarsToBeCopied.values().iterator();
  JDBCDriverManager manager=JDBCDriverManager.getInstance();
  JDBCDriverInformation info;
  List drivers=new ArrayList();
  while (jarsCopyIterator.hasNext()) {
    JarFile jar=(JarFile)jarsCopyIterator.next();
    jar.copyJarToODADir();
    Utility.removeMapEntryFromPreferenceStoredMap(JdbcPlugin.DELETED_JAR_MAP_PREFERENCE_KEY,jar.getFileName());
    drivers.addAll(JdbcToolKit.getDriverByJar(jar));
  }
  for (int i=0; i < drivers.size(); i++) {
    info=(JDBCDriverInformation)drivers.get(i);
    manager.updateStatus(info.getDriverClassName());
  }
  drivers.clear();
  Iterator jarsDeleteIterator=jarsToBeDeleted.values().iterator();
  while (jarsDeleteIterator.hasNext()) {
    JarFile jar=(JarFile)jarsDeleteIterator.next();
    jar.deleteJarFromODADir();
    Utility.putPreferenceStoredMapValue(JdbcPlugin.DELETED_JAR_MAP_PREFERENCE_KEY,jar.getFileName(),jar);
    drivers.addAll(JdbcToolKit.getDriverByJar(jar));
  }
  for (int i=0; i < drivers.size(); i++) {
    info=(JDBCDriverInformation)drivers.get(i);
    try {
      manager.deregisterDriver(info.getDriverClassName());
    }
 catch (    OdaException e) {
      MessageDialog.openError(null,"String_Node_Str","String_Node_Str" + info.getDriverClassName());
    }
  }
  refreshDriverPage();
  super.okPressed();
}
Program: 75076
Project: 75076
Buggy source:
/** 
 * remove driver(s) from runtime driver list
 * @param fileList
 */
public static void removeFromDriverList(List fileList){
  for (int i=0; i < fileList.size(); i++) {
    String fileName=((File)fileList.get(i)).getName();
    jdbcDriverInfos.removeAll((List)file2Drivers.get(fileName));
    file2Drivers.remove(fileName);
    if (failLoadFileList.contains(fileList.get(i)))     failLoadFileList.remove(fileList.get(i));
  }
}

Fixed version (ground truth):
/** 
 * remove driver(s) from runtime driver list
 * @param fileList
 */
public static void removeFromDriverList(List fileList){
  for (int i=0; i < fileList.size(); i++) {
    String fileName=((File)fileList.get(i)).getName();
    List driverNames=(List)file2Drivers.get(fileName);
    for (int j=0; j < jdbcDriverInfos.size(); j++) {
      for (int k=0; k < driverNames.size(); k++)       if (((JDBCDriverInformation)jdbcDriverInfos.get(j)).getDriverClassName().equals(((JDBCDriverInformation)driverNames.get(k)).getDriverClassName())) {
        jdbcDriverInfos.remove(j);
      }
    }
    if (failLoadFileList.contains(fileList.get(i)))     failLoadFileList.remove(fileList.get(i));
  }
}
Program: 75077
Project: 75077
Buggy source:
private void loadAndRegisterDriver(String className) throws OdaException {
  if (className == null || className.length() == 0)   return;
  Class driverClass=null;
  if (registeredDrivers.contains(className))   return;
  if (logger.isLoggable(Level.INFO)) {
    logger.info("String_Node_Str" + className);
  }
  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);
    }
  }
  if (!driverInClassPath) {
    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);
    }
    try {
      if (logger.isLoggable(Level.FINER))       logger.finer("String_Node_Str" + className);
      DriverManager.registerDriver(new WrappedDriver(driver,className));
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,"String_Node_Str",e);
    }
  }
  registeredDrivers.add(className);
}

Fixed version (ground truth):
private void loadAndRegisterDriver(String className) throws OdaException {
  if (className == null || className.length() == 0)   return;
  if (isDeregistered(className)) {
    throw new JDBCException(ResourceConstants.CANNOT_LOAD_DRIVER,null,className);
  }
 else   if (this.registeredDrivers.containsKey(className)) {
    return;
  }
  if (logger.isLoggable(Level.INFO)) {
    logger.info("String_Node_Str" + className);
  }
  Driver driver=findDriver(className);
  if (driver != null) {
    try {
      if (logger.isLoggable(Level.FINER))       logger.finer("String_Node_Str" + className);
      DriverManager.registerDriver(new WrappedDriver(driver,className));
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,"String_Node_Str",e);
    }
  }
  registeredDrivers.put(className,DRIVER_REGISTERED);
}
Program: 75078
Project: 75078
Buggy source:
public int[] resolveFixedLayout(int maxWidth){
  int columnNumber=table.getColumnCount();
  DimensionType[] columns=new DimensionType[columnNumber];
  for (int i=0; i < columnNumber; i++) {
    IColumn column=table.getColumn(i);
    DimensionType w=column.getWidth();
    if (PDFTableLM.this.isColumnHidden(column)) {
      columns[i]=new DimensionType(0d,EngineIRConstants.UNITS_PT);
    }
 else {
      if (w == null) {
        columns[i]=null;
      }
 else {
        columns[i]=new DimensionType(w.getMeasure(),w.getUnits());
      }
    }
  }
  int specifiedWidth=getDimensionValue(tableContent.getWidth(),maxWidth);
  int tableWidth;
  if (specifiedWidth > 0) {
    tableWidth=specifiedWidth;
  }
 else {
    tableWidth=maxWidth;
  }
  formalize(columns,tableWidth);
  return resolve(tableWidth,columns);
}

Fixed version (ground truth):
public int[] resolveFixedLayout(int maxWidth){
  int columnNumber=table.getColumnCount();
  DimensionType[] columns=new DimensionType[columnNumber];
  for (int i=0; i < columnNumber; i++) {
    IColumn column=table.getColumn(i);
    DimensionType w=column.getWidth();
    if (PDFTableLM.this.isColumnHidden(column)) {
      columns[i]=new DimensionType(0d,EngineIRConstants.UNITS_PT);
    }
 else {
      if (startCol < 0) {
        startCol=i;
      }
      endCol=i;
      if (w == null) {
        columns[i]=null;
      }
 else {
        columns[i]=new DimensionType(w.getMeasure(),w.getUnits());
      }
    }
  }
  if (startCol < 0)   startCol=0;
  if (endCol < 0)   endCol=0;
  int specifiedWidth=getDimensionValue(tableContent.getWidth(),maxWidth);
  int tableWidth;
  if (specifiedWidth > 0) {
    tableWidth=specifiedWidth;
  }
 else {
    tableWidth=maxWidth;
  }
  formalize(columns,tableWidth);
  return resolve(tableWidth,columns);
}
Program: 75079
Project: 75079
Buggy source:
public PDFTableRegionLM getTableRegionLayout(){
  PDFReportLayoutEngine engine=context.getLayoutEngine();
  PDFLayoutEngineContext con=new PDFLayoutEngineContext(engine);
  con.setFactory(new PDFLayoutManagerFactory(con));
  con.setFormat(context.getFormat());
  con.setReport(context.getReport());
  con.setMaxHeight(context.getMaxHeight());
  con.setMaxWidth(context.getMaxWidth());
  con.setAllowPageBreak(false);
  if (regionLayout == null) {
    regionLayout=new TableAreaLayout(tableContent,layoutInfo,0,columnNumber);
  }
  return new PDFTableRegionLM(con,tableContent,layoutInfo,regionLayout);
}

Fixed version (ground truth):
public PDFTableRegionLM getTableRegionLayout(){
  PDFReportLayoutEngine engine=context.getLayoutEngine();
  PDFLayoutEngineContext con=new PDFLayoutEngineContext(engine);
  con.setFactory(new PDFLayoutManagerFactory(con));
  con.setFormat(context.getFormat());
  con.setReport(context.getReport());
  con.setMaxHeight(context.getMaxHeight());
  con.setMaxWidth(context.getMaxWidth());
  con.setAllowPageBreak(false);
  if (regionLayout == null) {
    regionLayout=new TableAreaLayout(tableContent,layoutInfo,startCol,endCol);
  }
  return new PDFTableRegionLM(con,tableContent,layoutInfo,regionLayout);
}
Program: 75080
Project: 75080
Buggy source:
protected void initialize(){
  if (root == null) {
    isNewArea=true;
    createRoot();
    buildTableLayoutInfo();
    root.setWidth(layoutInfo.getTableWidth());
    maxAvaWidth=layoutInfo.getTableWidth();
    setCurrentIP(0);
    setCurrentBP(0);
    repeatRowCount=0;
    rowCount=0;
  }
  if (layout == null) {
    layout=new TableAreaLayout(tableContent,layoutInfo,0,columnNumber);
    layout.initTableLayout(context.getUnresolvedRowHint(tableContent));
  }
  if (parent != null) {
    root.setAllocatedHeight(parent.getCurrentMaxContentHeight());
  }
 else {
    root.setAllocatedHeight(context.getMaxHeight());
  }
  maxAvaHeight=root.getContentHeight() - getBottomBorderWidth();
}

Fixed version (ground truth):
protected void initialize(){
  if (root == null) {
    isNewArea=true;
    createRoot();
    buildTableLayoutInfo();
    root.setWidth(layoutInfo.getTableWidth());
    maxAvaWidth=layoutInfo.getTableWidth();
    setCurrentIP(0);
    setCurrentBP(0);
    repeatRowCount=0;
    rowCount=0;
  }
  if (layout == null) {
    layout=new TableAreaLayout(tableContent,layoutInfo,startCol,endCol);
    layout.initTableLayout(context.getUnresolvedRowHint(tableContent));
  }
  if (parent != null) {
    root.setAllocatedHeight(parent.getCurrentMaxContentHeight());
  }
 else {
    root.setAllocatedHeight(context.getMaxHeight());
  }
  maxAvaHeight=root.getContentHeight() - getBottomBorderWidth();
}
Program: 75082
Project: 75082
Buggy source:
protected void init(){
  assert(content instanceof IImageContent);
  image=(IImageContent)content;
  maxWidth=parent.getCurrentMaxContentWidth();
  Dimension contentDimension=getSpecifiedDimension(image);
  root=(ContainerArea)createInlineContainer(image,true,true);
  validateBoxProperty(root.getStyle(),maxWidth,context.getMaxHeight());
  root.setAllocatedWidth(maxWidth);
  int maxContentWidth=root.getContentWidth();
  if (contentDimension.getWidth() > maxContentWidth) {
    contentDimension.setDimension(maxContentWidth,(int)(maxContentWidth / contentDimension.getRatio()));
  }
  ImageArea imageArea=(ImageArea)AreaFactory.createImageArea(image);
  imageArea.setWidth(contentDimension.getWidth());
  imageArea.setHeight(contentDimension.getHeight());
  root.addChild(imageArea);
  imageArea.setPosition(root.getContentX(),root.getContentY());
  processChartLegend(image,imageArea);
  root.setContentWidth(contentDimension.getWidth());
  root.setContentHeight(Math.min(context.getMaxHeight(),contentDimension.getHeight()));
}

Fixed version (ground truth):
protected void init(){
  assert(content instanceof IImageContent);
  image=(IImageContent)content;
  maxWidth=parent.getCurrentMaxContentWidth();
  Dimension contentDimension=getSpecifiedDimension(image);
  root=(ContainerArea)createInlineContainer(image,true,true);
  validateBoxProperty(root.getStyle(),maxWidth,context.getMaxHeight());
  root.setAllocatedWidth(maxWidth);
  int maxContentWidth=root.getContentWidth();
  ImageArea imageArea=(ImageArea)AreaFactory.createImageArea(image);
  imageArea.setWidth(contentDimension.getWidth());
  imageArea.setHeight(contentDimension.getHeight());
  root.addChild(imageArea);
  imageArea.setPosition(root.getContentX(),root.getContentY());
  processChartLegend(image,imageArea);
  root.setContentWidth(contentDimension.getWidth());
  root.setContentHeight(Math.min(context.getMaxHeight(),contentDimension.getHeight()));
}
Program: 75084
Project: 75084
Buggy source:
/** 
 * @param fieldType
 * @return
 */
private Object createNullValueReplacer(int fieldType){
switch (fieldType) {
case DataType.DATE_TYPE:
    return new java.util.Date(nullTime);
case DataType.SQL_DATE_TYPE:
  return new java.sql.Date(nullTime);
case DataType.SQL_TIME_TYPE:
return new Time(nullTime);
case DataType.BOOLEAN_TYPE:
return new Boolean(false);
case DataType.DECIMAL_TYPE:
return new Double(0);
case DataType.DOUBLE_TYPE:
return new Double(0);
case DataType.INTEGER_TYPE:
return new Integer(0);
case DataType.STRING_TYPE:
return "String_Node_Str";
default :
return "String_Node_Str";
}
}

Fixed version (ground truth):
/** 
 * @param fieldType
 * @return
 */
private Object createNullValueReplacer(int fieldType){
switch (fieldType) {
case DataType.DATE_TYPE:
    return new java.util.Date(nullTime);
case DataType.SQL_DATE_TYPE:
  return new java.sql.Date(nullTime);
case DataType.SQL_TIME_TYPE:
return new Time(nullTime);
case DataType.BOOLEAN_TYPE:
return new Boolean(false);
case DataType.DECIMAL_TYPE:
return new BigDecimal(0);
case DataType.DOUBLE_TYPE:
return new Double(0);
case DataType.INTEGER_TYPE:
return new Integer(0);
case DataType.STRING_TYPE:
return "String_Node_Str";
default :
return "String_Node_Str";
}
}
Program: 75085
Project: 75085
Buggy source:
/** 
 * @param engine the report engine
 * @param runnable the report runnable object
 * @param reportDoc the report document instance
 */
public RenderTask(IReportEngine engine,IReportRunnable runnable,IReportDocument reportDoc){
  super(engine,runnable,IEngineTask.TASK_RENDER);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  openReportDocument(reportDoc);
  loadDesign();
  innerRender=new PageRangeRender(new long[]{1,this.reportDoc.getPageCount()});
}

Fixed version (ground truth):
/** 
 * @param engine the report engine
 * @param runnable the report runnable object
 * @param reportDoc the report document instance
 */
public RenderTask(IReportEngine engine,IReportRunnable runnable,IReportDocument reportDoc){
  super(engine,runnable,IEngineTask.TASK_RENDER);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  openReportDocument(reportDoc);
  loadDesign();
  innerRender=new AllPageRender(new long[]{1,this.reportDoc.getPageCount()});
}
Program: 75086
Project: 75086
Buggy source:
protected boolean isPagedExecutor(){
  if (ExtensionManager.PAPER_SIZE_PAGINATION.equals(pagination)) {
    return false;
  }
  boolean paged=true;
  IRenderOption renderOption=executionContext.getRenderOption();
  HTMLRenderOption htmlRenderOption=new HTMLRenderOption(renderOption);
  boolean htmlPagination=htmlRenderOption.getHtmlPagination();
  if (!htmlPagination) {
    paged=false;
  }
  return paged;
}

Fixed version (ground truth):
protected boolean isPagedExecutor(){
  if (ExtensionManager.PAPER_SIZE_PAGINATION.equals(pagination)) {
    return !needPaginate();
  }
  boolean paged=true;
  IRenderOption renderOption=executionContext.getRenderOption();
  HTMLRenderOption htmlRenderOption=new HTMLRenderOption(renderOption);
  boolean htmlPagination=htmlRenderOption.getHtmlPagination();
  if (!htmlPagination) {
    paged=false;
  }
  return paged;
}
Program: 75087
Project: 75087
Buggy source:
protected boolean needPaginate(){
  return false;
}

Fixed version (ground truth):
protected boolean needPaginate(){
  return true;
}
Program: 75088
Project: 75088
Buggy source:
public void setPageRange(String pageRange) throws EngineException {
  innerRender=new PageRangeRender(parsePageSequence(pageRange,reportDoc.getPageCount()));
}

Fixed version (ground truth):
public void setPageRange(String pageRange) throws EngineException {
  if (null == pageRange || "String_Node_Str".equals(pageRange) || pageRange.toUpperCase().indexOf("String_Node_Str") >= 0) {
    innerRender=new AllPageRender(new long[]{1,reportDoc.getPageCount()});
  }
 else {
    innerRender=new PageRangeRender(parsePageSequence(pageRange,reportDoc.getPageCount()));
  }
}
Program: 75089
Project: 75089
Buggy source:
CellArea(ICellContent cell){
  super(cell);
  removeBorder();
  setDefaultPadding();
}

Fixed version (ground truth):
CellArea(ICellContent cell){
  super(cell);
  removeBorder();
  setDefaultPadding();
  needClip=true;
}
Program: 75090
Project: 75090
Buggy source:
InlineContainerArea(IContent content){
  super(content);
}

Fixed version (ground truth):
InlineContainerArea(IContent content){
  super(content);
  needClip=true;
}
Program: 75091
Project: 75091
Buggy source:
/** 
 * This method will be invoked while a containerArea ends.
 * @param container the ContainerArea specified from layout
 */
protected void endContainer(IContainerArea container){
  if (container instanceof PageArea) {
    pageGraphic.dispose();
  }
 else {
    if (needClip(container)) {
      pageGraphic.clipRestore();
    }
  }
  if (!containerStack.isEmpty()) {
    containerStack.pop();
  }
}

Fixed version (ground truth):
/** 
 * This method will be invoked while a containerArea ends.
 * @param container the ContainerArea specified from layout
 */
protected void endContainer(IContainerArea container){
  if (container instanceof PageArea) {
    pageGraphic.dispose();
  }
 else {
    if (container.needClip()) {
      pageGraphic.clipRestore();
    }
  }
  if (!containerStack.isEmpty()) {
    containerStack.pop();
  }
}
Program: 75092
Project: 75092
Buggy source:
/** 
 * If the container is a PageArea, this method creates a pdf page. If the container is the other containerAreas, such as TableArea, or just the border of textArea/imageArea this method draws the border and background of the given container.
 * @param container the ContainerArea specified from layout
 */
protected void startContainer(IContainerArea container){
  if (container instanceof PageArea) {
    scale=container.getScale();
    hTextSpace=(int)(H_TEXT_SPACE * scale);
    vTextSpace=(int)(V_TEXT_SPACE * scale);
    newPage(container);
    containerStack.push(new ContainerPosition(0,0));
  }
 else {
    if (needClip(container)) {
      pageGraphic.clipSave();
      clip(container);
    }
    drawContainer(container);
    ContainerPosition pos;
    if (!containerStack.isEmpty()) {
      pos=(ContainerPosition)containerStack.peek();
      ContainerPosition current=new ContainerPosition(pos.x + getX(container),pos.y + getY(container));
      containerStack.push(current);
    }
 else {
      containerStack.push(new ContainerPosition(getX(container),getY(container)));
    }
  }
}

Fixed version (ground truth):
/** 
 * If the container is a PageArea, this method creates a pdf page. If the container is the other containerAreas, such as TableArea, or just the border of textArea/imageArea this method draws the border and background of the given container.
 * @param container the ContainerArea specified from layout
 */
protected void startContainer(IContainerArea container){
  if (container instanceof PageArea) {
    scale=container.getScale();
    hTextSpace=(int)(H_TEXT_SPACE * scale);
    vTextSpace=(int)(V_TEXT_SPACE * scale);
    newPage(container);
    containerStack.push(new ContainerPosition(0,0));
  }
 else {
    if (container.needClip()) {
      pageGraphic.clipSave();
      clip(container);
    }
    drawContainer(container);
    ContainerPosition pos;
    if (!containerStack.isEmpty()) {
      pos=(ContainerPosition)containerStack.peek();
      ContainerPosition current=new ContainerPosition(pos.x + getX(container),pos.y + getY(container));
      containerStack.push(current);
    }
 else {
      containerStack.push(new ContainerPosition(getX(container),getY(container)));
    }
  }
}
Program: 75094
Project: 75094
Buggy source:
/** 
 * 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);
}

Fixed version (ground truth):
/** 
 * 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);
}