nus-yam/ex-repair huggingface dataset:
Program: 65710
Project: 65710
Buggy source:
/** 
 * @throws IOException
 */
public BaseDiskArray() throws IOException {
  this.currentCacheStartIndex=0;
  this.size=0;
  this.buffer=new Object[bufferSize];
  this.segmentOffsets=new ArrayList();
  this.segmentOffsets.add(Integer.valueOf(0));
  createRandomAccessFile();
  DataEngineThreadLocal.getInstance().getCloseListener().add(this);
}

Fixed version (ground truth):
/** 
 * @throws IOException
 */
public BaseDiskArray() throws IOException {
  this.currentCacheStartIndex=0;
  this.size=0;
  this.buffer=new Object[bufferSize];
  this.segmentOffsets=new ArrayList<Long>();
  this.segmentOffsets.add(Long.valueOf(0L));
  createRandomAccessFile();
  DataEngineThreadLocal.getInstance().getCloseListener().add(this);
}
Program: 65711
Project: 65711
Buggy source:
/** 
 * @param index
 * @return
 */
private int getSegmentOffset(int index){
  return ((Integer)(this.segmentOffsets.get(index / bufferSize))).intValue();
}

Fixed version (ground truth):
/** 
 * @param index
 * @return
 */
private long getSegmentOffset(int index){
  return this.segmentOffsets.get(index / bufferSize).longValue();
}
Program: 65712
Project: 65712
Buggy source:
/** 
 * Reads up to <code>readSize</code> objects from disk.
 * @param dis
 * @param list
 * @return
 * @throws IOException
 */
private void readObjects(int offset,int readSize) throws IOException {
  this.randomAccessFile.seek(offset);
  for (int i=0; i < readSize; i++) {
    this.buffer[i]=readObject();
  }
}

Fixed version (ground truth):
/** 
 * Reads up to <code>readSize</code> objects from disk.
 * @param dis
 * @param list
 * @return
 * @throws IOException
 */
private void readObjects(long offset,int readSize) throws IOException {
  this.randomAccessFile.seek(offset);
  for (int i=0; i < readSize; i++) {
    this.buffer[i]=readObject();
  }
}
Program: 65713
Project: 65713
Buggy source:
private boolean placeContentWithSize(LegendItemHints lih,Point size) throws ChartException {
  if (!hasPlaceForOneItem(size,lgData)) {
    return false;
  }
  if (dX + size.getX() > lgData.dAvailableWidth + lgData.dSafeSpacing) {
    columnList.clear();
    return false;
  }
 else {
    if (dY + size.getY() > lgData.dAvailableHeight + lgData.dSafeSpacing) {
      flushColumnList();
      return placeContentWithSize(lih,size);
    }
 else {
      dMaxW=Math.max(size.getX(),dMaxW);
      dY+=size.getY();
      lih.validItemLen(laiItem.getValidTextLen());
      lih.left(dX);
      lih.itemHeight(laiItem.getHeight());
      if (lih.getType() == LegendItemHints.Type.LG_GROUPNAME) {
        gnList.add(lih);
        lih.top(dY - size.getY() + lgData.insCa.getTop());
        lih.width(size.getX());
      }
 else {
        lih.top(dY - size.getY());
        lih.width(size.getX() - lgData.dHorizonalReservedSpace);
        if (bIsShowValue) {
          lih.valueHeight(laiValue.getHeight()).validValueLen(laiValue.getValidTextLen());
        }
      }
      columnList.add(lih);
      return true;
    }
  }
}

Fixed version (ground truth):
private boolean placeContentWithSize(LegendItemHints lih,Point size) throws ChartException {
  if (!hasPlaceForOneItem(size,lgData)) {
    return false;
  }
  if (dX + size.getX() > lgData.dAvailableWidth + lgData.dSafeSpacing) {
    columnList.clear();
    return false;
  }
 else {
    if (dY + size.getY() > lgData.dAvailableHeight + lgData.dSafeSpacing) {
      flushColumnList();
      Point newSize=computeContentSize(lih);
      return placeContentWithSize(lih,newSize);
    }
 else {
      dMaxW=Math.max(size.getX(),dMaxW);
      dY+=size.getY();
      lih.validItemLen(laiItem.getValidTextLen());
      lih.left(dX);
      lih.itemHeight(laiItem.getHeight());
      if (lih.getType() == LegendItemHints.Type.LG_GROUPNAME) {
        gnList.add(lih);
        lih.top(dY - size.getY() + lgData.insCa.getTop());
        lih.width(size.getX());
      }
 else {
        lih.top(dY - size.getY());
        lih.width(size.getX() - lgData.dHorizonalReservedSpace);
        if (bIsShowValue) {
          lih.valueHeight(laiValue.getHeight()).validValueLen(laiValue.getValidTextLen());
        }
      }
      columnList.add(lih);
      return true;
    }
  }
}
Program: 65714
Project: 65714
Buggy source:
/** 
 * Sets up the thread context class loader to make sure that Derby works with our class loader
 */
private void initClassLoaders(){
  if (derbyClassLoader == null) {
    derbyClassLoader=new DerbyClassLoader();
  }
}

Fixed version (ground truth):
/** 
 * Sets up the thread context class loader to make sure that Derby works with our class loader
 */
private synchronized void initClassLoaders(){
  if (derbyClassLoader == null) {
    derbyClassLoader=new DerbyClassLoader();
  }
}
Program: 65715
Project: 65715
Buggy source:
/** 
 * Gets a new instance of Derby JDBC Driver
 */
private Driver getDerbyDriver() throws SQLException {
  if (derbyDriver == null) {
    try {
      derbyDriver=(Driver)Class.forName(SampleDBConstants.DERBY_DRIVER_CLASS,true,derbyClassLoader).newInstance();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,"String_Node_Str" + SampleDBConstants.DERBY_DRIVER_CLASS,e);
      throw new SQLException(e.getLocalizedMessage());
    }
  }
  return derbyDriver;
}

Fixed version (ground truth):
/** 
 * Gets a new instance of Derby JDBC Driver
 */
