nus-yam/ex-repair huggingface dataset:
Program: 75765
Project: 75765
Buggy source:
public int hashCode(){
  int code=0;
  for (int i=0; i < StyleConstant.COUNT; i++) {
    code+=props[i].hashCode() * 2 + 1;
    if (Integer.MAX_VALUE == code) {
      break;
    }
  }
  return code;
}

Fixed version (ground truth):
public int hashCode(){
  int code=0;
  for (int i=0; i < StyleConstant.COUNT; i++) {
    String value=props[i] == null ? NULL : props[i];
    code+=value.hashCode() * 2 + 1;
    if (Integer.MAX_VALUE == code) {
      break;
    }
  }
  return code;
}
Program: 75766
Project: 75766
Buggy source:
public void close(){
  nextItem=0;
  super.close();
}

Fixed version (ground truth):
public void close(){
  nextItem=0;
  closeQuery();
  super.close();
}
Program: 75767
Project: 75767
Buggy source:
protected void doExecute() throws Exception {
  IRowContent rowContent=(IRowContent)content;
  rowContent.setRowID(rowId);
}

Fixed version (ground truth):
protected void doExecute() throws Exception {
  IRowContent rowContent=(IRowContent)content;
  rowContent.setRowID(rowId);
  executeQuery();
}
Program: 75768
Project: 75768
Buggy source:
public void close(){
  rowId=0;
  nextItem=0;
  super.close();
}

Fixed version (ground truth):
public void close(){
  closeQuery();
  rowId=0;
  nextItem=0;
  super.close();
}
Program: 75770
Project: 75770
Buggy source:
public IContent execute(){
  if (executor != null) {
    if (executor instanceof ExtendedGenerateExecutor) {
      ExtendedGenerateExecutor gExecutor=(ExtendedGenerateExecutor)executor;
      gExecutor.context=context;
      gExecutor.report=report;
      gExecutor.design=design;
    }
    content=executor.execute();
    if (content != null) {
      InstanceID iid=content.getInstanceID();
      if (iid != null) {
        long uid=iid.getUniqueID();
        if (uid == -1) {
          uid=generateUniqueID();
          iid=new InstanceID(iid.getParentID(),uid,iid.getComponentID(),iid.getDataID());
          content.setInstanceID(iid);
        }
      }
 else {
        iid=getInstanceID();
        content.setInstanceID(iid);
      }
      if (context.isInFactory()) {
        handleOnCreate(content);
      }
      startTOCEntry(content);
    }
  }
  return content;
}

Fixed version (ground truth):
public IContent execute(){
  if (executor != null) {
    if (executor instanceof ExtendedGenerateExecutor) {
      ExtendedGenerateExecutor gExecutor=(ExtendedGenerateExecutor)executor;
      gExecutor.parent=parent;
      gExecutor.context=context;
      gExecutor.report=report;
      gExecutor.design=design;
    }
    content=executor.execute();
    if (content != null) {
      InstanceID iid=content.getInstanceID();
      if (iid != null) {
        long uid=iid.getUniqueID();
        if (uid == -1) {
          uid=generateUniqueID();
          iid=new InstanceID(iid.getParentID(),uid,iid.getComponentID(),iid.getDataID());
          content.setInstanceID(iid);
        }
      }
 else {
        iid=getInstanceID();
        content.setInstanceID(iid);
      }
      if (content.getParent() == null) {
        content.setParent(getParentContent());
      }
      if (context.isInFactory()) {
        handleOnCreate(content);
      }
      startTOCEntry(content);
    }
  }
  return content;
}
Program: 75771
Project: 75771
Buggy source:
protected ContainerExecutor(ExecutorManager manager,int type){
  super(manager,type);
  needPrepareNext=true;
  sections=null;
  useNextSection=true;
  nextSection=-1;
  nextOffset=-1;
}

Fixed version (ground truth):
protected ContainerExecutor(ExecutorManager manager,int type){
  super(manager,type);
  needPrepareNext=true;
  prepareFirstChild=true;
  sections=null;
  useNextSection=true;
  nextSection=-1;
  nextOffset=-1;
}
Program: 75773
Project: 75773
Buggy source:
public void close(){
  if (nextOffset != -1) {
    reader.unloadContent(nextOffset);
    nextOffset=-1;
  }
  needPrepareNext=true;
  sections=null;
  useNextSection=true;
  nextSection=-1;
  nextOffset=-1;
  super.close();
}

Fixed version (ground truth):
public void close(){
  if (nextOffset != -1) {
    reader.unloadContent(nextOffset);
    nextOffset=-1;
  }
  prepareFirstChild=true;
  needPrepareNext=true;
  sections=null;
  useNextSection=true;
  nextSection=-1;
  nextOffset=-1;
  super.close();
}
Program: 75775
Project: 75775
Buggy source:
public ExtendedItemExecutor(ExecutorManager manager){
  super(manager,ExecutorManager.EXTENDEDITEM);
  firstChild=true;
}

Fixed version (ground truth):
public ExtendedItemExecutor(ExecutorManager manager){
  super(manager,ExecutorManager.EXTENDEDITEM);
}
Program: 75776
Project: 75776
Buggy source:
public void close(){
  firstChild=true;
  closeQuery();
  super.close();
}

