nus-yam/ex-repair huggingface dataset:
Program: 74640
Project: 74640
Buggy source:
/** 
 * @param queryDefn
 * @param paramBindingIt
 * @param filterIt
 * @param bindingIt
 * @throws AdapterException 
 */
private void populateQueryDefn(QueryDefinition queryDefn,Iterator paramBindingIt,Iterator filterIt,Iterator bindingIt) throws AdapterException {
  try {
    while (bindingIt != null && bindingIt.hasNext()) {
      IComputedColumn column=this.modelAdaptor.adaptComputedColumn((ComputedColumnHandle)bindingIt.next());
      IBinding binding=new Binding(column.getName(),(ScriptExpression)column.getExpression());
      binding.setDataType(column.getDataType());
      queryDefn.addBinding(binding);
    }
    List parameterBindings=convertParamterBindings(paramBindingIt);
    if (parameterBindings != null)     queryDefn.getInputParamBindings().addAll(parameterBindings);
    List filters=convertFilters(filterIt);
    if (filters != null)     queryDefn.getFilters().addAll(filters);
  }
 catch (  DataException e) {
    throw new AdapterException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
/** 
 * @param queryDefn
 * @param paramBindingIt
 * @param filterIt
 * @param bindingIt
 * @throws AdapterException 
 */
private void populateQueryDefn(IQueryDefinition queryDefn,Iterator paramBindingIt,Iterator filterIt,Iterator bindingIt) throws AdapterException {
  try {
    while (bindingIt != null && bindingIt.hasNext()) {
      IComputedColumn column=this.modelAdaptor.adaptComputedColumn((ComputedColumnHandle)bindingIt.next());
      IBinding binding=new Binding(column.getName(),(ScriptExpression)column.getExpression());
      binding.setDataType(column.getDataType());
      queryDefn.addBinding(binding);
    }
    List parameterBindings=convertParamterBindings(paramBindingIt);
    if (parameterBindings != null)     queryDefn.getInputParamBindings().addAll(parameterBindings);
    List filters=convertFilters(filterIt);
    if (filters != null)     queryDefn.getFilters().addAll(filters);
  }
 catch (  DataException e) {
    throw new AdapterException(e.getLocalizedMessage());
  }
}
Program: 74641
Project: 74641
Buggy source:
/** 
 * @param queryDefn
 * @param paramBindingIt
 * @param filterIt
 * @param bindingIt
 * @return
 * @throws BirtException
 */
IQueryResults executeQuery(QueryDefinition queryDefn,Iterator paramBindingIt,Iterator filterIt,Iterator bindingIt) throws BirtException {
  defineDataSourceDataSet(queryDefn);
  populateQueryDefn(queryDefn,paramBindingIt,filterIt,bindingIt);
  return dataEngine.prepare(queryDefn,sessionContext.getAppContext()).execute(null);
}

Fixed version (ground truth):
/** 
 * @param queryDefn
 * @param paramBindingIt
 * @param filterIt
 * @param bindingIt
 * @return
 * @throws BirtException
 */
IQueryResults executeQuery(IQueryDefinition queryDefn,Iterator paramBindingIt,Iterator filterIt,Iterator bindingIt) throws BirtException {
  defineDataSourceDataSet(queryDefn);
  populateQueryDefn(queryDefn,paramBindingIt,filterIt,bindingIt);
  return dataEngine.prepare(queryDefn,sessionContext.getAppContext()).execute(null);
}
Program: 74642
Project: 74642
Buggy source:
/** 
 * Found drivers in the Jar file List
 * @param file
 * @return a List of JDBCDriverInformation
 */
public static void getJdbcDriverFromFile(List fileList){
  if (!failLoadFileList.isEmpty()) {
    fileList.addAll(failLoadFileList);
  }
  URLClassLoader urlClassLoader=createClassLoader(fileList);
  jdbcDriverInfos.addAll(getJDBCDriverInfoList(fileList,urlClassLoader));
}

Fixed version (ground truth):
/** 
 * Found drivers in the Jar file List
 * @param file
 * @return a List of JDBCDriverInformation
 */
public static void getJdbcDriverFromFile(List fileList){
  if (!failLoadFileList.isEmpty()) {
    for (int i=0; i < failLoadFileList.size(); i++) {
      if (!fileList.contains(failLoadFileList.get(i))) {
        fileList.add(failLoadFileList.get(i));
      }
    }
  }
  URLClassLoader urlClassLoader=createClassLoader(fileList);
  jdbcDriverInfos.addAll(getJDBCDriverInfoList(fileList,urlClassLoader));
}
Program: 74643
Project: 74643
Buggy source:
public void testAdd(){
}

Fixed version (ground truth):
public void testAdd(){
  String script1="String_Node_Str";
  String script2="String_Node_Str";
  String script3="String_Node_Str";
  assertEquals(((Number)cx.evaluateString(scope,script1,"String_Node_Str",1,null)).doubleValue(),1,0);
  assertEquals(((Number)cx.evaluateString(scope,script2,"String_Node_Str",1,null)).doubleValue(),1,0);
  assertEquals(((Number)cx.evaluateString(scope,script3,"String_Node_Str",1,null)).doubleValue(),2,0);
}
Program: 74645
Project: 74645
Buggy source:
/** 
 * Get resourceBundle based on given locale
 * @return
 */
private static ResourceBundle getResourceBundle(){
  if (resourceBundle == null) {
synchronized (Thread.currentThread()) {
      if (resourceBundle != null)       return resourceBundle;
      if (currentLocale != null)       resourceBundle=DataResourceHandle.getInstance(currentLocale).getUResourceBundle();
 else       resourceBundle=DataResourceHandle.getInstance().getUResourceBundle();
    }
  }
  return resourceBundle;
}

Fixed version (ground truth):
/** 
 * Get resourceBundle based on given locale
 * @return
 */
private static ResourceBundle getResourceBundle(){
  if (resourceBundle == null) {
synchronized (DataException.class) {
      if (resourceBundle != null)       return resourceBundle;
      if (currentLocale != null)       resourceBundle=DataResourceHandle.getInstance(currentLocale).getUResourceBundle();
 else       resourceBundle=DataResourceHandle.getInstance().getUResourceBundle();
    }
  }
  return resourceBundle;
}
Program: 74646
Project: 74646
Buggy source:
/** 
 * Set the locale info
 * @param locale
 */
public static void setLocale(ULocale locale){
  currentLocale=locale;
  if (resourceBundle != null) {
synchronized (Thread.currentThread()) {
      if (resourceBundle == null)       return;
      if ((locale == null && !ULocale.getDefault().toLocale().equals(resourceBundle.getLocale())) || (locale != null && !locale.toLocale().equals(resourceBundle.getLocale()))) {
        resourceBundle=null;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Set the locale info
 * @param locale
 */
public static void setLocale(ULocale locale){
  currentLocale=locale;
  if (resourceBundle != null) {
synchronized (DataException.class) {
      if (resourceBundle == null)       return;
      if ((locale == null && !ULocale.getDefault().toLocale().equals(resourceBundle.getLocale())) || (locale != null && !locale.toLocale().equals(resourceBundle.getLocale()))) {
        resourceBundle=null;
      }
    }
  }
}
Program: 74647
Project: 74647
Buggy source:
/** 
 * populate all available value in selectValueList
 */
private void populateList(){
  try {
    getOkButton().setEnabled(false);
    selectValueList.removeAll();
    viewerValueList.clear();
    if (modelValueList != null) {
      Iterator iter=modelValueList.iterator();
      while (iter.hasNext()) {
        Object candiateValue=iter.next();
        if (candiateValue != null) {
          Object displayCandiateValue;
          if (candiateValue instanceof Date && !(candiateValue instanceof java.sql.Date || candiateValue instanceof java.sql.Time)) {
            DateFormatter formatter=new DateFormatter(ULocale.US);
            formatter.applyPattern("String_Node_Str");
            displayCandiateValue=formatter.format((Date)candiateValue);
          }
 else           displayCandiateValue=candiateValue;
          viewerValueList.add(displayCandiateValue.toString());
          selectValueList.add(displayCandiateValue.toString());
        }
      }
    }
 else {
      selectValueList.removeAll();
      modelValueList.clear();
      viewerValueList.clear();
      ExceptionHandler.openErrorMessageBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    }
    if (selectValueList.getItemCount() > 0) {
      selectValueList.select(0);
      getOkButton().setEnabled(true);
    }
  }
 catch (  Exception e) {
    ExceptionHandler.handle(e);
  }
}

Fixed version (ground truth):
/** 
 * populate all available value in selectValueList
 */
private void populateList(){
  try {
    getOkButton().setEnabled(false);
    selectValueList.removeAll();
    viewerValueList.clear();
    if (modelValueList != null) {
      Iterator iter=modelValueList.iterator();
      DateFormatter formatter=new DateFormatter(ULocale.US);
      while (iter.hasNext()) {
        Object candiateValue=iter.next();
        if (candiateValue != null) {
          Object displayCandiateValue;
          if (candiateValue instanceof java.sql.Date) {
            formatter.applyPattern("String_Node_Str");
            displayCandiateValue=formatter.format((Date)candiateValue);
          }
 else           if (candiateValue instanceof java.sql.Time) {
            formatter.applyPattern("String_Node_Str");
            displayCandiateValue=formatter.format((Date)candiateValue);
          }
 else           if (candiateValue instanceof Date) {
            formatter.applyPattern("String_Node_Str");
            displayCandiateValue=formatter.format((Date)candiateValue);
          }
 else           displayCandiateValue=candiateValue;
          viewerValueList.add(displayCandiateValue.toString());
          selectValueList.add(displayCandiateValue.toString());
        }
      }
    }
 else {
      selectValueList.removeAll();
      modelValueList.clear();
      viewerValueList.clear();
      ExceptionHandler.openErrorMessageBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    }
    if (selectValueList.getItemCount() > 0) {
      selectValueList.select(0);
      getOkButton().setEnabled(true);
    }
  }
 catch (  Exception e) {
    ExceptionHandler.handle(e);
  }
}
Program: 74648
Project: 74648
Buggy source:
/** 
 * @param date
 * @return
 */
private static java.sql.Date toSqlDate(Date date){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(date.getTime());
  calendar.set(Calendar.HOUR_OF_DAY,0);
  calendar.set(Calendar.MINUTE,0);
  calendar.set(Calendar.SECOND,0);
  return new java.sql.Date(calendar.getTimeInMillis());
}

Fixed version (ground truth):
/** 
 * @param date
 * @return
 */
private static java.sql.Date toSqlDate(Date date){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(date.getTime());
  calendar.set(Calendar.HOUR_OF_DAY,0);
  calendar.set(Calendar.MINUTE,0);
  calendar.set(Calendar.SECOND,0);
  calendar.set(Calendar.MILLISECOND,0);
  return new java.sql.Date(calendar.getTimeInMillis());
}
Program: 74649
Project: 74649
Buggy source:
/** 
 * @param date
 * @return
 */
private static java.sql.Time toSqlTime(Date date){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(date.getTime());
  calendar.set(Calendar.YEAR,1970);
  calendar.set(Calendar.MONTH,0);
  calendar.set(Calendar.DAY_OF_MONTH,1);
  return new java.sql.Time(calendar.getTimeInMillis());
}

Fixed version (ground truth):
/** 
 * @param date
 * @return
 */
private static java.sql.Time toSqlTime(Date date){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(date.getTime());
  calendar.set(Calendar.YEAR,1970);
  calendar.set(Calendar.MONTH,0);
  calendar.set(Calendar.DAY_OF_MONTH,1);
  calendar.set(Calendar.MILLISECOND,0);
  return new java.sql.Time(calendar.getTimeInMillis());
}
Program: 74651
Project: 74651
Buggy source:
/** 
 * Get resourceBundle based on given locale
 * @return
 */
private static ResourceBundle getResourceBundle(){
  if (resourceBundle == null) {
    if (currentLocale != null)     resourceBundle=DataResourceHandle.getInstance(currentLocale).getUResourceBundle();
 else     resourceBundle=DataResourceHandle.getInstance().getUResourceBundle();
  }
  return resourceBundle;
}

Fixed version (ground truth):
/** 
 * Get resourceBundle based on given locale
 * @return
 */
private static ResourceBundle getResourceBundle(){
  if (resourceBundle == null) {
synchronized (resourceBundle) {
      if (resourceBundle != null)       return resourceBundle;
      if (currentLocale != null)       resourceBundle=DataResourceHandle.getInstance(currentLocale).getUResourceBundle();
 else       resourceBundle=DataResourceHandle.getInstance().getUResourceBundle();
    }
  }
  return resourceBundle;
}
Program: 74652
Project: 74652
Buggy source:
/** 
 * Set the locale info
 * @param locale
 */
public static void setLocale(ULocale locale){
  currentLocale=locale;
  if (resourceBundle != null) {
    if ((locale == null && !ULocale.getDefault().toLocale().equals(resourceBundle.getLocale())) || (locale != null && !locale.toLocale().equals(resourceBundle.getLocale()))) {
      resourceBundle=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Set the locale info
 * @param locale
 */
public static void setLocale(ULocale locale){
  currentLocale=locale;
  if (resourceBundle != null) {
synchronized (resourceBundle) {
      if (resourceBundle == null)       return;
      if ((locale == null && !ULocale.getDefault().toLocale().equals(resourceBundle.getLocale())) || (locale != null && !locale.toLocale().equals(resourceBundle.getLocale()))) {
        resourceBundle=null;
      }
    }
  }
}
Program: 74654
Project: 74654
Buggy source:
/** 
 * @param rowCount
 * @param rowExprsOs
 * @param rowLenOs
 */
RowSaveUtil(int rowCount,OutputStream rowExprsOs,OutputStream rowLenOs,Set exprNameSet,Map directColumnReferenceExpr,int version){
  this.rowCount=rowCount;
  this.rowExprsDos=new DataOutputStream(rowExprsOs);
  this.rowLenDos=new DataOutputStream(rowLenOs);
  this.lastRowIndex=-1;
  this.exprNameSet=exprNameSet;
  this.directColumnReferenceBinding=directColumnReferenceExpr;
  this.version=version;
}

Fixed version (ground truth):
/** 
 * @param rowCount
 * @param rowExprsOs
 * @param rowLenOs
 */
RowSaveUtil(int rowCount,OutputStream rowExprsOs,OutputStream rowLenOs,Set exprNameSet,Map directColumnReferenceExpr,Map bindingNameType,int version){
  this.rowCount=rowCount;
  this.rowExprsDos=new DataOutputStream(rowExprsOs);
  this.rowLenDos=new DataOutputStream(rowLenOs);
  this.lastRowIndex=-1;
  this.exprNameSet=exprNameSet;
  this.directColumnReferenceBinding=directColumnReferenceExpr;
  this.bindingNameType=bindingNameType;
  this.version=version;
}
Program: 74655
Project: 74655
Buggy source:
/** 
 * @param rowExprsRAIs
 * @param rowLenRAIs
 * @param version
 */
ExprDataReader1(RAInputStream rowExprsRAIs,RAInputStream rowLenRAIs,int version,DataSetResultSet dataSetData) throws DataException {
  this.INT_LENGTH=IOUtil.INT_LENGTH;
  try {
    this.rowCount=IOUtil.readInt(rowExprsRAIs);
    int exprCount=IOUtil.readInt(rowExprsRAIs);
    this.exprKeys=new ArrayList();
    this.dataSetExprKeys=new HashMap();
    this.rowExprsDis=new DataInputStream(rowExprsRAIs);
    for (int i=0; i < exprCount; i++) {
      this.exprKeys.add(IOUtil.readString(this.rowExprsDis));
    }
    if (version >= VersionManager.VERSION_2_2_1_3) {
      int dataSetColumnExprCount=IOUtil.readInt(this.rowExprsDis);
      for (int i=0; i < dataSetColumnExprCount; i++) {
        this.dataSetExprKeys.put(IOUtil.readObject(this.rowExprsDis),IOUtil.readObject(this.rowExprsDis));
      }
    }
    this.metaOffset=INT_LENGTH + IOUtil.readInt(this.rowExprsDis) + INT_LENGTH;
    this.dataSetData=dataSetData;
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
  this.rowExprsRAIs=rowExprsRAIs;
  this.rowLenRAIs=rowLenRAIs;
  this.rowLenDis=new DataInputStream(rowLenRAIs);
  this.version=version;
  this.currReadIndex=0;
  this.currRowIndex=-1;
}

Fixed version (ground truth):
/** 
 * @param rowExprsRAIs
 * @param rowLenRAIs
 * @param version
 */
ExprDataReader1(RAInputStream rowExprsRAIs,RAInputStream rowLenRAIs,int version,DataSetResultSet dataSetData) throws DataException {
  this.INT_LENGTH=IOUtil.INT_LENGTH;
  try {
    this.rowCount=IOUtil.readInt(rowExprsRAIs);
    int exprCount=IOUtil.readInt(rowExprsRAIs);
    this.exprKeys=new ArrayList();
    this.dataSetExprKeys=new HashMap();
    this.rowExprsDis=new DataInputStream(rowExprsRAIs);
    this.bindingNameTypeMap=new HashMap();
    for (int i=0; i < exprCount; i++) {
      String key=IOUtil.readString(this.rowExprsDis);
      this.exprKeys.add(key);
      if (version >= VersionManager.VERSION_2_2_1_3) {
        this.bindingNameTypeMap.put(key,new Integer(IOUtil.readInt(this.rowExprsDis)));
      }
    }
    if (version >= VersionManager.VERSION_2_2_1_3) {
      int dataSetColumnExprCount=IOUtil.readInt(this.rowExprsDis);
      for (int i=0; i < dataSetColumnExprCount; i++) {
        String key=IOUtil.readObject(this.rowExprsDis).toString();
        this.dataSetExprKeys.put(key,IOUtil.readObject(this.rowExprsDis));
        this.bindingNameTypeMap.put(key,new Integer(IOUtil.readInt(this.rowExprsDis)));
      }
    }
    this.metaOffset=INT_LENGTH + IOUtil.readInt(this.rowExprsDis) + INT_LENGTH;
    this.dataSetData=dataSetData;
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
  this.rowExprsRAIs=rowExprsRAIs;
  this.rowLenRAIs=rowLenRAIs;
  this.rowLenDis=new DataInputStream(rowLenRAIs);
  this.version=version;
  this.currReadIndex=0;
  this.currRowIndex=-1;
}
Program: 74656
Project: 74656
Buggy source:
/** 
 * @throws IOException
 * @throws DataException 
 */
private Map getValueMap() throws IOException, DataException {
  Map valueMap=new HashMap();
  int exprCount=IOUtil.readInt(rowExprsDis);
  for (int i=0; i < exprCount; i++) {
    String exprID=this.exprKeys.get(i).toString();
    Object exprValue=IOUtil.readObject(rowExprsDis);
    if (RowSaveUtil.EXCEPTION_INDICATOR.equals(exprValue))     continue;
    valueMap.put(exprID,exprValue);
  }
  java.util.Iterator it=this.dataSetExprKeys.keySet().iterator();
  while (it.hasNext()) {
    String key=it.next().toString();
    String value=(String)this.dataSetExprKeys.get(key);
    valueMap.put(key,this.dataSetData.getResultObject().getFieldValue(value));
  }
  return valueMap;
}

Fixed version (ground truth):
/** 
 * @throws IOException
 * @throws DataException 
 */
private Map getValueMap() throws IOException, DataException {
  Map valueMap=new HashMap();
  int exprCount=IOUtil.readInt(rowExprsDis);
  for (int i=0; i < exprCount; i++) {
    String exprID=this.exprKeys.get(i).toString();
    Object exprValue=IOUtil.readObject(rowExprsDis);
    if (RowSaveUtil.EXCEPTION_INDICATOR.equals(exprValue))     continue;
    valueMap.put(exprID,exprValue);
  }
  java.util.Iterator it=this.dataSetExprKeys.keySet().iterator();
  while (it.hasNext()) {
    String key=it.next().toString();
    String value=(String)this.dataSetExprKeys.get(key);
    IResultObject o=this.dataSetData.getResultObject();
    try {
      valueMap.put(key,o == null ? null : DataTypeUtil.convert(o.getFieldValue(value),((Integer)this.bindingNameTypeMap.get(key)).intValue()));
    }
 catch (    BirtException e) {
      e.printStackTrace();
    }
  }
  return valueMap;
}
Program: 74657
Project: 74657
Buggy source:
/** 
 * @param rowExprsIs
 * @param rowLenIs
 * @throws DataException
 */
private void initialize(RAInputStream rowExprsIs,RAInputStream rowLenIs,int rowCount,DataSetResultSet dataSetResultSet) throws DataException {
  try {
    IOUtil.readInt(rowExprsIs);
    int exprCount=IOUtil.readInt(rowExprsIs);
    this.exprKeys=new ArrayList();
    this.dataSetExprKeys=new HashMap();
    this.dataSetResultSet=dataSetResultSet;
    this.rowExprsDis=new DataInputStream(rowExprsIs);
    this.rowLenDis=new DataInputStream(rowLenIs);
    for (int i=0; i < exprCount; i++) {
      this.exprKeys.add(IOUtil.readString(this.rowExprsDis));
    }
    if (version >= VersionManager.VERSION_2_2_1_3) {
      int dataSetColumnExprCount=IOUtil.readInt(this.rowExprsDis);
      for (int i=0; i < dataSetColumnExprCount; i++) {
        this.dataSetExprKeys.put(IOUtil.readObject(this.rowExprsDis),IOUtil.readObject(this.rowExprsDis));
      }
    }
    this.metaOffset=IOUtil.INT_LENGTH + IOUtil.readInt(this.rowExprsDis) + IOUtil.INT_LENGTH;
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
  this.rowExprsIs=rowExprsIs;
  this.rowLenIs=rowLenIs;
  this.currRowIndex=-1;
  this.lastRowIndex=-1;
  this.currRowLenReadIndex=0;
  this.rowCount=rowCount;
  this.rowIDMap=new BasicCachedArray(rowCount);
}

Fixed version (ground truth):
/** 
 * @param rowExprsIs
 * @param rowLenIs
 * @throws DataException
 */
private void initialize(RAInputStream rowExprsIs,RAInputStream rowLenIs,int rowCount,DataSetResultSet dataSetResultSet) throws DataException {
  try {
    IOUtil.readInt(rowExprsIs);
    int exprCount=IOUtil.readInt(rowExprsIs);
    this.exprKeys=new ArrayList();
    this.dataSetExprKeys=new HashMap();
    this.dataSetResultSet=dataSetResultSet;
    this.rowExprsDis=new DataInputStream(rowExprsIs);
    this.rowLenDis=new DataInputStream(rowLenIs);
    this.bindingNameTypeMap=new HashMap();
    for (int i=0; i < exprCount; i++) {
      String key=IOUtil.readString(this.rowExprsDis);
      this.exprKeys.add(key);
      if (version >= VersionManager.VERSION_2_2_1_3) {
        this.bindingNameTypeMap.put(key,new Integer(IOUtil.readInt(this.rowExprsDis)));
      }
    }
    if (version >= VersionManager.VERSION_2_2_1_3) {
      int dataSetColumnExprCount=IOUtil.readInt(this.rowExprsDis);
      for (int i=0; i < dataSetColumnExprCount; i++) {
        String key=IOUtil.readObject(this.rowExprsDis).toString();
        this.dataSetExprKeys.put(key,IOUtil.readObject(this.rowExprsDis));
        this.bindingNameTypeMap.put(key,new Integer(IOUtil.readInt(this.rowExprsDis)));
      }
    }
    this.metaOffset=IOUtil.INT_LENGTH + IOUtil.readInt(this.rowExprsDis) + IOUtil.INT_LENGTH;
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
  this.rowExprsIs=rowExprsIs;
  this.rowLenIs=rowLenIs;
  this.currRowIndex=-1;
  this.lastRowIndex=-1;
  this.currRowLenReadIndex=0;
  this.rowCount=rowCount;
  this.rowIDMap=new BasicCachedArray(rowCount);
}
Program: 74658
Project: 74658
Buggy source:
/** 
 * @throws IOException
 * @throws DataException 
 */
private Map getValueMap() throws IOException, DataException {
  Map valueMap=new HashMap();
  int exprCount=IOUtil.readInt(rowExprsDis);
  for (int i=0; i < exprCount; i++) {
    String exprID=this.exprKeys.get(i).toString();
    Object exprValue=IOUtil.readObject(rowExprsDis);
    if (RowSaveUtil.EXCEPTION_INDICATOR.equals(exprValue))     exprValue=null;
    valueMap.put(exprID,exprValue);
  }
  java.util.Iterator it=this.dataSetExprKeys.keySet().iterator();
  while (it.hasNext()) {
    String key=it.next().toString();
    String value=(String)this.dataSetExprKeys.get(key);
    valueMap.put(key,this.dataSetResultSet.getResultObject().getFieldValue(value));
  }
  return valueMap;
}

Fixed version (ground truth):
/** 
 * @throws IOException
 * @throws DataException 
 */
private Map getValueMap() throws IOException, DataException {
  Map valueMap=new HashMap();
  int exprCount=IOUtil.readInt(rowExprsDis);
  for (int i=0; i < exprCount; i++) {
    String exprID=this.exprKeys.get(i).toString();
    Object exprValue=IOUtil.readObject(rowExprsDis);
    if (RowSaveUtil.EXCEPTION_INDICATOR.equals(exprValue))     exprValue=null;
    valueMap.put(exprID,exprValue);
  }
  java.util.Iterator it=this.dataSetExprKeys.keySet().iterator();
  while (it.hasNext()) {
    String key=it.next().toString();
    String value=(String)this.dataSetExprKeys.get(key);
    IResultObject o=this.dataSetResultSet.getResultObject();
    try {
      valueMap.put(key,o == null ? null : DataTypeUtil.convert(o.getFieldValue(value),((Integer)this.bindingNameTypeMap.get(key)).intValue()));
    }
 catch (    BirtException e) {
      e.printStackTrace();
    }
  }
  return valueMap;
}
Program: 74660
Project: 74660
Buggy source:
/** 
 * Drops a content element at the given position from the slot, and unresolve any reference property which refers the element to drop.
 * @param posn the position of the content to drop
 * @throws SemanticException if the position is out of range
 */
public void drop(int posn) throws SemanticException {
  DesignElement content=getElement().getSlot(slotID).getContent(posn);
  ContentCommand cmd=new ContentCommand(getModule(),new ContainerContext(getElement(),slotID));
  cmd.remove(content,true);
}

Fixed version (ground truth):
/** 
 * Drops a content element at the given position from the slot, and unresolve any reference property which refers the element to drop.
 * @param posn the position of the content to drop
 * @throws SemanticException if the position is out of range
 */
public void drop(int posn) throws SemanticException {
  DesignElement content=getElement().getSlot(slotID).getContent(posn);
  ContentCommand cmd=new ContentCommand(getModule(),new ContainerContext(getElement(),slotID),false,true);
  cmd.remove(content);
}
Program: 74661
Project: 74661
Buggy source:
/** 
 * Drops a content element at the given position from the slot, and clear any reference property which refers the element to drop.
 * @param posn the position of the content to drop
 * @throws SemanticException if the position is out of range
 */
public void dropAndClear(int posn) throws SemanticException {
  DesignElement content=getElement().getSlot(slotID).getContent(posn);
  ContentCommand cmd=new ContentCommand(getModule(),new ContainerContext(getElement(),slotID));
  cmd.remove(content,false);
}

Fixed version (ground truth):
/** 
 * Drops a content element at the given position from the slot, and clear any reference property which refers the element to drop.
 * @param posn the position of the content to drop
 * @throws SemanticException if the position is out of range
 */
public void dropAndClear(int posn) throws SemanticException {
  DesignElement content=getElement().getSlot(slotID).getContent(posn);
  ContentCommand cmd=new ContentCommand(getModule(),new ContainerContext(getElement(),slotID));
  cmd.remove(content);
}
Program: 74662
Project: 74662
Buggy source:
/** 
 * Does some actions when the content is removed from the design tree.
 * @param content the content to remove
 * @param unresolveReference status whether to un-resolve the references
 * @throws SemanticException
 */
protected void doDelectAction(DesignElement content) throws SemanticException {
  ElementDefn metaData=(ElementDefn)content.getDefn();
  if (!metaData.isContainer())   return;
  LevelContentIterator iter=new LevelContentIterator(module,content,1);
  while (iter.hasNext()) {
    DesignElement tmpContent=(DesignElement)iter.next();
    ContentCommand cmd=new ContentCommand(module,tmpContent.getContainerInfo());
    cmd.remove(tmpContent,false,true);
  }
}

Fixed version (ground truth):
/** 
 * Does some actions when the content is removed from the design tree.
 * @param content the content to remove
 * @throws SemanticException
 */
protected void doDelectAction(DesignElement content) throws SemanticException {
  ElementDefn metaData=(ElementDefn)content.getDefn();
  if (!metaData.isContainer())   return;
  LevelContentIterator iter=new LevelContentIterator(module,content,1);
  while (iter.hasNext()) {
    DesignElement tmpContent=(DesignElement)iter.next();
    AbstractContentCommand cmd=null;
    if (this instanceof ContentCommand)     cmd=new ContentCommand(module,tmpContent.getContainerInfo(),true,((ContentCommand)this).unresolveReference);
 else     if (this instanceof ContentElementCommand)     cmd=new ContentElementCommand(module,tmpContent.getContainerInfo());
    if (cmd != null)     cmd.remove(tmpContent);
  }
}
Program: 74663
Project: 74663
Buggy source:
/** 
 * 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 ("String_Node_Str".equals(jsClass)) {
      Object[] obj=new Object[(int)((NativeArray)inputObj).getLength()];
      for (int i=0; i < obj.length; i++) {
        obj[i]=convertJavascriptValue(((NativeArray)inputObj).get(i,null));
      }
      return obj;
    }
  }
 else   if (inputObj instanceof Wrapper) {
    return ((Wrapper)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 Context.toType(inputObj,Date.class);
    }
 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 ("String_Node_Str".equals(jsClass)) {
      Object[] obj=new Object[(int)((NativeArray)inputObj).getLength()];
      for (int i=0; i < obj.length; i++) {
        obj[i]=convertJavascriptValue(((NativeArray)inputObj).get(i,null));
      }
      return obj;
    }
  }
 else   if (inputObj instanceof Wrapper) {
    return ((Wrapper)inputObj).unwrap();
  }
  return inputObj;
}
Program: 74664
Project: 74664
Buggy source:
/** 
 * Get resourceBundle based on given locale
 * @return
 */
private static ResourceBundle getResourceBundle(){
  if (resourceBundle == null) {
synchronized (resourceBundle) {
      if (resourceBundle != null)       return resourceBundle;
      if (currentLocale != null)       resourceBundle=DataResourceHandle.getInstance(currentLocale).getUResourceBundle();
 else       resourceBundle=DataResourceHandle.getInstance().getUResourceBundle();
    }
  }
  return resourceBundle;
}

Fixed version (ground truth):
/** 
 * Get resourceBundle based on given locale
 * @return
 */
private static ResourceBundle getResourceBundle(){
  if (resourceBundle == null) {
synchronized (Thread.currentThread()) {
      if (resourceBundle != null)       return resourceBundle;
      if (currentLocale != null)       resourceBundle=DataResourceHandle.getInstance(currentLocale).getUResourceBundle();
 else       resourceBundle=DataResourceHandle.getInstance().getUResourceBundle();
    }
  }
  return resourceBundle;
}
Program: 74665
Project: 74665
Buggy source:
/** 
 * Set the locale info
 * @param locale
 */
public static void setLocale(ULocale locale){
  currentLocale=locale;
  if (resourceBundle != null) {
synchronized (resourceBundle) {
      if (resourceBundle == null)       return;
      if ((locale == null && !ULocale.getDefault().toLocale().equals(resourceBundle.getLocale())) || (locale != null && !locale.toLocale().equals(resourceBundle.getLocale()))) {
        resourceBundle=null;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Set the locale info
 * @param locale
 */
public static void setLocale(ULocale locale){
  currentLocale=locale;
  if (resourceBundle != null) {
synchronized (Thread.currentThread()) {
      if (resourceBundle == null)       return;
      if ((locale == null && !ULocale.getDefault().toLocale().equals(resourceBundle.getLocale())) || (locale != null && !locale.toLocale().equals(resourceBundle.getLocale()))) {
        resourceBundle=null;
      }
    }
  }
}
Program: 74669
Project: 74669
Buggy source:
public void drawTotalPage(String text,int textX,int textY,int width,int height,TextStyle textInfo){
  if (totalPageTemplate != null) {
    isTotalPage=true;
    drawText(text,textX,textY,width,height,textInfo);
  }
}

Fixed version (ground truth):
public void drawTotalPage(String text,int textX,int textY,int width,int height,TextStyle textInfo){
  if (pageDevice.getPDFTemplate() != null) {
    isTotalPage=true;
    drawText(text,textX,textY,width,height,textInfo);
  }
}
Program: 74670
Project: 74670
Buggy source:
private void createTotalPageTemplate(float x,float y,float width,float height){
  if (totalPageTemplate == null) {
    totalPageTemplate=contentByte.createTemplate(width,height);
  }
  y=transformY(y,height);
  contentByte.saveState();
  contentByte.addTemplate(totalPageTemplate,x,y);
  contentByte.restoreState();
}

Fixed version (ground truth):
private void createTotalPageTemplate(float x,float y,float width,float height){
  if (pageDevice.getPDFTemplate() == null) {
    pageDevice.setPDFTemplate(contentByte.createTemplate(width,height));
  }
  y=transformY(y,height);
  contentByte.saveState();
  contentByte.addTemplate(pageDevice.getPDFTemplate(),x,y);
  contentByte.restoreState();
}
Program: 74672
Project: 74672
Buggy source:
public PDFPage(int pageWidth,int pageHeight,Document document,PdfWriter writer){
  super(pageWidth,pageHeight);
  this.writer=writer;
  try {
    Rectangle pageSize=new Rectangle(this.pageWidth,this.pageHeight);
    document.setPageSize(pageSize);
    if (!document.isOpen())     document.open();
 else     document.newPage();
    this.contentByte=writer.getDirectContent();
    this.cbUnder=writer.getDirectContentUnder();
  }
 catch (  DocumentException de) {
    logger.log(Level.SEVERE,de.getMessage(),de);
  }
}

Fixed version (ground truth):
public PDFPage(int pageWidth,int pageHeight,Document document,PdfWriter writer,PDFPageDevice pageDevice){
  super(pageWidth,pageHeight);
  this.writer=writer;
  this.pageDevice=pageDevice;
  try {
    Rectangle pageSize=new Rectangle(this.pageWidth,this.pageHeight);
    document.setPageSize(pageSize);
    if (!document.isOpen())     document.open();
 else     document.newPage();
    this.contentByte=writer.getDirectContent();
    this.cbUnder=writer.getDirectContentUnder();
  }
 catch (  DocumentException de) {
    logger.log(Level.SEVERE,de.getMessage(),de);
  }
}
Program: 74673
Project: 74673
Buggy source:
public IPage newPage(int width,int height,Color backgroundColor){
  currentPage=new PDFPage(width,height,doc,writer);
  currentPage.drawBackgroundColor(backgroundColor,0,0,width,height);
  return currentPage;
}

Fixed version (ground truth):
public IPage newPage(int width,int height,Color backgroundColor){
  currentPage=new PDFPage(width,height,doc,writer,this);
  currentPage.drawBackgroundColor(backgroundColor,0,0,width,height);
  return currentPage;
}
Program: 74675
Project: 74675
Buggy source:
protected int getRowSpan(IRowContent row,CellArea cell,RowArea rowArea){
  int rowSpan=cell.getRowSpan();
  IContent rowContent=rowArea.getContent();
  if (rowSpan > 1 && (!row.getInstanceID().toUniqueString().equals(rowContent.getInstanceID().toUniqueString()))) {
    return rowSpan - 1;
  }
  return rowSpan;
}

Fixed version (ground truth):
protected int getRowSpan(IRowContent row,CellArea cell,RowArea rowArea){
  int rowSpan=cell.getRowSpan();
  IContent rowContent=rowArea.getContent();
  InstanceID id=row.getInstanceID();
  InstanceID contentId=rowContent.getInstanceID();
  if (id != null && contentId != null) {
    if (rowSpan > 1 && (!id.toUniqueString().equals(contentId.toUniqueString()))) {
      return rowSpan - 1;
    }
    return rowSpan;
  }
 else {
    if (row != rowContent && rowSpan > 1) {
      return rowSpan - 1;
    }
 else {
      return rowSpan;
    }
  }
}
Program: 74678
Project: 74678
Buggy source:
public State(Element element,Map cssStyles,IContent parent,IContent inlineParent,ActionContent action){
  this.element=element;
  this.cssStyles=cssStyles;
  this.parent=parent;
  this.inlineParent=inlineParent;
  this.action=action;
}

Fixed version (ground truth):
public State(Element element,Map cssStyles,IContent inlineParent,ActionContent action){
  this.element=element;
  this.cssStyles=cssStyles;
  this.inlineParent=inlineParent;
  this.action=action;
}
Program: 74679
Project: 74679
Buggy source:
public RowState(Element element,Map cssStyles,IContent parent,IContent inlineParent,ActionContent action){
  super(element,cssStyles,parent,inlineParent,action);
  content=new RowContent((ReportContent)parent.getReportContent());
  HTML2Content.handleStyle(element,cssStyles,content);
  content.setHeight(PropertyUtil.getDimensionAttribute(element,"String_Node_Str"));
}

Fixed version (ground truth):
public RowState(Element element,Map cssStyles,IContent parent,IContent inlineParent,ActionContent action){
  super(element,cssStyles,inlineParent,action);
  content=new RowContent((ReportContent)parent.getReportContent());
  setParent(parent);
  HTML2Content.handleStyle(element,cssStyles,content);
  content.setHeight(PropertyUtil.getDimensionAttribute(element,"String_Node_Str"));
}
Program: 74680
Project: 74680
Buggy source:
public void processNodes(){
  HTML2Content.processNodes(element,cssStyles,content,inlineParent,action);
  parent.getChildren().add(content);
  content.setParent(parent);
}

Fixed version (ground truth):
public void processNodes(){
  HTML2Content.processNodes(element,cssStyles,content,inlineParent,action);
}
Program: 74681
Project: 74681
Buggy source:
public CellState(Element element,Map cssStyles,IContent parent,IContent inlineParent,ActionContent action){
  super(element,cssStyles,parent,inlineParent,action);
  cell=new CellContent((ReportContent)parent.getReportContent());
  content=cell;
  HTML2Content.handleStyle(element,cssStyles,content);
  cell.setRowSpan(PropertyUtil.getIntAttribute(element,ATTRIBUTE_ROWSPAN));
  cell.setColSpan(PropertyUtil.getIntAttribute(element,ATTRIBUTE_COLSPAN));
}

Fixed version (ground truth):
public CellState(Element element,Map cssStyles,IContent parent,IContent inlineParent,ActionContent action){
  super(element,cssStyles,inlineParent,action);
  cell=new CellContent((ReportContent)parent.getReportContent());
  content=cell;
  setParent(parent);
  HTML2Content.handleStyle(element,cssStyles,content);
  cell.setRowSpan(PropertyUtil.getIntAttribute(element,ATTRIBUTE_ROWSPAN));
  cell.setColSpan(PropertyUtil.getIntAttribute(element,ATTRIBUTE_COLSPAN));
}
Program: 74682
Project: 74682
Buggy source:
public TableState(Element element,Map cssStyles,IContent parent,IContent inlineParent,ActionContent action){
  super(element,cssStyles,parent,inlineParent,action);
  content=new TableContent((ReportContent)parent.getReportContent());
  content.setWidth(PropertyUtil.getDimensionAttribute(element,"String_Node_Str"));
  HTML2Content.handleStyle(element,cssStyles,content);
  columnWidth=new ArrayList();
}

Fixed version (ground truth):
public TableState(Element element,Map cssStyles,IContent parent,IContent inlineParent,ActionContent action){
  super(element,cssStyles,inlineParent,action);
  content=new TableContent((ReportContent)parent.getReportContent());
  setParent(parent);
  content.setWidth(PropertyUtil.getDimensionAttribute(element,"String_Node_Str"));
  HTML2Content.handleStyle(element,cssStyles,content);
  columnWidth=new ArrayList();
}
Program: 74683
Project: 74683
Buggy source:
public void doSave(OutputStream outputStream,Map cacheRequestMap) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=this.resultObjects.length;
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(dos,rowCount);
    for (int i=0; i < rowCount; i++) {
      ResultSetUtil.writeResultObject(dos,resultObjects[i],colCount,resultSetNameSet);
    }
    dos.close();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
public void doSave(DataOutputStream outputStream,DataOutputStream rowLensStream,Map cacheRequestMap) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=this.resultObjects.length;
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(dos,rowCount);
    long offset=4;
    for (int i=0; i < rowCount; i++) {
      IOUtil.writeLong(rowLensStream,offset);
      offset+=ResultSetUtil.writeResultObject(dos,resultObjects[i],colCount,resultSetNameSet);
    }
    dos.close();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 74684
Project: 74684
Buggy source:
/** 
 * Serialize to an output stream
 * @param outputStream
 */
public void doSave(OutputStream outputStream,Map cacheRequestMapping) throws DataException ;

Fixed version (ground truth):
/** 
 * Serialize to an output stream
 * @param outputStream
 */
public void doSave(DataOutputStream outputStream,DataOutputStream lensStream,Map cacheRequestMapping) throws DataException ;
Program: 74685
Project: 74685
Buggy source:
/** 
 * Write the result object value if it is used in column binding map
 * @param dos
 * @param resultObject
 * @param nameSet
 * @throws DataException
 * @throws IOException
 */
public static void writeResultObject(DataOutputStream dos,IResultObject resultObject,int count,Set nameSet) throws DataException, IOException {
  if (resultObject.getResultClass() == null)   return;
  for (int i=1; i <= count; i++) {
    if (nameSet != null && (nameSet.contains(resultObject.getResultClass().getFieldName(i)) || nameSet.contains(resultObject.getResultClass().getFieldAlias(i))))     IOUtil.writeObject(dos,resultObject.getFieldValue(i));
  }
}

Fixed version (ground truth):
/** 
 * Write the result object value if it is used in column binding map
 * @param dos
 * @param resultObject
 * @param nameSet
 * @throws DataException
 * @throws IOException
 */
public static int writeResultObject(DataOutputStream dos,IResultObject resultObject,int count,Set nameSet) throws DataException, IOException {
  if (resultObject.getResultClass() == null)   return 0;
  ByteArrayOutputStream tempBaos=new ByteArrayOutputStream();
  BufferedOutputStream tempBos=new BufferedOutputStream(tempBaos);
  DataOutputStream tempDos=new DataOutputStream(tempBos);
  for (int i=1; i <= count; i++) {
    if (nameSet != null && (nameSet.contains(resultObject.getResultClass().getFieldName(i)) || nameSet.contains(resultObject.getResultClass().getFieldAlias(i))))     IOUtil.writeObject(tempDos,resultObject.getFieldValue(i));
  }
  tempDos.flush();
  tempBos.flush();
  tempBaos.flush();
  byte[] bytes=tempBaos.toByteArray();
  int rowBytes=bytes.length;
  IOUtil.writeRawBytes(dos,bytes);
  tempBaos=null;
  tempBos=null;
  tempDos=null;
  return rowBytes;
}
Program: 74686
Project: 74686
Buggy source:
public void doSave(OutputStream outputStream,Map cacheRequestMap) throws DataException {
  this.resultSetCache.doSave(outputStream,cacheRequestMap);
}

Fixed version (ground truth):
public void doSave(DataOutputStream outputStream,DataOutputStream rowLensStream,Map cacheRequestMap) throws DataException {
  this.resultSetCache.doSave(outputStream,rowLensStream,cacheRequestMap);
}
Program: 74687
Project: 74687
Buggy source:
public void doSave(OutputStream outputStream,Map cacheRequestMap) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=this.diskBasedResultSet.getCount();
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(dos,rowCount);
    int currIndex=this.currResultIndex;
    this.reset();
    for (int i=0; i < rowCount; i++) {
      ResultSetUtil.writeResultObject(dos,this.diskBasedResultSet.nextRow(),colCount,resultSetNameSet);
    }
    this.reset();
    this.moveTo(currIndex);
    dos.close();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
public void doSave(DataOutputStream outputStream,DataOutputStream rowLensStream,Map cacheRequestMap) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=this.diskBasedResultSet.getCount();
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(dos,rowCount);
    int currIndex=this.currResultIndex;
    this.reset();
    long offset=4;
    for (int i=0; i < rowCount; i++) {
      IOUtil.writeLong(rowLensStream,offset);
      offset+=ResultSetUtil.writeResultObject(dos,this.diskBasedResultSet.nextRow(),colCount,resultSetNameSet);
    }
    this.reset();
    this.moveTo(currIndex);
    dos.close();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 74688
Project: 74688
Buggy source:
public void doSave(StreamWrapper streamsWrapper,boolean isSubQuery) throws DataException {
  if (streamsWrapper.getStreamForGroupInfo() != null) {
    this.resultSetPopulator.getGroupProcessorManager().getGroupCalculationUtil().doSave(streamsWrapper.getStreamForGroupInfo());
  }
  if (isSubQuery == false && streamsWrapper.getStreamForResultClass() != null) {
    ((ResultClass)this.resultSetPopulator.getResultSetMetadata()).doSave(streamsWrapper.getStreamForResultClass(),resultSetPopulator.getEventHandler().getAllColumnBindings());
    try {
      streamsWrapper.getStreamForResultClass().close();
      if (streamsWrapper.getStreamForDataSet() != null) {
        this.resultSetPopulator.getCache().doSave(streamsWrapper.getStreamForDataSet(),resultSetPopulator.getEventHandler().getAllColumnBindings());
      }
      streamsWrapper.getStreamForDataSet().close();
    }
 catch (    IOException e) {
      logger.log(Level.FINE,e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
public void doSave(StreamWrapper streamsWrapper,boolean isSubQuery) throws DataException {
  if (streamsWrapper.getStreamForGroupInfo() != null) {
    this.resultSetPopulator.getGroupProcessorManager().getGroupCalculationUtil().doSave(streamsWrapper.getStreamForGroupInfo());
  }
  if (isSubQuery == false && streamsWrapper.getStreamForResultClass() != null) {
    ((ResultClass)this.resultSetPopulator.getResultSetMetadata()).doSave(streamsWrapper.getStreamForResultClass(),resultSetPopulator.getEventHandler().getAllColumnBindings());
    try {
      streamsWrapper.getStreamForResultClass().close();
      if (streamsWrapper.getStreamForDataSet() != null) {
        this.resultSetPopulator.getCache().doSave(streamsWrapper.getStreamForDataSet(),streamsWrapper.getStreamForDataSetRowLens(),resultSetPopulator.getEventHandler().getAllColumnBindings());
      }
      streamsWrapper.getStreamForDataSet().close();
      streamsWrapper.getStreamForDataSetRowLens().close();
    }
 catch (    IOException e) {
      logger.log(Level.FINE,e.getMessage(),e);
    }
  }
}