private synchronized Driver getDerbyDriver() throws SQLException {
  if (derbyDriver == null) {
    try {
      derbyDriver=(Driver)Class.forName(SampleDBConstants.DERBY_DRIVER_CLASS,true,derbyClassLoader).newInstance();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,"String_Node_Str" + SampleDBConstants.DERBY_DRIVER_CLASS,e);
      throw new SQLException(e.getLocalizedMessage());
    }
  }
  return derbyDriver;
}
Program: 65717
Project: 65717
Buggy source:
private void releaseValidationContexts(){
  for (  ValidationContext vc : validationContextMap.values()) {
    if (vc != null && vc.getConnection() != null) {
      vc.getConnection().close();
    }
  }
  validationContextMap=null;
}

Fixed version (ground truth):
private void releaseValidationContexts(){
  if (validationContextMap == null)   return;
  for (  ValidationContext vc : validationContextMap.values()) {
    if (vc != null && vc.getConnection() != null) {
      vc.getConnection().close();
    }
  }
  validationContextMap=null;
}
Program: 65719
Project: 65719
Buggy source:
public void addShutdownListener(IShutdownListener listener){
  if (shutdownListenerList == null)   shutdownListenerList=new ArrayList();
  for (int i=0; i < shutdownListenerList.size(); i++) {
    if (listener == shutdownListenerList.get(i))     return;
  }
  shutdownListenerList.add(listener);
}

Fixed version (ground truth):
public void addShutdownListener(IShutdownListener listener){
  if (shutdownListenerSet == null)   shutdownListenerSet=new LinkedHashSet<IShutdownListener>();
  if (shutdownListenerSet.contains(listener))   return;
  shutdownListenerSet.add(listener);
}
Program: 65720
Project: 65720
Buggy source:
public void removeListener(IShutdownListener listener){
  if (shutdownListenerList == null)   return;
  for (int i=0; i < shutdownListenerList.size(); i++) {
    if (listener == shutdownListenerList.get(i)) {
      shutdownListenerList.remove(i);
      return;
    }
  }
}

Fixed version (ground truth):
public void removeListener(IShutdownListener listener){
  if (shutdownListenerSet == null)   return;
  shutdownListenerSet.remove(listener);
}
Program: 65722
Project: 65722
Buggy source:
private StreamWriter getTempStreamManager(StreamID id){
  if (this.cachedStreamManagers.get(id) == null)   this.cachedStreamManagers.put(id,new StreamWriter(this.context,id));
  return (StreamWriter)this.cachedStreamManagers.get(id);
}

Fixed version (ground truth):
private StreamWriter getTempStreamManager(StreamID id){
  if (this.cachedStreamManagers.get(id) == null)   this.cachedStreamManagers.put(id,new StreamWriter(this.context,id));
  return this.cachedStreamManagers.get(id);
}
Program: 65723
Project: 65723
Buggy source:
/** 
 * @param context
 * @throws DataException 
 */
