nus-yam/ex-repair huggingface dataset:
Program: 77630
Project: 77630
Buggy source:
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param columnIndex the column index
 * @param insertFlag The column insert sign. 1 insert after position. -1 insert before position
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean canInsert(int columnIndex,int insertFlag){
  int columnCount=adapter.getColumnCount();
  targetColumnIndex=columnIndex;
  if (insertFlag == INSERT_BEFORE)   targetColumnIndex=targetColumnIndex - 1;
  if (targetColumnIndex > columnCount)   targetColumnIndex=columnCount;
  if (targetColumnIndex >= columnCount || targetColumnIndex < 1) {
    originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(1));
  }
 else {
    originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(targetColumnIndex));
    if (!isValidInsertAndPasteArea(originalCells))     return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param columnIndex the column index
 * @param insertFlag The column insert sign. 1 insert after position. -1 insert before position
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean canInsert(int columnIndex,int insertFlag){
  int columnCount=adapter.getColumnCount();
  targetColumnIndex=columnIndex;
  if (insertFlag == INSERT_BEFORE)   targetColumnIndex=targetColumnIndex - 1;
  if (targetColumnIndex > columnCount)   targetColumnIndex=columnCount;
  if (targetColumnIndex >= columnCount || targetColumnIndex < 1) {
    originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(1));
  }
 else {
    originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(targetColumnIndex,false));
    if (!isValidInsertAndPasteArea(originalCells))     return false;
  }
  return true;
}
Program: 77631
Project: 77631
Buggy source:
/** 
 * Checks whether copied cells can be inserted and pasted.
 * @param cells cloned cells
 * @return <code>true</code> if the row count matches the count of"rowSpans" in <code>cells</code>, otherwise <code>false</code>.
 */
private boolean isValidInsertAndPasteArea(List cells){
}

Fixed version (ground truth):
/** 
 * Checks whether copied cells can be inserted and pasted.
 * @param cells cloned cells
 * @return <code>true</code> if the row count matches the count of"rowSpans" in <code>cells</code>, otherwise <code>false</code>.
 */
private boolean isValidInsertAndPasteArea(List cells){
  int numOfRows=adapter.getRowCount();
  int rowCount=0;
  for (int i=0; i < cells.size(); i++) {
    CellContextInfo contextInfo=(CellContextInfo)cells.get(i);
    rowCount+=contextInfo.getRowSpan();
  }
  if (rowCount < numOfRows)   return false;
  return true;
}
Program: 77632
Project: 77632
Buggy source:
protected List getCellsUnderColumn(int columnNumber){
  return getCellsInSlot(element.getRows(),columnNumber);
}

Fixed version (ground truth):
protected List getCellsUnderColumn(int columnNumber,boolean mustBeStartPosition){
  return getCellsInSlot(element.getRows(),columnNumber,mustBeStartPosition);
}
Program: 77633
Project: 77633
Buggy source:
/** 
 * Returns copied cells with the column number.
 * @param columnIndex the column number
 * @return new cell instances
 */
protected List getCellsUnderColumn(int columnIndex){
  List cells=new ArrayList();
  cells.addAll(getCellsInSlot(element.getHeader(),columnIndex));
  SlotHandle groups=element.getGroups();
  for (int i=0; i < groups.getCount(); i++) {
    GroupHandle group=(GroupHandle)groups.get(i);
    cells.addAll(getCellsInSlot(group.getHeader(),columnIndex));
    cells.addAll(getCellsInSlot(group.getFooter(),columnIndex));
  }
  cells.addAll(getCellsInSlot(element.getDetail(),columnIndex));
  cells.addAll(getCellsInSlot(element.getFooter(),columnIndex));
  return cells;
}

Fixed version (ground truth):
protected List getCellsUnderColumn(int columnIndex,boolean mustBeStartPosition){
  List cells=new ArrayList();
  cells.addAll(getCellsInSlot(element.getHeader(),columnIndex,mustBeStartPosition));
  SlotHandle groups=element.getGroups();
  for (int i=0; i < groups.getCount(); i++) {
    GroupHandle group=(GroupHandle)groups.get(i);
    cells.addAll(getCellsInSlot(group.getHeader(),columnIndex,mustBeStartPosition));
    cells.addAll(getCellsInSlot(group.getFooter(),columnIndex,mustBeStartPosition));
  }
  cells.addAll(getCellsInSlot(element.getDetail(),columnIndex,mustBeStartPosition));
  cells.addAll(getCellsInSlot(element.getFooter(),columnIndex,mustBeStartPosition));
  return cells;
}
Program: 77634
Project: 77634
Buggy source:
/** 
 * Returns 1-based the column position with the given row index and the cell element.
 * @param rowId the row index
 * @param cell the cell to search
 * @return 1-based the column position
 */
protected int getColumnPos(int rowId,Cell cell){
  if (rowId < 0 || rowId >= rows.size())   return 0;
  LayoutRow row=(LayoutRow)getLayoutRow(rowId);
  return row.findCellColumnPos(cell);
}

Fixed version (ground truth):
/** 
 * Returns 1-based the column position with the given row index and the cell element.
 * @param rowId the row index
 * @param cell the cell to search
 * @return 1-based the column position
 */
protected int getColumnPos(int rowId,Cell cell){
  if (rowId < 0 || rowId >= rows.size())   return 0;
  LayoutRow row=getLayoutRow(rowId);
  return row.findCellColumnPos(cell);
}
Program: 77635
Project: 77635
Buggy source:
public synchronized static void shutdown(){
  if (launcher != null) {
    launcher.shutdown();
    launcher=null;
  }
}

Fixed version (ground truth):
public synchronized static void shutdown(){
  if (launcher != null) {
    launcher.shutdown();
    launcher=null;
  }
  platform=null;
}
Program: 77637
Project: 77637
Buggy source:
/** 
 * @param dataSourceDesign
 * @param dataSetDesign
 * @param parameterBindings
 * @param cacheOption
 * @param alwaysCacheRowCount
 * @return
 */
public boolean doesLoadFromCache(IBaseDataSourceDesign dataSourceDesign,IBaseDataSetDesign dataSetDesign,Collection parameterHints,int cacheOption,int alwaysCacheRowCount){
  if (needsToCache(dataSetDesign,cacheOption,alwaysCacheRowCount) == false)   return false;
  this.setDataSourceAndDataSet(dataSourceDesign,dataSetDesign,parameterHints);
  return cacheMapManager.doesLoadFromCache(DataSourceAndDataSet.newInstance(this.dataSourceDesign,dataSetDesign,parameterHints));
}