Fixed version (ground truth):
public void close(){
  closeQuery();
  super.close();
}
Program: 75777
Project: 75777
Buggy source:
public IContent execute(){
  if (!executed) {
    executed=true;
    try {
      if (offset != -1) {
        InstanceID instanceId=getInstanceID();
        content=reader.loadContent(offset);
        content.setGenerateBy(design);
        IContent pContent=getParentContent();
        if (pContent != null) {
          content.setParent(pContent);
        }
        doExecute();
      }
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
  return content;
}

Fixed version (ground truth):
public IContent execute(){
  if (!executed) {
    executed=true;
    try {
      if (offset != -1) {
        generateUniqueID();
        content=reader.loadContent(offset);
        content.setGenerateBy(design);
        IContent pContent=getParentContent();
        if (pContent != null) {
          content.setParent(pContent);
        }
        doExecute();
      }
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
  return content;
}
Program: 75778
Project: 75778
Buggy source:
void writeFATInt(long offset,int block) throws IOException {
  int blockId=(int)(offset / BLOCK_SIZE);
  int off=(int)(offset % BLOCK_SIZE);
  if (blockId >= totalAllocBlocks) {
    int newTotalBlocks=blockId + 1;
    ensureFATBlocks(newTotalBlocks);
    for (int i=totalAllocBlocks; i < newTotalBlocks; i++) {
      allocBlocks[totalAllocBlocks]=1024 * totalAllocBlocks;
      totalAllocBlocks++;
    }
  }
  int phyBlockId=getFATBlock(blockId);
  byte[] b=new byte[4];
  ArchiveUtil.integerToBytes(block,b);
  af.write(phyBlockId,off,b,0,4);
}

Fixed version (ground truth):
void writeFATInt(long offset,int block) throws IOException {
  int blockId=(int)(offset / BLOCK_SIZE);
  int off=(int)(offset % BLOCK_SIZE);
  if (blockId >= totalAllocBlocks) {
    int newTotalBlocks=blockId + 1;
    ensureFATBlocks(newTotalBlocks);
    for (int i=totalAllocBlocks; i < newTotalBlocks; i++) {
      allocBlocks[totalAllocBlocks]=INDEX_PER_BLOCK * totalAllocBlocks;
      totalAllocBlocks++;
    }
  }
  int phyBlockId=getFATBlock(blockId);
  byte[] b=new byte[4];
  ArchiveUtil.integerToBytes(block,b);
  af.write(phyBlockId,off,b,0,4);
}
Program: 75779
Project: 75779
Buggy source:
int getDefaultBlockSize(){
  String value=System.getProperty(PROPERTY_DEFAULT_BLOCK_SIZE);
  if (value == null) {
    try {
      int defaultBlockSize=Integer.parseInt(value);
      defaultBlockSize=(defaultBlockSize + 1023) / 1024 * 1024;
      if (defaultBlockSize > 0) {
        return defaultBlockSize;
      }
    }
 catch (    Exception ex) {
    }
  }
  return DEFAULT_BLOCK_SIZE;
}

Fixed version (ground truth):
int getDefaultBlockSize(){
  String value=System.getProperty(PROPERTY_DEFAULT_BLOCK_SIZE);
  if (value != null) {
    try {
      int defaultBlockSize=Integer.parseInt(value);
      defaultBlockSize=(defaultBlockSize + 1023) / 1024 * 1024;
      if (defaultBlockSize > 0) {
        return defaultBlockSize;
      }
    }
 catch (    Exception ex) {
    }
  }
  return DEFAULT_BLOCK_SIZE;
}
Program: 75780
Project: 75780
Buggy source:
Block(int size){
  blockSize=size;
  blockData=new byte[size];
  id=-1;
  dirtyStart=0;
  dirtyEnd=0;
  dataSize=0;
  prev=null;
  next=null;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param fs the compound file system it belongs to
 * @param blockId the block ID
 */
Block(int size){
  blockSize=size;
  blockData=new byte[size];
  id=-1;
  dirtyStart=0;
  dirtyEnd=0;
  dataSize=0;
  prev=null;
  next=null;
}
Program: 75781
Project: 75781
Buggy source:
/** 
 * update row height
 * @param row
 */
public void updateRow(RowArea row,int specifiedHeight,boolean finished){
  if (layout != null) {
    layout.updateRow(row,specifiedHeight,finished);
  }
}

Fixed version (ground truth):
/** 
 * update row height
 * @param row
 */
public void updateRow(RowArea row,int specifiedHeight,boolean finished){
  if (layout != null) {
    int originalHeight=getDimensionValue(row.getContent().getHeight());
    layout.updateRow(row,specifiedHeight,originalHeight,finished);
  }
}
Program: 75785
Project: 75785
Buggy source:
/** 
 * Initialize the resultClass. This method is lightweight.
 * @param dataEngine
 * @param dataSetDesign
 * @param appContext
 * @throws DataException
 */
private void initializeResultClass(DataEngineImpl dataEngine,Map appContext) throws DataException {
  try {
    IQueryResults left=getResultSetQuery(dataEngine,dataSet.getLeftDataSetDesignName(),appContext,dataSet.getJoinConditions(),true);
    IQueryResults right=getResultSetQuery(dataEngine,dataSet.getRightDataSetDesignName(),appContext,dataSet.getJoinConditions(),false);
    JointResultMetadata meta=getJointResultMetadata(left.getResultMetaData(),right.getResultMetaData());
    resultClass=meta.getResultClass();
  }
 catch (  BirtException be) {
    throw DataException.wrap(be);
  }
}

Fixed version (ground truth):
/** 
 * Initialize the resultClass. This method is lightweight.
 * @param dataEngine
 * @param dataSetDesign
 * @param appContext
 * @throws DataException
 */
private void initializeResultClass(DataEngineImpl dataEngine,Map appContext) throws DataException {
  try {
    IQueryResults left=getResultSetQuery(dataEngine,dataSet.getLeftDataSetDesignName(),appContext,dataSet.getJoinConditions(),true);
    IResultMetaData leftMetaData=left.getResultMetaData();
    IQueryResults right=getResultSetQuery(dataEngine,dataSet.getRightDataSetDesignName(),appContext,dataSet.getJoinConditions(),false);
    IResultMetaData rightMetaData=right.getResultMetaData();
    JointResultMetadata meta=getJointResultMetadata(leftMetaData,rightMetaData);
    resultClass=meta.getResultClass();
  }
 catch (  BirtException be) {
    throw DataException.wrap(be);
  }
}
Program: 75786
Project: 75786
Buggy source:
public Object getValue(){
  return value;
}

Fixed version (ground truth):
/** 
 * @return the value
 */
public Object getValue(){
  return value;
}
Program: 75787
Project: 75787
Buggy source:
public String getLabel(){
  return label;
}

Fixed version (ground truth):
/** 
 * @return the label
 */
public String getLabel(){
  return label;
}
Program: 75788
Project: 75788
Buggy source:
public void run(){
  CrosstabReportItemHandle reportItem=getCrosstabReportItemHandle(getHandle());
  if (reportItem != null) {
    transStar(NAME);
    try {
      reportItem.removeMeasure(measureViewHandle.getCubeMeasure().getQualifiedName());
    }
 catch (    SemanticException e) {
      rollBack();
      ExceptionHandler.handle(e);
      return;
    }
    transEnd();
  }
}

Fixed version (ground truth):
public void run(){
  CrosstabReportItemHandle reportItem=getCrosstabReportItemHandle(getHandle());
  if (reportItem != null) {
    transStar(NAME);
    try {
      reportItem.removeMeasure(measureViewHandle.getCubeMeasureName());
    }
 catch (    SemanticException e) {
      rollBack();
      ExceptionHandler.handle(e);
      return;
    }
    transEnd();
  }
}
Program: 75789
Project: 75789
Buggy source:
public boolean performDrop(Object transfer,Object target,int operation,DNDLocation location){
  if (transfer instanceof Object[]) {
    boolean result=false;
    for (int i=0; i < ((Object[])transfer).length; i++) {
      result=performDrop(((Object[])transfer)[i],target,operation,location);
      if (!result)       return false;
    }
    return result;
  }
  for (Iterator iterator=this.dropAdapterList.iterator(); iterator.hasNext(); ) {
    IDropAdapter dropAdapter=(IDropAdapter)iterator.next();
    int result=dropAdapter.canDrop(transfer,target,operation,location);
    if (result == LOGIC_TRUE)     return dropAdapter.performDrop(transfer,target,operation,location);
  }
  return false;
}

Fixed version (ground truth):
public boolean performDrop(Object transfer,Object target,int operation,DNDLocation location){
  if (transfer instanceof Object[]) {
    if (((Object[])transfer).length == 1) {
      return performDrop(((Object[])transfer)[0],target,operation,location);
    }
  }
  for (Iterator iterator=this.dropAdapterList.iterator(); iterator.hasNext(); ) {
    IDropAdapter dropAdapter=(IDropAdapter)iterator.next();
    int result=dropAdapter.canDrop(transfer,target,operation,location);
    if (result == LOGIC_TRUE)     return dropAdapter.performDrop(transfer,target,operation,location);
  }
  return false;
}
Program: 75790
Project: 75790
Buggy source:
public boolean validDrop(Object transfer,Object target,int operation,DNDLocation location){
  if (transfer instanceof Object[]) {
    boolean canDrop=false;
    for (int i=0; i < ((Object[])transfer).length; i++) {
      canDrop=validDrop(((Object[])transfer)[i],target,operation,location);
      if (!canDrop)       return false;
    }
    return canDrop;
  }
  for (Iterator iterator=this.dropAdapterList.iterator(); iterator.hasNext(); ) {
    IDropAdapter dropAdapter=(IDropAdapter)iterator.next();
    int result=dropAdapter.canDrop(transfer,target,operation,location);
    if (result == LOGIC_TRUE)     return true;
    if (result == LOGIC_FALSE)     return false;
  }
  return false;
}

Fixed version (ground truth):
public boolean validDrop(Object transfer,Object target,int operation,DNDLocation location){
  if (transfer instanceof Object[]) {
    if (((Object[])transfer).length == 1) {
      return validDrop(((Object[])transfer)[0],target,operation,location);
    }
  }
  for (Iterator iterator=this.dropAdapterList.iterator(); iterator.hasNext(); ) {
    IDropAdapter dropAdapter=(IDropAdapter)iterator.next();
    int result=dropAdapter.canDrop(transfer,target,operation,location);
    if (result == LOGIC_TRUE)     return true;
    if (result == LOGIC_FALSE)     return false;
  }
  return false;
}
Program: 75791
Project: 75791
Buggy source:
public boolean validDrag(Object object){
  if (object instanceof Object[]) {
    boolean canDrag=false;
    for (int i=0; i < ((Object[])object).length; i++) {
      canDrag=validDrag(((Object[])object)[i]);
      if (!canDrag)       return false;
    }
    return canDrag;
  }
  for (Iterator iterator=this.dragAdapterList.iterator(); iterator.hasNext(); ) {
    IDragAdapter dragAdapter=(IDragAdapter)iterator.next();
    int result=dragAdapter.canDrag(object);
    if (result == LOGIC_TRUE)     return true;
    if (result == LOGIC_FALSE)     return false;
  }
  return false;
}

Fixed version (ground truth):
public boolean validDrag(Object object){
  if (object instanceof Object[]) {
    if (((Object[])object).length == 1) {
      return validDrag(((Object[])object)[0]);
    }
  }
  for (Iterator iterator=this.dragAdapterList.iterator(); iterator.hasNext(); ) {
    IDragAdapter dragAdapter=(IDragAdapter)iterator.next();
    int result=dragAdapter.canDrag(object);
    if (result == LOGIC_TRUE)     return true;
    if (result == LOGIC_FALSE)     return false;
  }
  return false;
}
Program: 75793
Project: 75793
Buggy source:
public void close() throws IOException {
  archiveReader.close();
}

Fixed version (ground truth):
public void close() throws IOException {
}
Program: 75794
Project: 75794
Buggy source:
/** 
 * refresh page
 */
private void refreshPage(){
  DataSourceDesign curDataSourceDesign=this.getDataSetDesign().getDataSourceDesign();
  if (curDataSourceDesign != prevDataSourceDesign) {
    RemoveAllAvailableDbObjects();
    resetJdbcInfo(curDataSourceDesign);
    enableSchemaComponent(isSchemaSupported);
    setRootElement();
    sourceViewerConfiguration.getContentAssistProcessor().setDataSourceHandle(curDataSourceDesign);
    populateAvailableDbObjects();
    prevDataSourceDesign=curDataSourceDesign;
    try {
      ResultSetMetaData meta=this.metaDataProvider.getConnection().prepareStatement(this.getDataSetDesign().getQueryText()).getMetaData();
      ResultSetColumns rsc=this.getDataSetDesign().getPrimaryResultSet().getResultSetColumns();
      if (meta.getColumnCount() != rsc.getResultColumnDefinitions().size()) {
        this.shouldUpdateDataSetDesign=true;
        return;
      }
      for (int i=0; i < rsc.getResultColumnDefinitions().size(); i++) {
        ColumnDefinition cd=(ColumnDefinition)rsc.getResultColumnDefinitions().get(i);
        if (!(cd.getAttributes().getName().equals(meta.getColumnName(i + 1)) && cd.getAttributes().getNativeDataTypeCode() == meta.getColumnType(i + 1))) {
          this.shouldUpdateDataSetDesign=true;
          return;
        }
      }
    }
 catch (    SQLException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * refresh page
 */
private void refreshPage(){
  DataSourceDesign curDataSourceDesign=this.getDataSetDesign().getDataSourceDesign();
  if (curDataSourceDesign != prevDataSourceDesign) {
    RemoveAllAvailableDbObjects();
    resetJdbcInfo(curDataSourceDesign);
    enableSchemaComponent(isSchemaSupported);
    setRootElement();
    sourceViewerConfiguration.getContentAssistProcessor().setDataSourceHandle(curDataSourceDesign);
    populateAvailableDbObjects();
    prevDataSourceDesign=curDataSourceDesign;
    try {
      if (this.getDataSetDesign().getQueryText() == null || this.getDataSetDesign().getQueryText().trim().length() == 0)       return;
      ResultSetMetaData meta=this.metaDataProvider.getConnection().prepareStatement(this.getDataSetDesign().getQueryText()).getMetaData();
      if (meta == null)       return;
      ResultSetColumns rsc=this.getDataSetDesign().getPrimaryResultSet().getResultSetColumns();
      if (meta.getColumnCount() != rsc.getResultColumnDefinitions().size()) {
        this.shouldUpdateDataSetDesign=true;
        return;
      }
      for (int i=0; i < rsc.getResultColumnDefinitions().size(); i++) {
        ColumnDefinition cd=(ColumnDefinition)rsc.getResultColumnDefinitions().get(i);
        if (!(cd.getAttributes().getName().equals(meta.getColumnName(i + 1)) && cd.getAttributes().getNativeDataTypeCode() == meta.getColumnType(i + 1))) {
          this.shouldUpdateDataSetDesign=true;
          return;
        }
      }
    }
 catch (    SQLException e) {
      e.printStackTrace();
    }
  }
}
Program: 75796
Project: 75796
Buggy source:
private int getParameterType(int i) throws OdaException {
  if (parameterDefn.getParameterType(i) != Types.CHAR)   return parameterDefn.getParameterType(i);
  return ((ParameterDefn)getCallableParamMetaData().get(i)).getParamType();
}

Fixed version (ground truth):
private int getParameterType(int i) throws OdaException {
  if (parameterDefn.getParameterType(i) != Types.CHAR)   return parameterDefn.getParameterType(i);
  List paramMetaDataList=getCallableParamMetaData();
  if (paramMetaDataList != null && !paramMetaDataList.isEmpty())   return ((ParameterDefn)paramMetaDataList.get(i)).getParamType();
 else   return parameterDefn.getParameterType(i);
}
Program: 75797
Project: 75797
Buggy source:
/** 
 * @param mode
 * @param scope
 * @param reader
 * @param writer
 * @throws BirtException
 */
private DataEngineContext(int mode,Scriptable scope,IDocArchiveReader reader,IDocArchiveWriter writer) throws BirtException {
  if (!(mode == MODE_GENERATION || mode == MODE_PRESENTATION || mode == DIRECT_PRESENTATION || mode == MODE_UPDATE))   throw new DataException(ResourceConstants.RD_INVALID_MODE);
  if (writer == null && mode == MODE_GENERATION)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  if (reader == null && mode == MODE_PRESENTATION)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  if ((writer == null || reader == null) && mode == MODE_UPDATE)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  this.mode=mode;
  this.scope=scope;
  this.reader=reader;
  this.writer=writer;
  this.cacheOption=CACHE_USE_DEFAULT;
}

Fixed version (ground truth):
/** 
 * @param mode
 * @param scope
 * @param reader
 * @param writer
 * @throws BirtException
 */
private DataEngineContext(int mode,Scriptable scope,IDocArchiveReader reader,IDocArchiveWriter writer) throws BirtException {
  Object[] params={new Integer(mode),scope,reader,writer};
  logger.entering(DataEngineContext.class.getName(),"String_Node_Str",params);
  if (!(mode == MODE_GENERATION || mode == MODE_PRESENTATION || mode == DIRECT_PRESENTATION || mode == MODE_UPDATE))   throw new DataException(ResourceConstants.RD_INVALID_MODE);
  if (writer == null && mode == MODE_GENERATION)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  if (reader == null && mode == MODE_PRESENTATION)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  if ((writer == null || reader == null) && mode == MODE_UPDATE)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  this.mode=mode;
  this.scope=scope;
  this.reader=reader;
  this.writer=writer;
  this.cacheOption=CACHE_USE_DEFAULT;
  logger.exiting(DataEngineContext.class.getName(),"String_Node_Str");
}
Program: 75798
Project: 75798
Buggy source:
/** 
 * @param ri
 * @param scope
 * @param saveUtil
 * @param serviceForResultSet
 * @throws DataException 
 */
BindingColumnsEvalUtil(IResultIterator ri,Scriptable scope,RDSaveHelper saveUtil,List manualBindingExprs,Map autoBindingExprs) throws DataException {
  this.odiResult=ri;
  this.scope=scope;
  this.saveHelper=saveUtil;
  try {
    this.isBasedOnRD=ExprMetaUtil.isBasedOnRD(ri.getResultClass());
    if (this.isBasedOnRD == true)     this.evalHelper=new EvalHelper(ri);
  }
 catch (  DataException e) {
  }
  this.initBindingColumns(manualBindingExprs,autoBindingExprs);
}

Fixed version (ground truth):
/** 
 * @param ri
 * @param scope
 * @param saveUtil
 * @param serviceForResultSet
 * @throws DataException 
 */
BindingColumnsEvalUtil(IResultIterator ri,Scriptable scope,RDSaveHelper saveUtil,List manualBindingExprs,Map autoBindingExprs) throws DataException {
  Object[] params={ri,scope,saveUtil,manualBindingExprs,autoBindingExprs};
  logger.entering(BindingColumnsEvalUtil.class.getName(),"String_Node_Str",params);
  this.odiResult=ri;
  this.scope=scope;
  this.saveHelper=saveUtil;
  try {
    this.isBasedOnRD=ExprMetaUtil.isBasedOnRD(ri.getResultClass());
    if (this.isBasedOnRD == true)     this.evalHelper=new EvalHelper(ri);
  }
 catch (  DataException e) {
  }
  this.initBindingColumns(manualBindingExprs,autoBindingExprs);
  logger.exiting(BindingColumnsEvalUtil.class.getName(),"String_Node_Str");
}
Program: 75799
Project: 75799
Buggy source:
/** 
 * @param context
 * @param queryResultID
 * @throws DataException
 */
public CacheResultIterator(DataEngineContext context,String queryResultID) throws DataException {
  this.context=context;
  this.queryResultID=queryResultID;
  this.columnValueMap=new HashMap();
  this.currRowIndex=-1;
  try {
    createCacheInputStream();
    resultClass=new ResultClass(this.metaInputStream);
    rowCount=IOUtil.readInt(rowInputStream);
    int columnSize=IOUtil.readInt(rowInputStream);
    columnList=new ArrayList();
    for (int i=0; i < columnSize; i++) {
      columnList.add(IOUtil.readObject(rowInputStream));
    }
  }
 catch (  FileNotFoundException e) {
    throw new DataException(ResourceConstants.OPEN_CACHE_TEMPFILE_ERROR);
  }
catch (  IOException e) {
    throw new DataException(ResourceConstants.READ_CACHE_TEMPFILE_ERROR);
  }
}

Fixed version (ground truth):
/** 
 * @param context
 * @param queryResultID
 * @throws DataException
 */
public CacheResultIterator(DataEngineContext context,String queryResultID) throws DataException {
  Object[] params={context,queryResultID};
  logger.entering(CacheResultIterator.class.getName(),"String_Node_Str",params);
  this.context=context;
  this.queryResultID=queryResultID;
  this.columnValueMap=new HashMap();
  this.currRowIndex=-1;
  try {
    createCacheInputStream();
    resultClass=new ResultClass(this.metaInputStream);
    rowCount=IOUtil.readInt(rowInputStream);
    int columnSize=IOUtil.readInt(rowInputStream);
    columnList=new ArrayList();
    for (int i=0; i < columnSize; i++) {
      columnList.add(IOUtil.readObject(rowInputStream));
    }
    logger.exiting(CacheResultIterator.class.getName(),"String_Node_Str");
  }
 catch (  FileNotFoundException e) {
    throw new DataException(ResourceConstants.OPEN_CACHE_TEMPFILE_ERROR);
  }
catch (  IOException e) {
    throw new DataException(ResourceConstants.READ_CACHE_TEMPFILE_ERROR);
  }
}
Program: 75800
Project: 75800
Buggy source:
/** 
 * @param context
 * @param queryResultID
 * @throws DataException
 */
public CachedQueryResults(DataEngineContext context,String queryResultID) throws DataException {
  this.queryResultID=queryResultID;
  this.resultIterator=new CacheResultIterator(context,queryResultID);
}

Fixed version (ground truth):
/** 
 * @param context
 * @param queryResultID
 * @throws DataException
 */
public CachedQueryResults(DataEngineContext context,String queryResultID) throws DataException {
  Object[] params={context,queryResultID};
  logger.entering(CachedQueryResults.class.getName(),"String_Node_Str",params);
  this.queryResultID=queryResultID;
  this.resultIterator=new CacheResultIterator(context,queryResultID);
  logger.exiting(CachedQueryResults.class.getName(),"String_Node_Str");
}
Program: 75801
Project: 75801
Buggy source:
ColumnInfo(int columnIndex,String columnName){
  this.columnIndex=columnIndex;
  this.columnName=columnName;
}

Fixed version (ground truth):
ColumnInfo(int columnIndex,String columnName){
  Object[] params={new Integer(columnIndex),columnName};
  logger.entering(ColumnInfo.class.getName(),"String_Node_Str",params);
  this.columnIndex=columnIndex;
  this.columnName=columnName;
  logger.exiting(ColumnInfo.class.getName(),"String_Node_Str");
}
Program: 75802
Project: 75802
Buggy source:
/** 
 * @param dataSet
 * @param dataSetCCList
 * @param resultSetCCList
 */
ComputedColumnHelper(DataSetRuntime dataSet,List dataSetCCList,List resultSetCCList){
  this.dataSetInstance=new ComputedColumnHelperInstance(dataSet,dataSetCCList);
  this.resultSetInstance=new ComputedColumnHelperInstance(dataSet,resultSetCCList);
  this.currentModel=TransformationConstants.DATA_SET_MODEL;
  this.allCC=new ArrayList();
  this.allCC.addAll(dataSetCCList);
  this.allCC.addAll(resultSetCCList);
}

Fixed version (ground truth):
/** 
 * @param dataSet
 * @param dataSetCCList
 * @param resultSetCCList
 */
ComputedColumnHelper(DataSetRuntime dataSet,List dataSetCCList,List resultSetCCList){
  Object[] params={dataSet,dataSetCCList,resultSetCCList};
  logger.entering(ComputedColumnHelper.class.getName(),"String_Node_Str",params);
  this.dataSetInstance=new ComputedColumnHelperInstance(dataSet,dataSetCCList);
  this.resultSetInstance=new ComputedColumnHelperInstance(dataSet,resultSetCCList);
  this.currentModel=TransformationConstants.DATA_SET_MODEL;
  this.allCC=new ArrayList();
  this.allCC.addAll(dataSetCCList);
  this.allCC.addAll(resultSetCCList);
  logger.exiting(ComputedColumnHelper.class.getName(),"String_Node_Str");
}
Program: 75803
Project: 75803
Buggy source:
/** 
 * Constructor to specify the DataEngine Context to use by the Data Engine for all related ReportQuery processing.
 * @param context scope of Context: The global JavaScript scope shared by all runtime components within a report sesssion. If this parameter is null, a new standard top level scope will be created and used.
 */
public DataEngineImpl(DataEngineContext context){
}

Fixed version (ground truth):
/** 
 * Constructor to specify the DataEngine Context to use by the Data Engine for all related ReportQuery processing.
 * @param context scope of Context: The global JavaScript scope shared by all runtime components within a report session. If this parameter is null, a new standard top level scope will be created and used.
 */
public DataEngineImpl(DataEngineContext context){
}
Program: 75804
Project: 75804
Buggy source:
/** 
 * Constructor.
 * @param engine
 */
public DataEngineSession(DataEngineContext context,DataEngine engine){
  this.context=new HashMap();
  this.dataSetCacheManager=new DataSetCacheManager(context.getTmpdir(),engine);
  this.cacheUtil=new CacheUtil(context.getTmpdir());
  this.engine=engine;
  this.scope=context.getJavaScriptScope();
  Context cx=Context.enter();
  if (this.scope == null) {
    this.scope=new ImporterTopLevel(cx);
  }
  new CoreJavaScriptInitializer().initialize(cx,scope);
  Context.exit();
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param engine
 */
public DataEngineSession(DataEngineContext context,DataEngine engine){
  Object[] params={context,engine};
  logger.entering(DataEngineSession.class.getName(),"String_Node_Str",params);
  this.context=new HashMap();
  this.dataSetCacheManager=new DataSetCacheManager(context.getTmpdir(),engine);
  this.cacheUtil=new CacheUtil(context.getTmpdir());
  this.engine=engine;
  this.scope=context.getJavaScriptScope();
  Context cx=Context.enter();
  if (this.scope == null) {
    this.scope=new ImporterTopLevel(cx);
  }
  new CoreJavaScriptInitializer().initialize(cx,scope);
  Context.exit();
  logger.exiting(DataEngineSession.class.getName(),"String_Node_Str");
}
Program: 75805
Project: 75805
Buggy source:
protected DataSetRuntime(IBaseDataSetDesign dataSetDesign,IQueryExecutor queryExecutor){
  this.dataSetDesign=dataSetDesign;
  this.queryExecutor=queryExecutor;
  isOpen=true;
  if (dataSetDesign != null)   eventHandler=dataSetDesign.getEventHandler();
  if (dataSetDesign != null) {
    List params=dataSetDesign.getParameters();
    if (params != null) {
      Iterator it=params.iterator();
      while (it.hasNext()) {
        IParameterDefinition param=(IParameterDefinition)it.next();
        String name=param.getName();
        if (name != null) {
          if (param.isInputMode())           inParamValues.put(name,UNSET_VALUE);
          if (param.isOutputMode())           outParamValues.put(name,UNSET_VALUE);
        }
      }
    }
  }
  if (eventHandler == null) {
    if (dataSetDesign instanceof IScriptDataSetDesign)     eventHandler=new ScriptDataSetJSEventHandler((IScriptDataSetDesign)dataSetDesign);
 else     if (dataSetDesign instanceof IOdaDataSetDesign)     eventHandler=new DataSetJSEventHandler(dataSetDesign);
  }
}

Fixed version (ground truth):
protected DataSetRuntime(IBaseDataSetDesign dataSetDesign,IQueryExecutor queryExecutor){
  Object[] parameters={dataSetDesign,queryExecutor};
  logger.entering(DataSetRuntime.class.getName(),"String_Node_Str",parameters);
  this.dataSetDesign=dataSetDesign;
  this.queryExecutor=queryExecutor;
  isOpen=true;
  if (dataSetDesign != null)   eventHandler=dataSetDesign.getEventHandler();
  if (dataSetDesign != null) {
    List params=dataSetDesign.getParameters();
    if (params != null) {
      Iterator it=params.iterator();
      while (it.hasNext()) {
        IParameterDefinition param=(IParameterDefinition)it.next();
        String name=param.getName();
        if (name != null) {
          if (param.isInputMode())           inParamValues.put(name,UNSET_VALUE);
          if (param.isOutputMode())           outParamValues.put(name,UNSET_VALUE);
        }
      }
    }
  }
  if (eventHandler == null) {
    if (dataSetDesign instanceof IScriptDataSetDesign)     eventHandler=new ScriptDataSetJSEventHandler((IScriptDataSetDesign)dataSetDesign);
 else     if (dataSetDesign instanceof IOdaDataSetDesign)     eventHandler=new DataSetJSEventHandler(dataSetDesign);
  }
  logger.exiting(DataSetRuntime.class.getName(),"String_Node_Str");
}
Program: 75806
Project: 75806
Buggy source:
/** 
 * @param scope
 */
public ExecutorHelper(IExecutorHelper parent){
  this.parent=parent;
}

Fixed version (ground truth):
/** 
 * @param scope
 */
public ExecutorHelper(IExecutorHelper parent){
  logger.entering(ExecutorHelper.class.getName(),"String_Node_Str",parent);
  this.parent=parent;
  logger.exiting(ExecutorHelper.class.getName(),"String_Node_Str");
}
Program: 75807
Project: 75807
Buggy source:
/** 
 * No external instance
 */
private ExprManagerUtil(ExprManager em){
  this.exprManager=em;
}

Fixed version (ground truth):
/** 
 * No external instance
 */
private ExprManagerUtil(ExprManager em){
  logger.entering(ExprManagerUtil.class.getName(),"String_Node_Str",em);
  this.exprManager=em;
  logger.exiting(ExprManagerUtil.class.getName(),"String_Node_Str");
}
Program: 75808
Project: 75808
Buggy source:
/** 
 * @param dataSetFilters
 * @param queryFilters
 * @param dataSet
 * @throws DataException
 */
FilterByRow(List dataSetFilters,List queryFilters,List groupFilters,DataSetRuntime dataSet) throws DataException {
  isLegal(dataSetFilters);
  isLegal(queryFilters);
  this.dataSet=dataSet;
  this.dataSetFilters=FilterUtil.sortFilters(dataSetFilters);
  this.queryFilters=FilterUtil.sortFilters(queryFilters);
  this.groupFilters=groupFilters;
  this.allFilters=getAllFilters(dataSetFilters,queryFilters);
  this.currentWorkingFilters=ALL_ROW_FILTER;
  logger.log(Level.FINER,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param dataSetFilters
 * @param queryFilters
 * @param dataSet
 * @throws DataException
 */
FilterByRow(List dataSetFilters,List queryFilters,List groupFilters,DataSetRuntime dataSet) throws DataException {
  Object[] params={dataSetFilters,queryFilters,groupFilters,dataSet};
  logger.entering(FilterByRow.class.getName(),"String_Node_Str",params);
  isLegal(dataSetFilters);
  isLegal(queryFilters);
  this.dataSet=dataSet;
  this.dataSetFilters=FilterUtil.sortFilters(dataSetFilters);
  this.queryFilters=FilterUtil.sortFilters(queryFilters);
  this.groupFilters=groupFilters;
  this.allFilters=getAllFilters(dataSetFilters,queryFilters);
  this.currentWorkingFilters=ALL_ROW_FILTER;
  logger.exiting(FilterByRow.class.getName(),"String_Node_Str");
  logger.log(Level.FINER,"String_Node_Str");
}
Program: 75811
Project: 75811
Buggy source:
/** 
 * Save the column meta data to data set handle.
 * @param dataSetHandle
 * @param items
 * @throws SemanticException
 */
public static void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent) throws SemanticException {
  DataSessionContext context=null;
  try {
    context=new DataSessionContext(DataEngineContext.DIRECT_PRESENTATION,dataSetHandle.getRoot(),null);
    DataRequestSession drSession=DataRequestSession.newSession(context);
    drSession.refreshMetaData(dataSetHandle,holdEvent);
  }
 catch (  BirtException e) {
    logger.entering(DataSetUIUtil.class.getName(),"String_Node_Str",new Object[]{e});
  }
}

Fixed version (ground truth):
/** 
 * Save the column meta data to data set handle.
 * @param dataSetHandle
 * @param items
 * @throws SemanticException
 */
public static void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent) throws SemanticException {
  DataSessionContext context=null;
  try {
    context=new DataSessionContext(DataEngineContext.DIRECT_PRESENTATION,dataSetHandle.getRoot(),null);
    DataRequestSession drSession=DataRequestSession.newSession(context);
    drSession.refreshMetaData(dataSetHandle,holdEvent);
    drSession.shutdown();
  }
 catch (  BirtException e) {
    logger.entering(DataSetUIUtil.class.getName(),"String_Node_Str",new Object[]{e});
  }
}
Program: 75812
Project: 75812
Buggy source:
/** 
 * @param dataSet
 * @param queryDefn
 * @param useColumnHints
 * @return
 * @throws BirtException
 */
public IQueryResults execute(DataSetHandle dataSet,QueryDefinition queryDefn,boolean useColumnHints,boolean useFilters,Map appContext,boolean clearCache) throws BirtException {
  this.populateAllOutputColumns(dataSet);
  DataSessionContext context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,dataSet.getModuleHandle());
  context.setAppContext(appContext);
  DataRequestSession session=DataRequestSession.newSession(context);
  IBaseDataSetDesign dataSetDesign=session.getModelAdaptor().adaptDataSet(dataSet);
  if (clearCache) {
    IBaseDataSourceDesign dataSourceDesign=session.getModelAdaptor().adaptDataSource(dataSet.getDataSource());
    session.clearCache(dataSourceDesign,dataSetDesign);
  }
  if (!useColumnHints) {
    dataSetDesign.getResultSetHints().clear();
  }
  if (!useFilters) {
    dataSetDesign.getFilters().clear();
  }
  IQueryResults resultSet=executeQuery(session,queryDefn);
  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,Map appContext,boolean clearCache,DataRequestSession session) throws BirtException {
  this.populateAllOutputColumns(dataSet,session);
  IBaseDataSetDesign dataSetDesign=session.getModelAdaptor().adaptDataSet(dataSet);
  if (clearCache) {
    IBaseDataSourceDesign dataSourceDesign=session.getModelAdaptor().adaptDataSource(dataSet.getDataSource());
    session.clearCache(dataSourceDesign,dataSetDesign);
  }
  if (!useColumnHints) {
    dataSetDesign.getResultSetHints().clear();
  }
  if (!useFilters) {
    dataSetDesign.getFilters().clear();
  }
  IQueryResults resultSet=executeQuery(session,queryDefn);
  saveResultToDataItems(dataSet,resultSet);
  return resultSet;
}
Program: 75813
Project: 75813
Buggy source:
/** 
 * @param dataSet
 * @param refresh
 * @param useColumnHints Only applicable if the list is refreshed.
 * @return
 */
public DataSetViewData[] getColumns(DataSetHandle dataSet,boolean refresh,boolean useColumnHints,boolean suppressErrorMessage){
  if (dataSet == null) {
    return new DataSetViewData[0];
  }
  DataSetViewData[] columns=(DataSetViewData[])htColumns.get(dataSet);
  if (!refresh && columns == null) {
    columns=getCachedColumns(dataSet);
  }
  if (columns == null || refresh) {
    columns=null;
    try {
      boolean canExecute=true;
      if (dataSet instanceof OdaDataSetHandle) {
        String queryTxt=((OdaDataSetHandle)dataSet).getQueryText();
        canExecute=(queryTxt != null && queryTxt.trim().length() > 0);
      }
      if (canExecute) {
        IQueryResults results=execute(dataSet,useColumnHints,true,1);
        if (results != null) {
          results.close();
        }
        columns=(DataSetViewData[])htColumns.get(dataSet);
      }
    }
 catch (    BirtException e) {
      if (!suppressErrorMessage) {
        ExceptionHandler.handle(e);
      }
    }
  }
  if (columns == null) {
    columns=new DataSetViewData[]{};
    updateModel(dataSet,columns);
    htColumns.put(dataSet,columns);
  }
  return columns;
}

Fixed version (ground truth):
/** 
 * @param dataSet
 * @param refresh
 * @param useColumnHints Only applicable if the list is refreshed.
 * @return
 */
public DataSetViewData[] getColumns(DataSetHandle dataSet,boolean refresh,boolean useColumnHints,boolean suppressErrorMessage){
  if (dataSet == null) {
    return new DataSetViewData[0];
  }
  DataSetViewData[] columns=(DataSetViewData[])htColumns.get(dataSet);
  if (!refresh && columns == null) {
    columns=getCachedColumns(dataSet);
  }
  if (columns == null || refresh) {
    columns=null;
    try {
      DataSessionContext context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,dataSet.getModuleHandle());
      DataRequestSession session=DataRequestSession.newSession(context);
      boolean canExecute=true;
      if (dataSet instanceof OdaDataSetHandle) {
        String queryTxt=((OdaDataSetHandle)dataSet).getQueryText();
        canExecute=(queryTxt != null && queryTxt.trim().length() > 0);
      }
      if (canExecute) {
        IQueryResults results=execute(dataSet,useColumnHints,true,1,session);
        if (results != null) {
          results.close();
        }
        columns=(DataSetViewData[])htColumns.get(dataSet);
      }
      session.shutdown();
    }
 catch (    BirtException e) {
      if (!suppressErrorMessage) {
        ExceptionHandler.handle(e);
      }
    }
  }
  if (columns == null) {
    columns=new DataSetViewData[]{};
    updateModel(dataSet,columns);
    htColumns.put(dataSet,columns);
  }
  return columns;
}
Program: 75814
Project: 75814
Buggy source:
/** 
 * populate all output columns in viewer display. The output columns is retrieved from oda dataset handles's RESULT_SET_PROP and COMPUTED_COLUMNS_PROP.
 * @throws BirtException
 */
public DataSetViewData[] populateAllOutputColumns(DataSetHandle dataSetHandle) throws BirtException {
  DataSessionContext context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,dataSetHandle.getModuleHandle());
  DataRequestSession session=DataRequestSession.newSession(context);
  IResultMetaData metaData=session.getDataSetMetaData(dataSetHandle,false);
  DataSetViewData[] items=new DataSetViewData[metaData.getColumnCount()];
  for (int i=0; i < metaData.getColumnCount(); i++) {
    items[i]=new DataSetViewData();
    items[i].setName(metaData.getColumnName(i + 1));
    items[i].setDataTypeName(metaData.getColumnTypeName(i + 1));
    items[i].setAlias(metaData.getColumnAlias(i + 1));
    items[i].setComputedColumn(metaData.isComputedColumn(i + 1));
    items[i].setPosition(i + 1);
    items[i].setDataType(metaData.getColumnType(i + 1));
  }
  updateModel(dataSetHandle,items);
  return items;
}

Fixed version (ground truth):
/** 
 * populate all output columns in viewer display. The output columns is retrieved from oda dataset handles's RESULT_SET_PROP and COMPUTED_COLUMNS_PROP.
 * @throws BirtException
 */
public DataSetViewData[] populateAllOutputColumns(DataSetHandle dataSetHandle,DataRequestSession session) throws BirtException {
  IResultMetaData metaData=session.getDataSetMetaData(dataSetHandle,false);
  DataSetViewData[] items=new DataSetViewData[metaData.getColumnCount()];
  for (int i=0; i < metaData.getColumnCount(); i++) {
    items[i]=new DataSetViewData();
    items[i].setName(metaData.getColumnName(i + 1));
    items[i].setDataTypeName(metaData.getColumnTypeName(i + 1));
    items[i].setAlias(metaData.getColumnAlias(i + 1));
    items[i].setComputedColumn(metaData.isComputedColumn(i + 1));
    items[i].setPosition(i + 1);
    items[i].setDataType(metaData.getColumnType(i + 1));
  }
  updateModel(dataSetHandle,items);
  return items;
}
Program: 75815
Project: 75815
Buggy source:
/** 
 * @throws IOException
 */
public void testGetContent() throws IOException {
  byte[] b=new byte[12345];
  Arrays.fill(b,(byte)3);
  DummyOutputStream stream=new DummyOutputStream();
  stream.write(b);
  assertEquals(b.length,stream.toByteArray().length);
  assertTrue(Arrays.equals(b,stream.toByteArray()));
}

Fixed version (ground truth):
/** 
 * @throws IOException
 */
public void testGetContent() throws IOException {
  byte[] b=new byte[12345];
  Arrays.fill(b,(byte)3);
  DummyOutputStream stream=new DummyOutputStream(null,null,0);
  stream.write(b);
  assertEquals(b.length,stream.toByteArray().length);
  assertTrue(Arrays.equals(b,stream.toByteArray()));
}
Program: 75816
Project: 75816
Buggy source:
public void saveFinish(int currIndex) throws DataException {
  if (rowSaveUtil == null)   this.initSaveRowUtil();
  exprNameSet=rowSaveUtil.getExprNameSet();
  rowSaveUtil.saveFinish(currIndex);
  this.closeSaveRowUtil();
  this.saveForIV();
  this.streamManager.saveToReportDocument();
}

Fixed version (ground truth):
public void saveFinish(int currIndex) throws DataException {
  if (rowSaveUtil == null)   this.initSaveRowUtil();
  exprNameSet=rowSaveUtil.getExprNameSet();
  rowSaveUtil.saveFinish(currIndex);
  this.closeSaveRowUtil();
  this.saveForIV();
}
Program: 75817
Project: 75817
Buggy source:
public void saveFinish(int currIndex) throws DataException {
  this.saveUtilHelper.saveChildQueryID();
  this.streamManager.saveToReportDocument();
}

Fixed version (ground truth):
public void saveFinish(int currIndex) throws DataException {
  this.saveUtilHelper.saveChildQueryID();
}
Program: 75818
Project: 75818
Buggy source:
DummyOutputStream(){
  this.cachedByteArray=new ArrayList();
  this.currentArray=new byte[BUFF_SIZE];
  this.cachedByteArray.add(this.currentArray);
  this.nextArrayIndex=0;
  this.currentListIndex=0;
}

Fixed version (ground truth):
DummyOutputStream(DataEngineContext context,StreamID id,int type){
  this.cachedByteArray=new ArrayList();
  this.currentArray=new byte[BUFF_SIZE];
  this.cachedByteArray.add(this.currentArray);
  this.nextArrayIndex=0;
  this.currentListIndex=0;
  this.context=context;
  this.id=id;
  this.type=type;
}
Program: 75819
Project: 75819
Buggy source:
/** 
 * @param streamType
 * @return
 */
private boolean useTempStream(int streamType){
  if (this.version < VersionManager.VERSION_2_2)   return false;
switch (streamType) {
case DataEngineContext.DATASET_DATA_STREAM:
    return false;
case DataEngineContext.DATASET_META_STREAM:
  return false;
case DataEngineContext.EXPR_VALUE_STREAM:
return false;
case DataEngineContext.EXPR_ROWLEN_STREAM:
return true;
case DataEngineContext.EXPR_META_STREAM:
return true;
case DataEngineContext.GROUP_INFO_STREAM:
return true;
case DataEngineContext.SUBQUERY_INFO_STREAM:
return false;
case DataEngineContext.QUERY_DEFN_STREAM:
return true;
case DataEngineContext.ORIGINAL_QUERY_DEFN_STREAM:
return false;
case DataEngineContext.ROW_INDEX_STREAM:
return true;
case DataEngineContext.QUERYID_INFO_STREAM:
return true;
case DataEngineContext.SUBQUERY_PARENTINDEX_STREAM:
return true;
case DataEngineContext.META_STREAM:
return false;
case DataEngineContext.META_INDEX_STREAM:
return false;
default :
return false;
}
}

Fixed version (ground truth):
/** 
 * @param streamType
 * @return
 */
private boolean useTempStream(int streamType){
  if (this.version < VersionManager.VERSION_2_2)   return false;
switch (streamType) {
case DataEngineContext.DATASET_DATA_STREAM:
    return false;
case DataEngineContext.DATASET_META_STREAM:
  return false;
case DataEngineContext.EXPR_VALUE_STREAM:
return false;
case DataEngineContext.EXPR_ROWLEN_STREAM:
return this.version < VersionManager.VERSION_2_2_0;
case DataEngineContext.EXPR_META_STREAM:
return true;
case DataEngineContext.GROUP_INFO_STREAM:
return true;
case DataEngineContext.SUBQUERY_INFO_STREAM:
return false;
case DataEngineContext.QUERY_DEFN_STREAM:
return true;
case DataEngineContext.ORIGINAL_QUERY_DEFN_STREAM:
return false;
case DataEngineContext.ROW_INDEX_STREAM:
return true;
case DataEngineContext.QUERYID_INFO_STREAM:
return true;
case DataEngineContext.SUBQUERY_PARENTINDEX_STREAM:
return true;
case DataEngineContext.META_STREAM:
return false;
case DataEngineContext.META_INDEX_STREAM:
return false;
default :
return false;
}
}
Program: 75820
Project: 75820
Buggy source:
/** 
 * @return
 */
int getVersion(){
  int version=VERSION_2_2_1;
  if (dataEngineContext.hasInStream(null,null,DataEngineContext.VERSION_INFO_STREAM) == false) {
    version=VERSION_2_0;
    return version;
  }
  try {
    DataInputStream is=new DataInputStream(dataEngineContext.getInputStream(null,null,DataEngineContext.VERSION_INFO_STREAM));
    version=IOUtil.readInt(is);
  }
 catch (  DataException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return version;
}

Fixed version (ground truth):
/** 
 * @return
 */
int getVersion(){
  int version=this.getLatestVersion();
  if (dataEngineContext.hasInStream(null,null,DataEngineContext.VERSION_INFO_STREAM) == false) {
    version=VERSION_2_0;
    return version;
  }
  try {
    DataInputStream is=new DataInputStream(dataEngineContext.getInputStream(null,null,DataEngineContext.VERSION_INFO_STREAM));
    version=IOUtil.readInt(is);
  }
 catch (  DataException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return version;
}