public StreamManager(DataEngineContext context,QueryResultInfo queryResultInfo) throws DataException {
  this.context=context;
  this.rootQueryResultID=queryResultInfo.getRootQueryResultID();
  this.parentQueryResultID=queryResultInfo.getParentQueryResultID();
  this.selfQueryResultID=queryResultInfo.getSelfQueryResultID();
  this.subQueryName=queryResultInfo.getSubQueryName();
  this.subQueryID=subQueryName == null ? null : QueryResultIDUtil.buildSubQueryID(subQueryName,queryResultInfo.getIndex());
  this.cachedStreamManagers=new HashMap();
  this.metaManagers=new HashMap();
  this.dataMetaManagers=new HashMap();
  VersionManager vm=new VersionManager(context);
  if (context.getMode() == DataEngineContext.MODE_GENERATION) {
    this.version=vm.getVersion(this.getQueryResultUID());
    if (this.version == VersionManager.VERSION_2_0) {
      this.version=VersionManager.getLatestVersion();
    }
    vm.setVersion(version,this.getQueryResultUID());
    vm.setVersion(VersionManager.getLatestVersion(),null);
  }
 else {
    String queryResultId=this.getQueryResultUID();
    this.version=vm.getVersion(queryResultId);
    if (this.version == 0 && queryResultId != null) {
      this.version=vm.getLatestVersion();
      if (this.context.getDocWriter() != null)       vm.setVersion(this.version,queryResultId);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param context
 * @throws DataException 
 */
public StreamManager(DataEngineContext context,QueryResultInfo queryResultInfo) throws DataException {
  this.context=context;
  this.rootQueryResultID=queryResultInfo.getRootQueryResultID();
  this.parentQueryResultID=queryResultInfo.getParentQueryResultID();
  this.selfQueryResultID=queryResultInfo.getSelfQueryResultID();
  this.subQueryName=queryResultInfo.getSubQueryName();
  this.subQueryID=subQueryName == null ? null : QueryResultIDUtil.buildSubQueryID(subQueryName,queryResultInfo.getIndex());
  this.cachedStreamManagers=new HashMap<StreamID,StreamWriter>();
  this.metaManagers=new HashMap<StreamID,MetaStreamReader>();
  this.dataMetaManagers=new HashMap<StreamID,DataStreamReader>();
  VersionManager vm=new VersionManager(context);
  if (context.getMode() == DataEngineContext.MODE_GENERATION) {
    this.version=vm.getVersion(this.getQueryResultUID());
    if (this.version == VersionManager.VERSION_2_0) {
      this.version=VersionManager.getLatestVersion();
    }
    vm.setVersion(version,this.getQueryResultUID());
    vm.setVersion(VersionManager.getLatestVersion(),null);
  }
 else {
    String queryResultId=this.getQueryResultUID();
    this.version=vm.getVersion(queryResultId);
    if (this.version == 0 && queryResultId != null) {
      this.version=VersionManager.getLatestVersion();
      if (this.context.getDocWriter() != null)       vm.setVersion(this.version,queryResultId);
    }
  }
}
Program: 65724
Project: 65724
Buggy source:
/** 
 * @param id
 * @return
 * @throws DataException
 */
private StreamReader getMetaManager(StreamID id,int sType) throws DataException {
  if (sType == DataEngineContext.DATASET_DATA_STREAM || sType == DataEngineContext.DATASET_META_STREAM) {
    if (this.dataMetaManagers.get(id) == null)     this.dataMetaManagers.put(id,new DataStreamReader(this.context,id));
    return (StreamReader)this.dataMetaManagers.get(id);
  }
  if (this.metaManagers.get(id) == null) {
    this.metaManagers.put(id,new MetaStreamReader(this.context,id));
  }
  return (StreamReader)this.metaManagers.get(id);
}

Fixed version (ground truth):
/** 
 * @param id
 * @return
 * @throws DataException
 */
private StreamReader getMetaManager(StreamID id,int sType) throws DataException {
  if (sType == DataEngineContext.DATASET_DATA_STREAM || sType == DataEngineContext.DATASET_META_STREAM) {
    if (this.dataMetaManagers.get(id) == null)     this.dataMetaManagers.put(id,new DataStreamReader(this.context,id));
    return this.dataMetaManagers.get(id);
  }
  if (this.metaManagers.get(id) == null) {
    this.metaManagers.put(id,new MetaStreamReader(this.context,id));
  }
  return this.metaManagers.get(id);
}
Program: 65725
Project: 65725
Buggy source:
/** 
 * @param context
 * @param id
 */
public StreamWriter(DataEngineContext context,StreamID id){
  this.id=id;
  this.cachedStreams=new HashMap();
  this.context=context;
}

Fixed version (ground truth):
/** 
 * @param context
 * @param id
 */
public StreamWriter(DataEngineContext context,StreamID id){
  this.id=id;
  this.cachedStreams=new HashMap<Integer,OutputStream>();
  this.context=context;
}
Program: 65726
Project: 65726
Buggy source:
public static QuerySpecification optimizeExecution(String dataSourceId,ValidationContext validationContext,IOdaDataSetDesign dataSetDesign,IQueryDefinition query,DataEngineSession session,Map appContext,IQueryContextVisitor contextVisitor){
  return null;
}

Fixed version (ground truth):
public static QuerySpecification optimizeExecution(String dataSourceId,ValidationContext validationContext,IOdaDataSetDesign dataSetDesign,IQueryDefinition query,DataEngineSession session,Map appContext,IQueryContextVisitor contextVisitor) throws DataException {
  return null;
}
Program: 65727
Project: 65727
Buggy source:
/** 
 * Destroy action
 * @param rollback true: rollback to savedItemModel false: do nothing
 */
public void destory(boolean rollback){
  if (rollback) {
    if (ds instanceof OdaDataSetHandle) {
      try {
        ((OdaDataSetHandle)ds).setQueryText(this.savedQueryText);
        DataSetProvider.getCurrentInstance().getDataSetDesign(ds,true,true);
      }
 catch (      SemanticException e) {
      }
catch (      BirtException e) {
      }
    }
    DataSetProvider.getCurrentInstance().setModelOfDataSetHandle(this.ds,savedItemModel);
  }
  Thread.currentThread().setContextClassLoader(oldContextLoader);
  if (ds != null)   ds.removeListener(this);
}

Fixed version (ground truth):
/** 
 * Destroy action
 * @param rollback true: rollback to savedItemModel false: do nothing
 */
public void destory(boolean rollback){
  if (rollback) {
    if (ds instanceof OdaDataSetHandle) {
      try {
        ((OdaDataSetHandle)ds).setQueryText(this.savedQueryText);
      }
 catch (      SemanticException e) {
      }
catch (      BirtException e) {
      }
    }
    DataSetProvider.getCurrentInstance().setModelOfDataSetHandle(this.ds,savedItemModel);
  }
  Thread.currentThread().setContextClassLoader(oldContextLoader);
  DataSetProvider.getCurrentInstance().clear(ds);
  if (ds != null)   ds.removeListener(this);
}
Program: 65728
Project: 65728
Buggy source:
/** 
 * Creates a PdfAction.
 * @param hyperlink the hyperlink.
 * @param bookmark the bookmark.
 * @param target if target equals "_blank", the target will be opened in a new window, else the target will be opened in the current window.
 * @return the created PdfAction.
 */
private PdfAction createPdfAction(String hyperlink,String bookmark,String target,int type){
  if ("String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target)|| "String_Node_Str".equalsIgnoreCase(target)) {
    return new PdfAction(hyperlink);
  }
 else {
    if (type == IHyperlinkAction.ACTION_BOOKMARK) {
      return PdfAction.gotoLocalPage(bookmark,false);
    }
 else {
      return PdfAction.gotoRemotePage(hyperlink,bookmark,false,false);
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates a PdfAction.
 * @param hyperlink the hyperlink.
 * @param bookmark the bookmark.
 * @param target if target equals "_blank", the target will be opened in a new window, else the target will be opened in the current window.
 * @return the created PdfAction.
 */
private PdfAction createPdfAction(String hyperlink,String bookmark,String target,int type){
  if ("String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target)|| "String_Node_Str".equalsIgnoreCase(target)) {
    Matcher matcherHtml=PAGE_LINK_PATTERN_HTML.matcher(hyperlink);
    if (matcherHtml.find()) {
      return new PdfAction(hyperlink);
    }
    Matcher matcherLocal=PAGE_LINK_PATTERN_LOCAL.matcher(hyperlink);
    if (matcherLocal.find()) {
      String fileName=matcherLocal.group(1);
      String pageNumber=matcherLocal.group(matcherLocal.groupCount());
      return new PdfAction(fileName,Integer.valueOf(pageNumber));
    }
    return new PdfAction(hyperlink);
  }
 else {
    if (type == IHyperlinkAction.ACTION_BOOKMARK) {
      return PdfAction.gotoLocalPage(bookmark,false);
    }
 else {
      return PdfAction.gotoRemotePage(hyperlink,bookmark,false,false);
    }
  }
}
Program: 65730
Project: 65730
Buggy source:
/** 
 * Gets the BaseFont object to display the given character. The search sequence is: <li> try the font family defined in the families to see if one can be used to display the character. </li> <li> try to use the default font to display the character. </li> <li> if none of the above sucess, return NULL for the character.</li>
 * @param c the given character.
 * @return the BaseFont. it alwys return a font.
 */
public BaseFont getMappedFont(char c){
  for (int i=0; i < fontFamilies.length; i++) {
    String fontFamily=fontManager.getAliasedFont(fontFamilies[i]);
    CompositeFont cf=fontManager.getCompositeFont(fontFamily);
    if (cf != null) {
      String usedFont=cf.getUsedFont(c);
      if (usedFont != null) {
        BaseFont bf=createBaseFont(usedFont);
        if (bf != null) {
          return bf;
        }
      }
    }
 else {
      BaseFont bf=createBaseFont(fontFamily);
      if (bf != null && bf.charExists(c)) {
        return bf;
      }
    }
  }
  CompositeFont df=fontManager.getCompositeFont(FontMappingManager.FONT_NAME_ALL_FONTS);
  if (df != null) {
    String usedFont=df.getUsedFont(c);
    if (usedFont != null) {
      BaseFont bf=createBaseFont(usedFont);
      if (bf != null) {
        return bf;
      }
    }
  }
  BaseFont bf=createBaseFont(FontMappingManager.DEFAULT_FONT);
  if (bf == null) {
    throw new NullPointerException("String_Node_Str" + FontMappingManager.DEFAULT_FONT + "String_Node_Str");
  }
  return bf;
}

Fixed version (ground truth):
/** 
 * Gets the BaseFont object to display the given character. The search sequence is: <li> try the font family defined in the families to see if one can be used to display the character. </li> <li> try to use the default font to display the character. </li> <li> if none of the above success, return NULL for the character.</li>
 * @param c the given character.
 * @return the BaseFont. it always return a font.
 */
public BaseFont getMappedFont(char c){
  if (WEAK_FONT_CHARS.indexOf(c) != -1) {
    if (bf != null && bf.charExists(c)) {
      return bf;
    }
  }
  for (int i=0; i < fontFamilies.length; i++) {
    String fontFamily=fontManager.getAliasedFont(fontFamilies[i]);
    CompositeFont cf=fontManager.getCompositeFont(fontFamily);
    if (cf != null) {
      String usedFont=cf.getUsedFont(c);
      if (usedFont != null) {
        BaseFont bf=createBaseFont(usedFont);
        if (bf != null) {
          return bf;
        }
      }
    }
 else {
      BaseFont bf=createBaseFont(fontFamily);
      if (bf != null && bf.charExists(c)) {
        return bf;
      }
    }
  }
  CompositeFont df=fontManager.getCompositeFont(FontMappingManager.FONT_NAME_ALL_FONTS);
  if (df != null) {
    String usedFont=df.getUsedFont(c);
    if (usedFont != null) {
      BaseFont bf=createBaseFont(usedFont);
      if (bf != null) {
        return bf;
      }
    }
  }
  BaseFont bf=createBaseFont(FontMappingManager.DEFAULT_FONT);
  if (bf == null) {
    throw new NullPointerException("String_Node_Str" + FontMappingManager.DEFAULT_FONT + "String_Node_Str");
  }
  return bf;
}
Program: 65731
Project: 65731
Buggy source:
/** 
 * Creates a PdfAction.
 * @param hyperlink the hyperlink.
 * @param bookmark the bookmark.
 * @param target if target equals "_blank", the target will be opened in a new window, else the target will be opened in the current window.
 * @return the created PdfAction.
 */
private PdfAction createPdfAction(String hyperlink,String bookmark,String target,int type){
  if ("String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target)|| "String_Node_Str".equalsIgnoreCase(target)) {
    return new PdfAction(hyperlink);
  }
 else {
    if (type == IHyperlinkAction.ACTION_BOOKMARK) {
      return PdfAction.gotoLocalPage(bookmark,false);
    }
 else {
      return PdfAction.gotoRemotePage(hyperlink,bookmark,false,false);
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates a PdfAction.
 * @param hyperlink the hyperlink.
 * @param bookmark the bookmark.
 * @param target if target equals "_blank", the target will be opened in a new window, else the target will be opened in the current window.
 * @return the created PdfAction.
 */
private PdfAction createPdfAction(String hyperlink,String bookmark,String target,int type){
  if ("String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target)|| "String_Node_Str".equalsIgnoreCase(target)) {
    Matcher matcherHtml=PAGE_LINK_PATTERN_HTML.matcher(hyperlink);
    if (matcherHtml.find()) {
      return new PdfAction(hyperlink);
    }
    Matcher matcherLocal=PAGE_LINK_PATTERN_LOCAL.matcher(hyperlink);
    if (matcherLocal.find()) {
      String fileName=matcherLocal.group(1);
      String pageNumber=matcherLocal.group(matcherLocal.groupCount());
      return new PdfAction(fileName,Integer.valueOf(pageNumber));
    }
    return new PdfAction(hyperlink);
  }
 else {
    if (type == IHyperlinkAction.ACTION_BOOKMARK) {
      return PdfAction.gotoLocalPage(bookmark,false);
    }
 else {
      return PdfAction.gotoRemotePage(hyperlink,bookmark,false,false);
    }
  }
}
Program: 65732
Project: 65732
Buggy source:
public void onPage(long page,Object pageContext){
  context.firePageBreakEvent();
}

Fixed version (ground truth):
public void onPage(long page,Object pageContext){
  if (pageContext instanceof HTMLLayoutContext) {
    context.firePageBreakEvent(((HTMLLayoutContext)pageContext).isHorizontalPageBreak());
  }
 else {
    context.firePageBreakEvent(false);
  }
}
Program: 65733
Project: 65733
Buggy source:
/** 
 * Notify page break listeners that page is broken.
 */
public void firePageBreakEvent(){
  if (pageBreakListeners != null) {
    for (int i=0; i < pageBreakListeners.size(); i++) {
      ((IPageBreakListener)pageBreakListeners.get(i)).onPageBreak();
    }
  }
}

Fixed version (ground truth):
/** 
 * Notify page break listeners that page is broken.
 */
public void firePageBreakEvent(boolean isHorizontalPageBreak){
  if (pageBreakListeners != null) {
    for (int i=0; i < pageBreakListeners.size(); i++) {
      ((IPageBreakListener)pageBreakListeners.get(i)).onPageBreak(isHorizontalPageBreak);
    }
  }
}
Program: 65734
Project: 65734
Buggy source:
/** 
 * Handler to preocess page break before event.
 */
void onPageBreak();

Fixed version (ground truth):
/** 
 * Handler to preocess page break before event.
 */
void onPageBreak(boolean isHorizontalPageBreak);
Program: 65735
Project: 65735
Buggy source:
void next(){
  if (pageBreakInterval > 0) {
    pageRowCount++;
    ignorePageBreak=false;
  }
}

Fixed version (ground truth):
void next(){
  if (pageBreakInterval > 0) {
    pageRowCount++;
  }
}
Program: 65736
Project: 65736
Buggy source:
public void onPageBreak(){
  if (!ignorePageBreak) {
    pageRowCount=0;
    if (addAfterBreak) {
      next();
      addAfterBreak=false;
    }
 else {
      if (softBreakBefore) {
        softBreakBefore=false;
      }
    }
    ignorePageBreak=true;
  }
}

Fixed version (ground truth):
public void onPageBreak(boolean isHorizontalPageBreak){
  if (!isHorizontalPageBreak) {
    pageRowCount=0;
    if (addAfterBreak) {
      next();
      addAfterBreak=false;
    }
 else {
      if (softBreakBefore) {
        softBreakBefore=false;
      }
    }
  }
}
Program: 65737
Project: 65737
Buggy source:
/** 
 * access the query and create the contents. the execution process is: <li> the cursor is at the begin of result set. <li> call listing's onStart event <li> create the header <li> for each row: <ul> <li> call onRow event. <li> if the row start some groups, create the group header for that group. <li> create the detail row. <li> if the row end some groups, create the group footer for that group. </ul> <li> create the footer. <li> call the onFinish event.
 */
public void close() throws BirtException {
  if (pageBreakInterval != -1) {
    context.removePageBreakListener(this);
  }
  rsetCursor=-1;
  needPageBreak=false;
  pageRowCount=0;
  pageBreakInterval=-1;
  executableElements=null;
  totalElements=0;
  currentElement=0;
  endOfListing=false;
  breakOnDetailBand=false;
  pageBreakLevel=-1;
  softBreakBefore=false;
  addAfterBreak=false;
  ignorePageBreak=true;
  super.close();
}

Fixed version (ground truth):
/** 
 * access the query and create the contents. the execution process is: <li> the cursor is at the begin of result set. <li> call listing's onStart event <li> create the header <li> for each row: <ul> <li> call onRow event. <li> if the row start some groups, create the group header for that group. <li> create the detail row. <li> if the row end some groups, create the group footer for that group. </ul> <li> create the footer. <li> call the onFinish event.
 */
public void close() throws BirtException {
  if (pageBreakInterval != -1) {
    context.removePageBreakListener(this);
  }
  rsetCursor=-1;
  needPageBreak=false;
  pageRowCount=0;
  pageBreakInterval=-1;
  executableElements=null;
  totalElements=0;
  currentElement=0;
  endOfListing=false;
  breakOnDetailBand=false;
  pageBreakLevel=-1;
  softBreakBefore=false;
  addAfterBreak=false;
  super.close();
}
Program: 65738
Project: 65738
Buggy source:
protected void pageBreakEvent(){
  context.getPageHintManager().setPageHint(generator.getPageHint());
  long pageNumber=context.getPageNumber();
  ILayoutPageHandler pageHandler=context.getLayoutEngine().getPageHandler();
  if (pageHandler != null) {
    pageHandler.onPage(pageNumber,context);
  }
}

Fixed version (ground truth):
protected void pageBreakEvent(){
  context.getPageHintManager().setPageHint(generator.getPageHint());
  long pageNumber=context.getPageNumber();
  ILayoutPageHandler pageHandler=context.getLayoutEngine().getPageHandler();
  if (pageHandler != null) {
    context.setHorizontalPageBreak(true);
    pageHandler.onPage(pageNumber,context);
    context.setHorizontalPageBreak(false);
  }
}
Program: 65742
Project: 65742
Buggy source:
/** 
 * initialize browser.
 * @param display Display
 * @param browser Browser
 * @return
 */
private static void initialize(final Display display,Browser browser){
  browser.addOpenWindowListener(new OpenWindowListener(){
    public void open(    final WindowEvent event){
      final Shell shell=UIUtil.createDefaultShell();
      shell.setLayout(new FillLayout());
      Browser browser=new Browser(shell,SWT.NONE);
      initialize(display,browser);
      event.browser=browser;
      shell.open();
    }
  }
);
  browser.addTitleListener(new TitleListener(){
    public void changed(    TitleEvent event){
      if (event.title != null && event.title.length() > 0) {
        Browser browser=(Browser)event.widget;
        Shell shell=browser.getShell();
        shell.setText(event.title);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * initialize browser.
 * @param display Display
 * @param browser Browser
 * @return
 */
private static void initialize(final Display display,Browser browser){
  browser.addOpenWindowListener(new OpenWindowListener(){
    public void open(    final WindowEvent event){
      final Shell shell=UIUtil.createDefaultShell();
      shell.setLayout(new FillLayout());
      Browser browser;
      if (Constants.OS_LINUX.equalsIgnoreCase(Platform.getOS())) {
        browser=new Browser(shell,SWT.MOZILLA);
      }
 else {
        browser=new Browser(shell,SWT.NONE);
      }
      initialize(display,browser);
      event.browser=browser;
      shell.open();
    }
  }
);
  browser.addTitleListener(new TitleListener(){
    public void changed(    TitleEvent event){
      if (event.title != null && event.title.length() > 0) {
        Browser browser=(Browser)event.widget;
        Shell shell=browser.getShell();
        shell.setText(event.title);
      }
    }
  }
);
}
Program: 65743
Project: 65743
Buggy source:
public void open(final WindowEvent event){
  final Shell shell=UIUtil.createDefaultShell();
  shell.setLayout(new FillLayout());
  Browser browser=new Browser(shell,SWT.NONE);
  initialize(display,browser);
  event.browser=browser;
  shell.open();
}

Fixed version (ground truth):
public void open(final WindowEvent event){
  final Shell shell=UIUtil.createDefaultShell();
  shell.setLayout(new FillLayout());
  Browser browser;
  if (Constants.OS_LINUX.equalsIgnoreCase(Platform.getOS())) {
    browser=new Browser(shell,SWT.MOZILLA);
  }
 else {
    browser=new Browser(shell,SWT.NONE);
  }
  initialize(display,browser);
  event.browser=browser;
  shell.open();
}
Program: 65747
Project: 65747
Buggy source:
public SplitResult split(int height,boolean force) throws BirtException {
  assert(height < this.height);
  LineArea result=null;
  Iterator iter=children.iterator();
  while (iter.hasNext()) {
    ContainerArea child=(ContainerArea)iter.next();
    if (child.getMinYPosition() <= height) {
      iter.remove();
      if (result == null) {
        result=cloneArea();
      }
      result.addChild(child);
      child.setParent(result);
    }
 else {
      SplitResult splitChild=child.split(height - child.getY(),force);
      ContainerArea splitChildArea=splitChild.getResult();
      if (splitChildArea != null) {
        if (result == null) {
          result=cloneArea();
        }
        result.addChild(splitChildArea);
        splitChildArea.setParent(result);
      }
    }
  }
  if (result != null) {
    int h=0;
    iter=result.getChildren();
    while (iter.hasNext()) {
      ContainerArea child=(ContainerArea)iter.next();
      h=Math.max(h,child.getAllocatedHeight());
    }
    result.setHeight(h);
  }
  if (children.size() > 0) {
    int h=0;
    iter=getChildren();
    while (iter.hasNext()) {
      ContainerArea child=(ContainerArea)iter.next();
      h=Math.max(h,child.getAllocatedHeight());
    }
    setHeight(h);
  }
  if (result != null) {
    return new SplitResult(result,SplitResult.SPLIT_SUCCEED_WITH_PART);
  }
 else {
    return SplitResult.SUCCEED_WITH_NULL;
  }
}

Fixed version (ground truth):
public SplitResult split(int height,boolean force) throws BirtException {
  assert(height < this.height);
  LineArea result=null;
  Iterator iter=children.iterator();
  while (iter.hasNext()) {
    ContainerArea child=(ContainerArea)iter.next();
    if (child.getMinYPosition() <= height) {
      iter.remove();
      if (result == null) {
        result=cloneArea();
      }
      result.addChild(child);
      child.setParent(result);
    }
 else {
      SplitResult splitChild=child.split(height - child.getY(),force);
      ContainerArea splitChildArea=splitChild.getResult();
      if (splitChildArea != null) {
        if (result == null) {
          result=cloneArea();
        }
        result.addChild(splitChildArea);
        splitChildArea.setParent(result);
      }
 else {
        child.setY(Math.max(0,child.getY() - height));
      }
    }
  }
  if (result != null) {
    int h=0;
    iter=result.getChildren();
    while (iter.hasNext()) {
      ContainerArea child=(ContainerArea)iter.next();
      h=Math.max(h,child.getAllocatedHeight());
    }
    result.setHeight(h);
  }
  if (children.size() > 0) {
    int h=0;
    iter=getChildren();
    while (iter.hasNext()) {
      ContainerArea child=(ContainerArea)iter.next();
      h=Math.max(h,child.getAllocatedHeight());
    }
    setHeight(h);
  }
  if (result != null) {
    return new SplitResult(result,SplitResult.SPLIT_SUCCEED_WITH_PART);
  }
 else {
    return SplitResult.SUCCEED_WITH_NULL;
  }
}
Program: 65748
Project: 65748
Buggy source:
public List getModelList(){
  init();
  List list=new ArrayList();
  List columns=buildColumnArea();
  List rows=buildRowArea();
  List details=buildMeasures();
  adjustDirection(columns,rows);
  buildModel(list,columns,rows,details);
  adjustColumn(columns,details);
  adjustRow(rows,details);
  buildLeftConner(list);
  adjustGrandTotal(list);
  Collections.sort(list,new ModelComparator());
  oldModelList=list;
  return list;
}

Fixed version (ground truth):
public List getModelList(){
  init();
  List list=new ArrayList();
  List columns=buildColumnArea();
  List rows=buildRowArea();
  List details=buildMeasures();
  adjustDirection(columns,rows);
  buildModel(list,columns,rows,details);
  adjustColumn(columns,details);
  adjustRow(rows,details);
  List leftConner=new ArrayList();
  buildLeftConner(leftConner);
  list.addAll(leftConner);
  adjustGrandTotal(list,(CrosstabCellAdapter)leftConner.get(leftConner.size() - 1));
  Collections.sort(list,new ModelComparator());
  oldModelList=list;
  return list;
}
Program: 65749
Project: 65749
Buggy source:
private void adjustGrandTotal(List list){
  CrosstabCellAdapter first=(CrosstabCellAdapter)list.get(0);
  int rowCount=getRowCount();
  int columnCount=getColumnCount();
  for (int i=0; i < list.size(); i++) {
    CrosstabCellAdapter cellAdapter=(CrosstabCellAdapter)list.get(i);
    if (adjustGrandColumn > 0) {
      int beforeColumnNumber=columnCount - adjustGrandColumn;
      int cellColumnNumber=cellAdapter.getColumnNumber();
      if (cellColumnNumber > first.getColumnNumber() + first.getColumnSpan() - 1) {
        if (cellColumnNumber <= beforeColumnNumber) {
          cellAdapter.setColumnNumber(cellColumnNumber + adjustGrandColumn);
        }
 else {
          cellAdapter.setColumnNumber(cellColumnNumber - beforeColumnNumber + first.getColumnNumber() + first.getColumnSpan() - 1);
        }
      }
    }
    if (adjustGrandRow > 0) {
      int beforeRowNumber=rowCount - adjustGrandRow;
      int cellRowNumber=cellAdapter.getRowNumber();
      if (cellRowNumber > first.getRowNumber() + first.getRowSpan() - 1) {
        if (cellRowNumber <= beforeRowNumber) {
          cellAdapter.setRowNumber(cellRowNumber + adjustGrandRow);
        }
 else {
          cellAdapter.setRowNumber(cellRowNumber - beforeRowNumber + first.getRowNumber() + first.getRowSpan() - 1);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void adjustGrandTotal(List list,CrosstabCellAdapter first){
  int rowCount=getRowCount();
  int columnCount=getColumnCount();
  for (int i=0; i < list.size(); i++) {
    CrosstabCellAdapter cellAdapter=(CrosstabCellAdapter)list.get(i);
    if (adjustGrandColumn > 0) {
      int beforeColumnNumber=columnCount - adjustGrandColumn;
      int cellColumnNumber=cellAdapter.getColumnNumber();
      if (cellColumnNumber > first.getColumnNumber() + first.getColumnSpan() - 1) {
        if (cellColumnNumber <= beforeColumnNumber) {
          cellAdapter.setColumnNumber(cellColumnNumber + adjustGrandColumn);
        }
 else {
          cellAdapter.setColumnNumber(cellColumnNumber - beforeColumnNumber + first.getColumnNumber() + first.getColumnSpan() - 1);
        }
      }
    }
    if (adjustGrandRow > 0) {
      int beforeRowNumber=rowCount - adjustGrandRow;
      int cellRowNumber=cellAdapter.getRowNumber();
      if (cellRowNumber > first.getRowNumber() + first.getRowSpan() - 1) {
        if (cellRowNumber <= beforeRowNumber) {
          cellAdapter.setRowNumber(cellRowNumber + adjustGrandRow);
        }
 else {
          cellAdapter.setRowNumber(cellRowNumber - beforeRowNumber + first.getRowNumber() + first.getRowSpan() - 1);
        }
      }
    }
  }
}
Program: 65750
Project: 65750
Buggy source:
@Override public void setFocus(){
}

Fixed version (ground truth):
@Override public void setFocus(){
  if (fComposite != null && !fComposite.isDisposed()) {
    fComposite.setFocus();
  }
}
Program: 65751
Project: 65751
Buggy source:
@Override public void setFocus(){
}

Fixed version (ground truth):
@Override public void setFocus(){
  if (fComposite != null && !fComposite.isDisposed()) {
    fComposite.setFocus();
  }
}
Program: 65755
Project: 65755
Buggy source:
/** 
 * Constructor embedded browser.
 * @param event
 * @param parent Shell or null
 */
public EmbeddedBrowser(WindowEvent event,Shell parent){
  if (parent == null) {
    shell=new Shell(SWT.SHELL_TRIM | Window.getDefaultOrientation());
  }
 else {
    shell=new Shell(parent,SWT.PRIMARY_MODAL | SWT.DIALOG_TRIM);
  }
  initializeShell(shell);
  Browser browser=new Browser(shell,SWT.NONE);
  initialize(shell.getDisplay(),browser);
  event.browser=browser;
  browser.addLocationListener(new LocationListener(){
    public void changing(    LocationEvent e){
      modalRequestTime=0;
      if (e.location != null && e.location.startsWith("String_Node_Str")) {
        modalRequestTime=System.currentTimeMillis();
      }
    }
    public void changed(    LocationEvent e){
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Constructor embedded browser.
 * @param event
 * @param parent Shell or null
 */
public EmbeddedBrowser(WindowEvent event,Shell parent){
  if (parent == null) {
    shell=new Shell(SWT.SHELL_TRIM | Window.getDefaultOrientation());
  }
 else {
    shell=new Shell(parent,SWT.PRIMARY_MODAL | SWT.DIALOG_TRIM);
  }
  initializeShell(shell);
  Browser browser=null;
  if (Constants.OS_LINUX.equalsIgnoreCase(Platform.getOS())) {
    browser=new Browser(shell,SWT.MOZILLA);
  }
 else {
    browser=new Browser(shell,SWT.NONE);
  }
  initialize(shell.getDisplay(),browser);
  event.browser=browser;
  browser.addLocationListener(new LocationListener(){
    public void changing(    LocationEvent e){
      modalRequestTime=0;
      if (e.location != null && e.location.startsWith("String_Node_Str")) {
        modalRequestTime=System.currentTimeMillis();
      }
    }
    public void changed(    LocationEvent e){
    }
  }
);
}
Program: 65756
Project: 65756
Buggy source:
/** 
 * @return
 * @throws DataException 
 */
private QueryDefinition newSummaryQuery() throws DataException {
  QueryDefinition qd=newReportQuery();
  qd.setIsSummaryQuery(true);
  qd.setUsesDetails(false);
  GroupDefinition gd=new GroupDefinition("String_Node_Str");
  gd.setKeyColumn("String_Node_Str");
  qd.addGroup(gd);
  GroupDefinition gd2=new GroupDefinition("String_Node_Str");
  gd2.setKeyColumn("String_Node_Str");
  qd.addGroup(gd2);
  this.bindingName=new String[3];
  this.bindingName[0]="String_Node_Str";
  this.bindingName[1]="String_Node_Str";
  this.bindingName[2]="String_Node_Str";
  IBinding[] binding;
  binding=new Binding[3];
  binding[0]=new Binding(this.bindingName[0],new ScriptExpression("String_Node_Str"));
  binding[1]=new Binding(this.bindingName[1],new ScriptExpression("String_Node_Str"));
  binding[2]=new Binding(this.bindingName[2]);
  binding[2].setAggrFunction(IBuildInAggregation.TOTAL_SUM_FUNC);
  binding[2].setExpression(new ScriptExpression("String_Node_Str"));
  binding[2].addAggregateOn("String_Node_Str");
  qd.addBinding(binding[0]);
  qd.addBinding(binding[1]);
  qd.addBinding(binding[2]);
  return qd;
}

Fixed version (ground truth):
/** 
 * @return
 * @throws DataException 
 */
private QueryDefinition newSummaryQuery() throws DataException {
  QueryDefinition qd=newReportQuery();
  qd.setIsSummaryQuery(true);
  qd.setUsesDetails(false);
  GroupDefinition gd=new GroupDefinition("String_Node_Str");
  gd.setKeyColumn("String_Node_Str");
  qd.addGroup(gd);
  GroupDefinition gd2=new GroupDefinition("String_Node_Str");
  gd2.setKeyColumn("String_Node_Str");
  qd.addGroup(gd2);
  this.bindingName=new String[3];
  this.bindingName[0]="String_Node_Str";
  this.bindingName[1]="String_Node_Str";
  this.bindingName[2]="String_Node_Str";
  IBinding[] binding;
  binding=new Binding[3];
  binding[0]=new Binding(this.bindingName[0],new ScriptExpression("String_Node_Str"));
  binding[1]=new Binding(this.bindingName[1],new ScriptExpression("String_Node_Str"));
  binding[2]=new Binding(this.bindingName[2]);
  binding[2].setAggrFunction(IBuildInAggregation.TOTAL_SUM_FUNC);
  binding[2].setExpression(new ScriptExpression("String_Node_Str"));
  binding[2].addAggregateOn("String_Node_Str");
  binding[2].setDataType(DataType.DOUBLE_TYPE);
  qd.addBinding(binding[0]);
  qd.addBinding(binding[1]);
  qd.addBinding(binding[2]);
  return qd;
}
Program: 65757
Project: 65757
Buggy source:
private void addExtraAggregation(QueryDefinition genquery) throws DataException {
  IBinding binding1=new Binding("String_Node_Str");
  binding1.setAggrFunction("String_Node_Str");
  binding1.addAggregateOn("String_Node_Str");
  IBinding binding2=new Binding("String_Node_Str");
  binding2.setAggrFunction("String_Node_Str");
  binding2.addAggregateOn("String_Node_Str");
  IBinding binding3=new Binding("String_Node_Str");
  binding3.setExpression(new ScriptExpression("String_Node_Str"));
  IBinding binding4=new Binding("String_Node_Str");
  binding4.setExpression(new ScriptExpression("String_Node_Str"));
  IBinding binding5=new Binding("String_Node_Str");
  binding5.setExpression(new ScriptExpression("String_Node_Str"));
  genquery.addBinding(binding1);
  genquery.addBinding(binding2);
  genquery.addBinding(binding3);
  genquery.addBinding(binding4);
  genquery.addBinding(binding5);
}

Fixed version (ground truth):
private void addExtraAggregation(QueryDefinition genquery) throws DataException {
  IBinding binding1=new Binding("String_Node_Str");
  binding1.setAggrFunction("String_Node_Str");
  binding1.addAggregateOn("String_Node_Str");
  IBinding binding2=new Binding("String_Node_Str");
  binding2.setAggrFunction("String_Node_Str");
  binding2.addAggregateOn("String_Node_Str");
  IBinding binding3=new Binding("String_Node_Str");
  binding3.setExpression(new ScriptExpression("String_Node_Str"));
  IBinding binding4=new Binding("String_Node_Str");
  binding4.setExpression(new ScriptExpression("String_Node_Str"));
  IBinding binding5=new Binding("String_Node_Str");
  binding5.setExpression(new ScriptExpression("String_Node_Str"));
  binding1.setDataType(DataType.INTEGER_TYPE);
  binding2.setDataType(DataType.INTEGER_TYPE);
  binding3.setDataType(DataType.DOUBLE_TYPE);
  binding4.setDataType(DataType.DOUBLE_TYPE);
  binding5.setDataType(DataType.DOUBLE_TYPE);
  genquery.addBinding(binding1);
  genquery.addBinding(binding2);
  genquery.addBinding(binding3);
  genquery.addBinding(binding4);
  genquery.addBinding(binding5);
}
Program: 65758
Project: 65758
Buggy source:
public void doSave(DataOutputStream outputStream,DataOutputStream rowLensStream,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> index,List<IBinding> cacheRequestMap) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=this.resultObjects.length;
    int colCount=getColumnCount(this.rsMeta);
    IOUtil.writeInt(dos,rowCount);
    long offset=4;
    for (int i=0; i < rowCount; i++) {
      IOUtil.writeLong(rowLensStream,offset);
      offset+=ResultSetUtil.writeResultObject(dos,resultObjects[i],colCount,resultSetNameSet,stringTable,index,i);
    }
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
public void doSave(DataOutputStream outputStream,DataOutputStream rowLensStream,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> index,List<IBinding> cacheRequestMap,int version) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=this.resultObjects.length;
    int colCount=getColumnCount(this.rsMeta);
    IOUtil.writeInt(dos,rowCount);
    long offset=4;
    for (int i=0; i < rowCount; i++) {
      IOUtil.writeLong(rowLensStream,offset);
      offset+=ResultSetUtil.writeResultObject(dos,resultObjects[i],colCount,resultSetNameSet,stringTable,index,i,version);
    }
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 65759
Project: 65759
Buggy source:
public void incrementalUpdate(OutputStream outputStream,OutputStream rowLensStream,int originalRowCount,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> map,List<IBinding> cacheRequestMap) throws DataException {
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=originalRowCount + this.resultObjects.length;
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(outputStream,rowCount);
    if (outputStream instanceof RAOutputStream)     ((RAOutputStream)outputStream).seek(((RAOutputStream)outputStream).length());
    if (rowLensStream instanceof RAOutputStream)     ((RAOutputStream)rowLensStream).seek(((RAOutputStream)rowLensStream).length());
    DataOutputStream dos=new DataOutputStream(outputStream);
    DataOutputStream rlos=new DataOutputStream(rowLensStream);
    long offset=4;
    if (outputStream instanceof RAOutputStream)     offset=((RAOutputStream)outputStream).length();
    for (int i=0; i < rowCount - originalRowCount; i++) {
      IOUtil.writeLong(rlos,offset);
      offset+=ResultSetUtil.writeResultObject(dos,resultObjects[i],colCount,resultSetNameSet,stringTable,map,originalRowCount + i);
    }
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
public void incrementalUpdate(OutputStream outputStream,OutputStream rowLensStream,int originalRowCount,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> map,List<IBinding> cacheRequestMap,int version) throws DataException {
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=originalRowCount + this.resultObjects.length;
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(outputStream,rowCount);
    if (outputStream instanceof RAOutputStream)     ((RAOutputStream)outputStream).seek(((RAOutputStream)outputStream).length());
    if (rowLensStream instanceof RAOutputStream)     ((RAOutputStream)rowLensStream).seek(((RAOutputStream)rowLensStream).length());
    DataOutputStream dos=new DataOutputStream(outputStream);
    DataOutputStream rlos=new DataOutputStream(rowLensStream);
    long offset=4;
    if (outputStream instanceof RAOutputStream)     offset=((RAOutputStream)outputStream).length();
    for (int i=0; i < rowCount - originalRowCount; i++) {
      IOUtil.writeLong(rlos,offset);
      offset+=ResultSetUtil.writeResultObject(dos,resultObjects[i],colCount,resultSetNameSet,stringTable,map,originalRowCount + i,version);
    }
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 65761
Project: 65761
Buggy source:
private Object convert(Object o,int type) throws DataException {
  try {
    return DataTypeUtil.convert(o,type);
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}

Fixed version (ground truth):
private static Object convert(Object o,int type) throws DataException {
  try {
    return DataTypeUtil.convert(o,type);
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}
Program: 65763
Project: 65763
Buggy source:
/** 
 * Serialize to an output stream
 * @param outputStream
 */
public void doSave(DataOutputStream outputStream,DataOutputStream lensStream,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> index,List<IBinding> cacheRequestMapping) throws DataException ;

Fixed version (ground truth):
/** 
 * Serialize to an output stream
 * @param outputStream
 */
public void doSave(DataOutputStream outputStream,DataOutputStream lensStream,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> index,List<IBinding> cacheRequestMapping,int version) throws DataException ;