Fixed version (ground truth):
/** 
 * only for test
 * @return
 */
public boolean doesLoadFromCache(){
  if (needsToCache(dataSetDesign,cacheOption,alwaysCacheRowCount) == false)   return false;
  return cacheMapManager.doesLoadFromCache(DataSourceAndDataSet.newInstance(this.dataSourceDesign,this.dataSetDesign,this.parameterHints));
}
Program: 77638
Project: 77638
Buggy source:
protected IQuery createOdiQuery() throws DataException {
  return DataSourceFactory.getFactory().getDataSource(null,null,null,null).newCandidateQuery();
}

Fixed version (ground truth):
protected IQuery createOdiQuery() throws DataException {
  return DataSourceFactory.getFactory().getEmptyDataSource().newCandidateQuery();
}
Program: 77639
Project: 77639
Buggy source:
/** 
 * Temp interface
 * @param driverName
 * @param connProperties
 * @param dataSourceDesign
 * @param dataSetDesign
 * @param parameterBindings
 * @param cacheOption
 * @param alwaysCacheRowCount
 * @return
 */
public IDataSource getDataSource(String driverName,Map connProperties,IBaseDataSourceDesign dataSourceDesign,IBaseDataSetDesign dataSetDesign,Collection parameterBindings,int cacheOption,int alwaysCacheRowCount);

Fixed version (ground truth):
/** 
 * Obtains a dedicated data source instance with the specified driver name and connection properties. A named property can be mapped to more than one values. <br> The property name is of String type. <br> The property value is a Set interface of string values. <p> An implementation might support a pool of connected but inactive data sources.  <br> If no existing data source instance with the specified properties is available, a new instance will be instantiated.
 * @param driverName	 The name of a data source driver.
 * @param connProperties The connection properties as a Map of name-set pairs.
 * @return			An instance of IDataSource.
 */
public IDataSource getDataSource(String driverName,Map connProperties,IBaseDataSourceDesign dataSourceDesign,IBaseDataSetDesign dataSetDesign,Collection parameterBindings,int cacheOption,int alwaysCacheRowCount);
Program: 77641
Project: 77641
Buggy source:
/** 
 * Create HTML render context.
 * @param svgFlag
 * @param servletPath
 * @return HTML render context from the given arguments
 */
private HTMLRenderContext createHTMLrenderContext(boolean svgFlag,String servletPath){
  HTMLRenderContext renderContext=new HTMLRenderContext();
  renderContext.setImageDirectory(imageDirectory);
  renderContext.setBaseImageURL(contextPath + imageBaseUrl);
  if (servletPath != null && servletPath.length() > 0 && !servletPath.equalsIgnoreCase(IBirtConstants.SERVLET_PATH_PREVIEW)) {
    renderContext.setBaseURL(this.contextPath + servletPath);
  }
 else {
    renderContext.setBaseURL(this.contextPath + IBirtConstants.SERVLET_PATH_FRAMESET);
  }
  renderContext.setImageDirectory(imageDirectory);
  renderContext.setSupportedImageFormats(svgFlag ? "String_Node_Str" : "String_Node_Str");
  return renderContext;
}

Fixed version (ground truth):
/** 
 * Create HTML render context.
 * @param svgFlag
 * @param servletPath
 * @return HTML render context from the given arguments
 */
private HTMLRenderContext createHTMLrenderContext(boolean svgFlag,String servletPath){
  HTMLRenderContext renderContext=new HTMLRenderContext();
  renderContext.setImageDirectory(imageDirectory);
  renderContext.setBaseImageURL(contextPath + imageBaseUrl);
  if (servletPath != null && servletPath.length() > 0) {
    renderContext.setBaseURL(this.contextPath + servletPath);
  }
 else {
    renderContext.setBaseURL(this.contextPath + IBirtConstants.SERVLET_PATH_RUN);
  }
  renderContext.setImageDirectory(imageDirectory);
  renderContext.setSupportedImageFormats(svgFlag ? "String_Node_Str" : "String_Node_Str");
  return renderContext;
}
Program: 77642
Project: 77642
Buggy source:
/** 
 * Create PDF render context.
 * @return the PDF render context
 */
private PDFRenderContext createPDFrenderContext(){
  PDFRenderContext renderContext=new PDFRenderContext();
  renderContext.setBaseURL(this.contextPath + IBirtConstants.SERVLET_PATH_RUN);
  renderContext.setSupportedImageFormats("String_Node_Str");
  return renderContext;
}

Fixed version (ground truth):
/** 
 * Create PDF render context.
 * @param servletPath
 * @return the PDF render context
 */
private PDFRenderContext createPDFrenderContext(String servletPath){
  PDFRenderContext renderContext=new PDFRenderContext();
  if (servletPath != null && servletPath.length() > 0) {
    renderContext.setBaseURL(this.contextPath + servletPath);
  }
 else {
    renderContext.setBaseURL(this.contextPath + IBirtConstants.SERVLET_PATH_RUN);
  }
  renderContext.setSupportedImageFormats("String_Node_Str");
  return renderContext;
}
Program: 77644
Project: 77644
Buggy source:
/** 
 * Check if a data set is added into this joint data set.
 * @param module the module.
 * @param dataSetName the name of the data set.
 * @param errors the errors.
 */
private void checkDataSet(Module module,String dataSetName,List errors,DesignElement element){
  if (dataSetName == null) {
    return;
  }
  List dataSetsReferences=(List)element.getProperty(module,JointDataSet.DATA_SETS_PROP);
  if (dataSetsReferences != null) {
    int dataSetIndex;
    for (dataSetIndex=0; dataSetIndex < dataSetsReferences.size(); dataSetIndex++) {
      if (((ElementRefValue)dataSetsReferences.get(dataSetIndex)).getName().equals(dataSetName)) {
        return;
      }
    }
  }
  errors.add(new SemanticError(element,new String[]{element.getName(),dataSetName},SemanticError.DESIGN_EXCEPTION_DATA_SET_MISSED_IN_JOINT_DATA_SET));
}

Fixed version (ground truth):
/** 
 * Check if a data set is added into this joint data set.
 * @param module the module.
 * @param dataSetName the name of the data set.
 * @param errors the errors.
 */
private void checkDataSet(Module module,String dataSetName,List errors,DesignElement element){
  if (dataSetName == null) {
    return;
  }
  List dataSetsReferences=(List)element.getProperty(module,JointDataSet.DATA_SETS_PROP);
  if (dataSetsReferences != null) {
    int dataSetIndex;
    for (dataSetIndex=0; dataSetIndex < dataSetsReferences.size(); dataSetIndex++) {
      if (((ElementRefValue)dataSetsReferences.get(dataSetIndex)).getQualifiedReference().equals(dataSetName)) {
        return;
      }
    }
  }
  errors.add(new SemanticError(element,new String[]{element.getName(),dataSetName},SemanticError.DESIGN_EXCEPTION_DATA_SET_MISSED_IN_JOINT_DATA_SET));
}
Program: 77645
Project: 77645
Buggy source:
/** 
 * Gets the names of the data sets in this joint data set.
 * @param module the root module of the element
 * @return a list of names of data sets in this joint data set.
 */
public List getDataSetNames(Module module){
  List dataSetsReferences=getListProperty(module,JointDataSet.DATA_SETS_PROP);
  if (dataSetsReferences == null) {
    return Collections.EMPTY_LIST;
  }
  List results=new ArrayList();
  for (int i=0; i < dataSetsReferences.size(); i++) {
    results.add(((ElementRefValue)dataSetsReferences.get(i)).getName());
  }
  return results;
}

Fixed version (ground truth):
/** 
 * Gets the names of the data sets in this joint data set.
 * @param module the root module of the element
 * @return a list of names of data sets in this joint data set.
 */
public List getDataSetNames(Module module){
  List dataSetsReferences=getListProperty(module,JointDataSet.DATA_SETS_PROP);
  if (dataSetsReferences == null) {
    return Collections.EMPTY_LIST;
  }
  List results=new ArrayList();
  for (int i=0; i < dataSetsReferences.size(); i++) {
    results.add(((ElementRefValue)dataSetsReferences.get(i)).getQualifiedReference());
  }
  return results;
}
Program: 77646
Project: 77646
Buggy source:
private MasterPageDesign getDefaultMasterPage(IReportContent report){
  PageSetupDesign pageSetup=report.getDesign().getPageSetup();
  int pageCount=pageSetup.getMasterPageCount();
  if (pageCount > 0) {
    return pageSetup.getMasterPage(0);
  }
  return null;
}

Fixed version (ground truth):
private MasterPageDesign getDefaultMasterPage(IReportContent report){
  PageSetupDesign pageSetup=report.getDesign().getPageSetup();
  int pageCount=pageSetup.getMasterPageCount();
  if (pageCount > 0) {
    MasterPageDesign pageDesign=pageSetup.getMasterPage(0);
    context.setMasterPage(pageDesign.getName());
    return pageDesign;
  }
  return null;
}
Program: 77647
Project: 77647
Buggy source:
private MasterPageDesign getDefaultMasterPage(IReportContent report){
  PageSetupDesign pageSetup=report.getDesign().getPageSetup();
  int pageCount=pageSetup.getMasterPageCount();
  if (pageCount > 0) {
    return pageSetup.getMasterPage(0);
  }
  return null;
}

Fixed version (ground truth):
private MasterPageDesign getDefaultMasterPage(IReportContent report){
  PageSetupDesign pageSetup=report.getDesign().getPageSetup();
  int pageCount=pageSetup.getMasterPageCount();
  if (pageCount > 0) {
    MasterPageDesign pageDesign=pageSetup.getMasterPage(0);
    context.setMasterPage(pageDesign.getName());
    return pageDesign;
  }
  return null;
}
Program: 77648
Project: 77648
Buggy source:
/** 
 * Get engine instance.
 * @param servletConfig
 * @throws BirtException
 */
public static void initEngineInstance(ServletConfig servletConfig) throws BirtException {
  if (ReportEngineService.instance != null) {
    return;
  }
  ReportEngineService.instance=new ReportEngineService(servletConfig);
}

Fixed version (ground truth):
/** 
 * Get engine instance.
 * @param servletConfig
 * @throws BirtException
 */
public synchronized static void initEngineInstance(ServletConfig servletConfig) throws BirtException {
  if (ReportEngineService.instance != null) {
    return;
  }
  ReportEngineService.instance=new ReportEngineService(servletConfig);
}
Program: 77650
Project: 77650
Buggy source:
/** 
 * @param dataSetName
 * @return
 * @throws BirtException
 */
private IResultMetaData getRealMetaData(DataSetHandle dataSetHandle) throws BirtException {
  QueryDefinition query=new QueryDefinition();
  query.setDataSetName(dataSetHandle.getQualifiedName());
  query.setMaxRows(1);
  IResultMetaData metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,moduleHandle,false).executeQuery(query).getResultMetaData();
  if (needsUseResultHint(dataSetHandle,metaData)) {
    metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,moduleHandle,true).executeQuery(query).getResultMetaData();
  }
  if (!(dataSetHandle instanceof ScriptDataSetHandle))   clearUnusedData(dataSetHandle,metaData);
  return metaData;
}

Fixed version (ground truth):
/** 
 * @param dataSetName
 * @return
 * @throws BirtException
 */
private IResultMetaData getRealMetaData(DataSetHandle dataSetHandle) throws BirtException {
  QueryDefinition query=new QueryDefinition();
  query.setDataSetName(dataSetHandle.getQualifiedName());
  query.setMaxRows(1);
  IResultMetaData metaData=MetaDataPopulator.retrieveResultMetaData(dataSetHandle);
  if (metaData == null) {
    metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,moduleHandle,false).executeQuery(query).getResultMetaData();
    if (needsUseResultHint(dataSetHandle,metaData)) {
      metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,moduleHandle,true).executeQuery(query).getResultMetaData();
    }
  }
  if (!(dataSetHandle instanceof ScriptDataSetHandle))   clearUnusedData(dataSetHandle,metaData);
  return metaData;
}
Program: 77651
Project: 77651
Buggy source:
/** 
 * @param streamPos
 * @param streamScope
 * @return query definition
 * @throws DataException
 */
public IBaseQueryDefinition loadQueryDefn(int streamPos,int streamScope) throws DataException {
  InputStream inputStream=streamManager.getInStream(DataEngineContext.QUERY_DEFN_STREAM,streamPos,streamScope);
  IBaseQueryDefinition queryDefn=QueryDefnUtil.loadQueryDefn(inputStream);
  try {
    inputStream.close();
  }
 catch (  IOException e) {
  }
  return queryDefn;
}

Fixed version (ground truth):
/** 
 * @param inputStream
 * @return
 * @throws DataException
 */
private IBaseQueryDefinition loadQueryDefn(InputStream inputStream) throws DataException {
  IBaseQueryDefinition queryDefn=QueryDefnUtil.loadQueryDefn(inputStream);
  try {
    inputStream.close();
  }
 catch (  IOException e) {
  }
  return queryDefn;
}
Program: 77652
Project: 77652
Buggy source:
/** 
 * @throws DataException
 */
void saveQueryDefn() throws DataException {
  OutputStream outputStream=streamManager.getOutStream(DataEngineContext.QUERY_DEFN_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
  QueryDefnUtil.saveBaseQueryDefn(outputStream,queryDefn);
  try {
    outputStream.close();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
void saveQueryDefn() throws DataException {
  OutputStream outputStream;
  if (((QueryDefinition)queryDefn).getQueryResultsID() == null) {
    outputStream=streamManager.getOutStream(DataEngineContext.ORIGINAL_QUERY_DEFN_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
    QueryDefnUtil.saveBaseQueryDefn(outputStream,queryDefn);
  }
  outputStream=streamManager.getOutStream(DataEngineContext.QUERY_DEFN_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
  QueryDefnUtil.saveBaseQueryDefn(outputStream,queryDefn);
  try {
    outputStream.close();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 77653
Project: 77653
Buggy source:
/** 
 * @param context
 * @param queryResultID
 * @param subQueryName
 * @param subQueryIndex
 * @throws DataException
 */
RDSave(DataEngineContext context,IBaseQueryDefinition queryDefn,int rowCount,QueryResultInfo queryResultInfo) throws DataException {
  this.context=context;
  this.rowCount=rowCount;
  this.streamManager=new StreamManager(context,queryResultInfo);
  this.rdSaveUtil=new RDSaveUtil(this.context.getMode(),queryDefn,this.streamManager);
}

Fixed version (ground truth):
/** 
 * @param context
 * @param queryResultID
 * @param subQueryName
 * @param subQueryIndex
 * @throws DataException
 */
RDSave(DataEngineContext context,IBaseQueryDefinition queryDefn,int rowCount,QueryResultInfo queryResultInfo) throws DataException {
  this.context=context;
  this.rowCount=rowCount;
  this.queryDefn=queryDefn;
  this.streamManager=new StreamManager(context,queryResultInfo);
  this.rdSaveUtil=new RDSaveUtil(this.context.getMode(),queryDefn,this.streamManager);
}
Program: 77654
Project: 77654
Buggy source:
/** 
 * @throws DataException
 */
private void saveForIV() throws DataException {
  this.rdSaveUtil.saveExprMetadata(exprNameSet);
  if (this.streamManager.isSubquery() == false)   this.rdSaveUtil.saveQueryDefn();
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
private void saveForIV() throws DataException {
  if (exprNameSet.size() == 0) {
    exprNameSet=getExprNameSet();
  }
  this.rdSaveUtil.saveExprMetadata(exprNameSet);
  if (this.streamManager.isSubquery() == false)   this.rdSaveUtil.saveQueryDefn();
}
Program: 77656
Project: 77656
Buggy source:
/** 
 * @throws DataException
 */
void saveQueryDefn() throws DataException {
  OutputStream outputStream;
  if (((QueryDefinition)queryDefn).getQueryResultsID() == null) {
    outputStream=streamManager.getOutStream(DataEngineContext.ORIGINAL_QUERY_DEFN_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
    QueryDefnUtil.saveBaseQueryDefn(outputStream,queryDefn);
  }
  outputStream=streamManager.getOutStream(DataEngineContext.QUERY_DEFN_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
  QueryDefnUtil.saveBaseQueryDefn(outputStream,queryDefn);
  try {
    outputStream.close();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
void saveQueryDefn() throws DataException {
  OutputStream outputStream;
  if (queryDefn instanceof QueryDefinition && ((QueryDefinition)queryDefn).getQueryResultsID() == null) {
    outputStream=streamManager.getOutStream(DataEngineContext.ORIGINAL_QUERY_DEFN_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
    QueryDefnUtil.saveBaseQueryDefn(outputStream,queryDefn);
  }
  outputStream=streamManager.getOutStream(DataEngineContext.QUERY_DEFN_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
  QueryDefnUtil.saveBaseQueryDefn(outputStream,queryDefn);
  try {
    outputStream.close();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 77657
Project: 77657
Buggy source:
public IResultMetaData refreshMetaData(DataSetHandle dataSetHandle) throws BirtException {
  return new DataSetMetaDataHelper(this.dataEngine,this.modelAdaptor,this.sessionContext.getModuleHandle()).refreshMetaData(dataSetHandle);
}

Fixed version (ground truth):
public IResultMetaData refreshMetaData(DataSetHandle dataSetHandle) throws BirtException {
  return new DataSetMetaDataHelper(this.dataEngine,this.modelAdaptor,this.sessionContext).refreshMetaData(dataSetHandle);
}
Program: 77658
Project: 77658
Buggy source:
public IResultMetaData getDataSetMetaData(DataSetHandle dataSetHandle,boolean useCache) throws BirtException {
  return new DataSetMetaDataHelper(this.dataEngine,this.modelAdaptor,this.sessionContext.getModuleHandle()).getDataSetMetaData(dataSetHandle,useCache);
}

Fixed version (ground truth):
public IResultMetaData getDataSetMetaData(DataSetHandle dataSetHandle,boolean useCache) throws BirtException {
  return new DataSetMetaDataHelper(this.dataEngine,this.modelAdaptor,this.sessionContext).getDataSetMetaData(dataSetHandle,useCache);
}
Program: 77659
Project: 77659
Buggy source:
/** 
 * @param dataEngine
 * @param modelAdaptor
 * @param moduleHandle
 */
DataSetMetaDataHelper(DataEngine dataEngine,IModelAdapter modelAdaptor,ModuleHandle moduleHandle){
  this.dataEngine=dataEngine;
  this.modelAdaptor=modelAdaptor;
  this.moduleHandle=moduleHandle;
}

Fixed version (ground truth):
/** 
 * @param dataEngine
 * @param modelAdaptor
 * @param moduleHandle
 */
DataSetMetaDataHelper(DataEngine dataEngine,IModelAdapter modelAdaptor,DataSessionContext sessionContext){
  this.dataEngine=dataEngine;
  this.modelAdaptor=modelAdaptor;
  this.sessionContext=sessionContext;
}
Program: 77660
Project: 77660
Buggy source:
/** 
 * @param dataSetName
 * @return
 * @throws BirtException
 */
private IResultMetaData getRealMetaData(DataSetHandle dataSetHandle) throws BirtException {
  QueryDefinition query=new QueryDefinition();
  query.setDataSetName(dataSetHandle.getQualifiedName());
  query.setMaxRows(1);
  IResultMetaData metaData=MetaDataPopulator.retrieveResultMetaData(dataSetHandle);
  if (metaData == null) {
    metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,moduleHandle,false).executeQuery(query).getResultMetaData();
    if (needsUseResultHint(dataSetHandle,metaData)) {
      metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,moduleHandle,true).executeQuery(query).getResultMetaData();
    }
  }
  if (!(dataSetHandle instanceof ScriptDataSetHandle))   clearUnusedData(dataSetHandle,metaData);
  return metaData;
}

Fixed version (ground truth):
/** 
 * @param dataSetName
 * @return
 * @throws BirtException
 */
private IResultMetaData getRealMetaData(DataSetHandle dataSetHandle) throws BirtException {
  QueryDefinition query=new QueryDefinition();
  query.setDataSetName(dataSetHandle.getQualifiedName());
  query.setMaxRows(1);
  IResultMetaData metaData=MetaDataPopulator.retrieveResultMetaData(dataSetHandle);
  if (metaData == null) {
    metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,sessionContext,false).executeQuery(query).getResultMetaData();
    if (needsUseResultHint(dataSetHandle,metaData)) {
      metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,sessionContext,true).executeQuery(query).getResultMetaData();
    }
  }
  if (!(dataSetHandle instanceof ScriptDataSetHandle))   clearUnusedData(dataSetHandle,metaData);
  return metaData;
}
Program: 77661
Project: 77661
Buggy source:
/** 
 * Handles a Rhino script evaluation result, converting Javascript native objects into equivalent Java objects if necessary.
 * @param inputObj Object returned by rhino engine.
 * @return If inputObj is a native Javascript object, its equivalent Java object is returned; otherwise inputObj is returned
 */
public static Object convertJavascriptValue(Object inputObj){
  if (inputObj instanceof Undefined) {
    return null;
  }
  if (inputObj instanceof IdScriptableObject) {
    String jsClass=((Scriptable)inputObj).getClassName();
    if ("String_Node_Str".equals(jsClass)) {
      return new Date((long)Context.toNumber(inputObj));
    }
 else     if ("String_Node_Str".equals(jsClass)) {
      return new Boolean(Context.toBoolean(inputObj));
    }
 else     if ("String_Node_Str".equals(jsClass)) {
      return new Double(Context.toNumber(inputObj));
    }
 else     if ("String_Node_Str".equals(jsClass)) {
      return inputObj.toString();
    }
  }
 else   if (inputObj instanceof NativeJavaObject) {
    return ((NativeJavaObject)inputObj).unwrap();
  }
  return inputObj;
}

Fixed version (ground truth):
/** 
 * Handles a Rhino script evaluation result, converting Javascript object into equivalent Java objects if necessary.
 * @param inputObj Object returned by rhino engine.
 * @return If inputObj is a native Javascript object, its equivalent Java object is returned; otherwise inputObj is returned
 */
public static Object convertJavascriptValue(Object inputObj){
  if (inputObj instanceof Undefined) {
    return null;
  }
  if (inputObj instanceof IdScriptableObject) {
    String jsClass=((Scriptable)inputObj).getClassName();
    if ("String_Node_Str".equals(jsClass)) {
      return new Date((long)Context.toNumber(inputObj));
    }
 else     if ("String_Node_Str".equals(jsClass)) {
      return new Boolean(Context.toBoolean(inputObj));
    }
 else     if ("String_Node_Str".equals(jsClass)) {
      return new Double(Context.toNumber(inputObj));
    }
 else     if ("String_Node_Str".equals(jsClass)) {
      return inputObj.toString();
    }
  }
 else   if (inputObj instanceof Wrapper) {
    return ((Wrapper)inputObj).unwrap();
  }
  return inputObj;
}
Program: 77662
Project: 77662
Buggy source:
/** 
 * Returns externalized message. If There is no externalized message, return null.
 * @param element Design element.
 * @param propName Name of property
 * @param locale the locale
 * @return externalized message.
 */
private static String searchForExternalizedValue(DesignElement element,String propIDName,ULocale locale){
  while (element != null) {
    Module root=element.getRoot();
    String textKey=(String)element.getLocalProperty(root,propIDName);
    if (!StringUtil.isBlank(textKey)) {
      String externalizedText=root.getMessage(textKey,locale);
      return externalizedText;
    }
    element=element.getExtendsElement();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns externalized message. If There is no externalized message, return null.
 * @param element Design element.
 * @param propName Name of property
 * @param locale the locale
 * @return externalized message.
 */
private static String searchForExternalizedValue(DesignElement element,String propIDName,ULocale locale){
  while (element != null) {
    Module root=element.getRoot();
    String textKey=(String)element.getLocalProperty(root,propIDName);
    if (!StringUtil.isBlank(textKey)) {
      String externalizedText=root.getMessage(textKey,locale);
      return externalizedText;
    }
    if (DesignElement.NO_BASE_ID != element.getBaseId()) {
      element=element.getVirtualParent();
    }
 else {
      element=element.getExtendsElement();
    }
  }
  return null;
}
Program: 77663
Project: 77663
Buggy source:
/** 
 * @param dataSourceDesign
 * @param dataSetDesign
 * @return
 */
public static DataSourceAndDataSet newInstance(IBaseDataSourceDesign dataSourceDesign,IBaseDataSetDesign dataSetDesign,Collection parameterBindings){
  DataSourceAndDataSet dataSourceAndSet=new DataSourceAndDataSet();
  dataSourceAndSet.dataSourceDesign=dataSourceDesign;
  dataSourceAndSet.dataSetDesign=dataSetDesign;
  dataSourceAndSet.parameterBindings=parameterBindings;
  return dataSourceAndSet;
}

Fixed version (ground truth):
/** 
 * @param dataSourceDesign
 * @param dataSetDesign
 * @return
 */
public static DataSourceAndDataSet newInstance(IBaseDataSourceDesign dataSourceDesign,IBaseDataSetDesign dataSetDesign,Collection paramterHints){
  DataSourceAndDataSet dataSourceAndSet=new DataSourceAndDataSet();
  dataSourceAndSet.dataSourceDesign=dataSourceDesign;
  dataSourceAndSet.dataSetDesign=dataSetDesign;
  dataSourceAndSet.paramterHints=paramterHints;
  return dataSourceAndSet;
}
Program: 77664
Project: 77664
Buggy source:
public boolean equals(Object obj){
  if (obj == null || obj instanceof DataSourceAndDataSet == false)   return false;
  if (this == obj)   return true;
  IBaseDataSourceDesign dataSourceDesign2=((DataSourceAndDataSet)obj).dataSourceDesign;
  IBaseDataSetDesign dataSetDesign2=((DataSourceAndDataSet)obj).dataSetDesign;
  Collection parameterBindings2=((DataSourceAndDataSet)obj).parameterBindings;
  if (this.dataSourceDesign == dataSourceDesign2) {
    if (this.dataSetDesign == dataSetDesign2) {
      if (isEqualParameterBindings(this.parameterBindings,parameterBindings2))       return true;
    }
 else     if (this.dataSetDesign == null || dataSetDesign2 == null) {
      return false;
    }
  }
 else   if (this.dataSourceDesign == null || dataSourceDesign2 == null) {
    return false;
  }
 else {
    if ((this.dataSetDesign != dataSetDesign2) && (this.dataSetDesign == null || dataSetDesign2 == null))     return false;
  }
  if (isEqualDataSourceDesign(dataSourceDesign,dataSourceDesign2) == false)   return false;
  if (isEqualDataSetDesign(dataSetDesign,dataSetDesign2) == false)   return false;
  if (this.isEqualParameterBindings(this.parameterBindings,parameterBindings2) == false)   return false;
  return true;
}

Fixed version (ground truth):
public boolean equals(Object obj){
  if (obj == null || obj instanceof DataSourceAndDataSet == false)   return false;
  if (this == obj)   return true;
  IBaseDataSourceDesign dataSourceDesign2=((DataSourceAndDataSet)obj).dataSourceDesign;
  IBaseDataSetDesign dataSetDesign2=((DataSourceAndDataSet)obj).dataSetDesign;
  Collection paramterHints2=((DataSourceAndDataSet)obj).paramterHints;
  if (this.dataSourceDesign == dataSourceDesign2) {
    if (this.dataSetDesign == dataSetDesign2) {
      if (isEqualParamterHints(this.paramterHints,paramterHints2))       return true;
    }
 else     if (this.dataSetDesign == null || dataSetDesign2 == null) {
      return false;
    }
  }
 else   if (this.dataSourceDesign == null || dataSourceDesign2 == null) {
    return false;
  }
 else {
    if ((this.dataSetDesign != dataSetDesign2) && (this.dataSetDesign == null || dataSetDesign2 == null))     return false;
  }
  if (isEqualDataSourceDesign(dataSourceDesign,dataSourceDesign2) == false)   return false;
  if (isEqualDataSetDesign(dataSetDesign,dataSetDesign2) == false)   return false;
  if (this.isEqualParamterHints(this.paramterHints,paramterHints2) == false)   return false;
  return true;
}
Program: 77666
Project: 77666
Buggy source:
public IPreparedQuery prepare(IQueryDefinition querySpec,Map appContext) throws DataException {
  if (logger.isLoggable(Level.FINER))   logger.entering(DataEngineImpl.class.getName(),"String_Node_Str",LogUtil.toString(querySpec));
  if (dataSources == null) {
    IllegalStateException e=new IllegalStateException("String_Node_Str");
    logger.logp(Level.WARNING,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
  if (logger.isLoggable(Level.FINE))   logger.fine("String_Node_Str" + LogUtil.toString(querySpec));
  IPreparedQuery result=PreparedQueryUtil.newInstance(this,querySpec,appContext);
  configureDataSetCache(querySpec,appContext);
  logger.fine("String_Node_Str");
  logger.exiting(DataEngineImpl.class.getName(),"String_Node_Str");
  return result;
}

Fixed version (ground truth):
public IPreparedQuery prepare(IQueryDefinition querySpec,Map appContext) throws DataException {
  if (logger.isLoggable(Level.FINER))   logger.entering(DataEngineImpl.class.getName(),"String_Node_Str",LogUtil.toString(querySpec));
  if (dataSources == null) {
    IllegalStateException e=new IllegalStateException("String_Node_Str");
    logger.logp(Level.WARNING,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
  if (logger.isLoggable(Level.FINE))   logger.fine("String_Node_Str" + LogUtil.toString(querySpec));
  IPreparedQuery result=PreparedQueryUtil.newInstance(this,querySpec,appContext);
  logger.fine("String_Node_Str");
  logger.exiting(DataEngineImpl.class.getName(),"String_Node_Str");
  return result;
}
Program: 77667
Project: 77667
Buggy source:
/** 
 * Executes the prepared execution plan as an inner query that appears within the scope of another report query. The outer query must have been prepared and executed, and its results given as a parameter to this method.
 * @param outerResults QueryResults for the executed outer query
 * @return The QueryResults object opened and ready to return the results ofa report query.
 */
public IQueryResults execute(IQueryResults outerResults,Scriptable scope) throws DataException {
  return preparedQuery.doPrepare(outerResults,scope,newExecutor(),this);
}

Fixed version (ground truth):
/** 
 * Executes the prepared execution plan as an inner query that appears within the scope of another report query. The outer query must have been prepared and executed, and its results given as a parameter to this method.
 * @param outerResults QueryResults for the executed outer query
 * @return The QueryResults object opened and ready to return the results ofa report query.
 */
public IQueryResults execute(IQueryResults outerResults,Scriptable scope) throws DataException {
  this.configureDataSetCache(queryDefn,appContext,scope,dataEngine.getSharedScope());
  return preparedQuery.doPrepare(outerResults,scope,newExecutor(),this);
}
Program: 77669
Project: 77669
Buggy source:
/** 
 * Packs the wizard to display enough size
 */
public void packWizard(){
  boolean changed=false;
  Point wizardSize=getShell().computeSize(SWT.DEFAULT,SWT.DEFAULT);
  int iWizardWidth=Math.max(wizardSize.x,iWizardWidthMinimum);
  int iWizardHeight=Math.max(wizardSize.y,iWizardHeightMinimum);
  Point oldSize=getShell().getSize();
  if (oldSize.x < iWizardWidth) {
    oldSize.x=iWizardWidth;
    changed=true;
  }
  if (oldSize.y < iWizardHeight) {
    oldSize.y=iWizardHeight;
    changed=true;
  }
  if (changed) {
    getShell().setSize(oldSize);
    getShell().layout();
  }
}

Fixed version (ground truth):
/** 
 * Packs the wizard to display enough size
 */
public void packWizard(){
  if (!packNeeded) {
    return;
  }
  boolean changed=false;
  Point wizardSize=getShell().computeSize(SWT.DEFAULT,SWT.DEFAULT);
  int iWizardWidth=Math.max(wizardSize.x,iWizardWidthMinimum);
  int iWizardHeight=Math.max(wizardSize.y,iWizardHeightMinimum);
  Point oldSize=getShell().getSize();
  if (oldSize.x < iWizardWidth) {
    oldSize.x=iWizardWidth;
    changed=true;
  }
  if (oldSize.y < iWizardHeight) {
    oldSize.y=iWizardHeight;
    changed=true;
  }
  if (changed) {
    getShell().setSize(oldSize);
    getShell().layout();
  }
}
Program: 77670
Project: 77670
Buggy source:
protected void initializeBounds(){
  getShell().setText(wizardTitle);
  setTitle(wizardTitle);
  if (imgShell != null) {
    getShell().setImage(imgShell);
  }
  getShell().addControlListener(this);
  getShell().addDisposeListener(this);
  String[] allTasks=TasksManager.instance().getTasksForWizard(WizardBase.this.sWizardID);
  for (int i=0; i < allTasks.length; i++) {
    CTabItem item=new CTabItem(getTabContainer(),SWT.NONE);
    item.setText(TasksManager.instance().getTask(allTasks[i]).getTitle());
    item.setData(allTasks[i]);
  }
  if (tmpTopTaskId != null) {
    int taskIndex=vTaskIDs.indexOf(tmpTopTaskId);
    cmpTaskContainer.setSelection(taskIndex);
  }
  if (getCurrentTask() != null) {
    getCurrentTask().setContext(WizardBase.this.context);
    switchTo(sCurrentActiveTask);
  }
  super.initializeBounds();
}

Fixed version (ground truth):
protected void initializeBounds(){
  getShell().setText(wizardTitle);
  setTitle(wizardTitle);
  if (imgShell != null) {
    getShell().setImage(imgShell);
  }
  getShell().addControlListener(this);
  getShell().addDisposeListener(this);
  String[] allTasks=TasksManager.instance().getTasksForWizard(WizardBase.this.sWizardID);
  for (int i=0; i < allTasks.length; i++) {
    CTabItem item=new CTabItem(getTabContainer(),SWT.NONE);
    item.setText(TasksManager.instance().getTask(allTasks[i]).getTitle());
    item.setData(allTasks[i]);
  }
  if (tmpTopTaskId != null) {
    int taskIndex=vTaskIDs.indexOf(tmpTopTaskId);
    cmpTaskContainer.setSelection(taskIndex);
  }
  if (getCurrentTask() != null) {
    getCurrentTask().setContext(WizardBase.this.context);
    packNeeded=false;
    switchTo(sCurrentActiveTask);
    packNeeded=true;
  }
  super.initializeBounds();
}
Program: 77671
Project: 77671
Buggy source:
/** 
 * @param dataSet
 * @param queryDefn
 * @param useColumnHints
 * @return
 * @throws BirtException
 */
public IQueryResults execute(DataSetHandle dataSet,QueryDefinition queryDefn,boolean useColumnHints,boolean useFilters) throws BirtException {
  DataSessionContext context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,dataSet.getModuleHandle());
  DataRequestSession session=DataRequestSession.newSession(context);
  IBaseDataSetDesign dataSetDesign=session.getModelAdaptor().adaptDataSet(dataSet);
  if (!useColumnHints) {
    dataSetDesign.getResultSetHints().clear();
  }
  if (!useFilters) {
    dataSetDesign.getFilters().clear();
  }
  IQueryResults resultSet=executeQuery(session,queryDefn);
  IResultMetaData metaData=resultSet.getResultMetaData();
  int columnCount=0;
  if (metaData != null)   columnCount=metaData.getColumnCount();
  if (dataSet.getPropertyHandle(DataSetHandle.RESULT_SET_HINTS_PROP) != null && dataSet.getPropertyHandle(DataSetHandle.RESULT_SET_HINTS_PROP).iterator().hasNext()) {
    for (int n=0; n < columnCount; n++) {
      String columnLabel=metaData.getColumnLabel(n + 1);
      String columnName=metaData.getColumnName(n + 1);
      if (!columnLabel.equals(columnName) && columnName.lastIndexOf(RENAME_SEPARATOR) >= 0 && !columnLabel.equals(columnName.substring(0,columnName.lastIndexOf(RENAME_SEPARATOR)))) {
        dataSet.getPropertyHandle(DataSetHandle.RESULT_SET_HINTS_PROP).clearValue();
        return execute(dataSet,queryDefn,useColumnHints,useFilters);
      }
    }
  }
  saveResultToDataItems(dataSet,resultSet);
  return resultSet;
}

Fixed version (ground truth):
/** 
 * @param dataSet
 * @param queryDefn
 * @param useColumnHints
 * @return
 * @throws BirtException
 */
public IQueryResults execute(DataSetHandle dataSet,QueryDefinition queryDefn,boolean useColumnHints,boolean useFilters) throws BirtException {
  this.populateAllOutputColumns(dataSet);
  DataSessionContext context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,dataSet.getModuleHandle());
  DataRequestSession session=DataRequestSession.newSession(context);
  IBaseDataSetDesign dataSetDesign=session.getModelAdaptor().adaptDataSet(dataSet);
  if (!useColumnHints) {
    dataSetDesign.getResultSetHints().clear();
  }
  if (!useFilters) {
    dataSetDesign.getFilters().clear();
  }
  IQueryResults resultSet=executeQuery(session,queryDefn);
  saveResultToDataItems(dataSet,resultSet);
  return resultSet;
}
Program: 77672
Project: 77672
Buggy source:
/** 
 * get parsed parameters as string.
 * @param parsedParameters Map
 * @param request HttpServletRequest
 * @param options InputOptions
 * @return Map
 */
protected Map getParsedParametersAsStringWithDefaultValue(Map parsedParameters,HttpServletRequest request,InputOptions options) throws ReportServiceException {
  if (parsedParameters == null) {
    parsedParameters=new HashMap();
    return parsedParameters;
  }
  for (Iterator iter=parsedParameters.keySet().iterator(); iter.hasNext(); ) {
    String paramName=iter.next().toString();
    Object paramValue=parsedParameters.get(paramName);
    if (paramValue == null && !ParameterAccessor.isReportParameterExist(request,paramName) && (IBirtConstants.SERVLET_PATH_FRAMESET.equalsIgnoreCase(request.getServletPath()) || (this.configMap != null && !this.configMap.containsKey(paramName)))) {
      paramValue=this.getParameterDefaultValues(reportDesignHandle,paramName,options);
      parsedParameters.put(paramName,paramValue);
    }
  }
  return parsedParameters;
}

Fixed version (ground truth):
/** 
 * get parsed parameters as string.
 * @param parsedParameters Map
 * @param request HttpServletRequest
 * @param options InputOptions
 * @return Map
 */
protected Map getParsedParametersAsStringWithDefaultValue(Map parsedParameters,HttpServletRequest request,InputOptions options) throws ReportServiceException {
  if (parsedParameters == null) {
    parsedParameters=new HashMap();
    return parsedParameters;
  }
  for (Iterator iter=parsedParameters.keySet().iterator(); iter.hasNext(); ) {
    String paramName=iter.next().toString();
    Object paramValue=parsedParameters.get(paramName);
    if (paramValue == null && !ParameterAccessor.isReportParameterExist(request,paramName) && (IBirtConstants.SERVLET_PATH_FRAMESET.equalsIgnoreCase(request.getServletPath()) || this.configMap == null || !this.configMap.containsKey(paramName))) {
      paramValue=this.getParameterDefaultValues(reportDesignHandle,paramName,options);
      parsedParameters.put(paramName,paramValue);
    }
  }
  return parsedParameters;
}
Program: 77673
Project: 77673
Buggy source:
public BorderColorManager(String propertyName){
  super(propertyName,false,null);
}

Fixed version (ground truth):
public BorderColorManager(String propertyName){
  super(propertyName,false,CSSValueConstants.BLACK_RGB_VALUE);
}
Program: 77675
Project: 77675
Buggy source:
/** 
 * Create an IJointDataSetDesign instance.
 * @param handle
 * @param context2
 * @return
 * @throws BirtException
 */
private IJointDataSetDesign newJointDataSet(JointDataSetHandle handle,ExecutionContext context2) throws BirtException {
  Iterator it=handle.joinConditionsIterator();
  List joinConditions=new ArrayList();
  JoinConditionHandle jc=null;
  while (it.hasNext()) {
    jc=(JoinConditionHandle)it.next();
    joinConditions.add(new JoinCondition(new ScriptExpression(jc.getLeftExpression()),new ScriptExpression(jc.getRightExpression()),toDteJoinOperator(jc.getOperator())));
  }
  int joinType=toDteJoinType(jc.getJoinType());
  IBaseDataSetEventHandler eventHandler=new DataSetScriptExecutor(handle,context);
  JointDataSetDesign dteDataSet=new JointDataSetDesign(handle.getName(),jc.getLeftDataSet(),jc.getRightDataSet(),joinType,joinConditions);
  dteDataSet.setEventHandler(eventHandler);
  adaptBaseDataSet(handle,dteDataSet);
  return dteDataSet;
}

Fixed version (ground truth):
/** 
 * Create an IJointDataSetDesign instance.
 * @param handle
 * @param context2
 * @return
 * @throws BirtException
 */
private IJointDataSetDesign newJointDataSet(JointDataSetHandle handle,ExecutionContext context2) throws BirtException {
  Iterator it=handle.joinConditionsIterator();
  List joinConditions=new ArrayList();
  JoinConditionHandle jc=null;
  while (it.hasNext()) {
    jc=(JoinConditionHandle)it.next();
    joinConditions.add(new JoinCondition(new ScriptExpression(jc.getLeftExpression()),new ScriptExpression(jc.getRightExpression()),toDteJoinOperator(jc.getOperator())));
  }
  int joinType=toDteJoinType(jc.getJoinType());
  IBaseDataSetEventHandler eventHandler=new DataSetScriptExecutor(handle,context);
  JointDataSetDesign dteDataSet=new JointDataSetDesign(handle.getQualifiedName(),jc.getLeftDataSet(),jc.getRightDataSet(),joinType,joinConditions);
  dteDataSet.setEventHandler(eventHandler);
  adaptBaseDataSet(handle,dteDataSet);
  return dteDataSet;
}
Program: 77677
Project: 77677
Buggy source:
/** 
 * Get report format.
 * @param request http request
 * @return report format
 */
public static String getFormat(HttpServletRequest request){
  String format=getParameter(request,PARAM_FORMAT);
  if (format != null && format.length() > 0) {
    if (PARAM_FORMAT_HTM.equalsIgnoreCase(format))     return PARAM_FORMAT_HTML;
    return format;
  }
  return PARAM_FORMAT_HTML;
}

Fixed version (ground truth):
/** 
 * Get current format of parameter.
 * @param request HttpServletRequest
 * @param paramName String
 * @return String
 */
public static String getFormat(HttpServletRequest request,String paramName){
  if (request == null || paramName == null)   return null;
  return getParameter(request,paramName + "String_Node_Str");
}
Program: 77680
Project: 77680
Buggy source:
public Object visitForeign(IForeignContent foreign,Object value){
  if (IForeignContent.HTML_TYPE.equals(foreign.getRawType())) {
    if (converter == null) {
      converter=new HTML2Content(foreign.getReportContent().getDesign().getBasePath());
    }
    converter.html2Content(foreign);
    executor=new DOMReportItemExecutor(foreign);
    executor.execute();
    return visitContent(foreign,value);
  }
  LabelContent label=new LabelContent(foreign);
  label.setText((String)foreign.getRawValue());
  return handleText(label);
}

Fixed version (ground truth):
public Object visitForeign(IForeignContent foreign,Object value){
  if (IForeignContent.HTML_TYPE.equals(foreign.getRawType())) {
    if (converter == null) {
      converter=new HTML2Content(foreign.getReportContent().getDesign().getBasePath());
    }
    converter.html2Content(foreign);
    executor=new DOMReportItemExecutor(foreign);
    executor.execute();
    return visitContent(foreign,value);
  }
  LabelContent label=new LabelContent(foreign);
  return handleText(label);
}