Program: 78363
Project: 78363
Buggy source:
/** 
 * Populate the smartCache.
 * @param rsMeta
 * @param rowResultSet
 * @param sortSpec
 * @throws DataException
 */
private void populateData(IResultClass rsMeta,IRowResultSet rowResultSet,SortSpec sortSpec) throws DataException {
  long startTime=System.currentTimeMillis();
  int memoryCacheRowCount=computeCacheRowCount(rsMeta);
  logger.info("String_Node_Str" + memoryCacheRowCount);
  IResultObject odaObject;
  IResultObject[] resultObjects;
  List resultObjectsList=new ArrayList();
  int dataCount=0;
  while ((odaObject=rowResultSet.next()) != null) {
    dataCount++;
    if (dataCount <= memoryCacheRowCount) {
      Object[] obs=new Object[rsMeta.getFieldCount()];
      for (int i=1; i <= rsMeta.getFieldCount(); i++) {
        if (i <= odaObject.getResultClass().getFieldCount())         obs[i - 1]=odaObject.getFieldValue(rsMeta.getFieldName(i));
 else         obs[i - 1]=null;
      }
      resultObjectsList.add(new ResultObject(rsMeta,obs));
    }
 else {
      logger.info("String_Node_Str");
      resultObjects=(IResultObject[])resultObjectsList.toArray(new IResultObject[0]);
      resultSetCache=new DiskCache(resultObjects,odaObject,rowResultSet,rsMeta,getComparator(sortSpec),memoryCacheRowCount);
      break;
    }
  }
  if (resultSetCache == null) {
    logger.info("String_Node_Str");
    resultObjects=(IResultObject[])resultObjectsList.toArray(new IResultObject[0]);
    resultSetCache=new MemoryCache(resultObjects,rsMeta,getComparator(sortSpec));
  }
  odaObject=null;
  resultObjects=null;
  resultObjectsList=null;
  rowResultSet=null;
  long consumedTime=(System.currentTimeMillis() - startTime) / 1000;
  logger.info("String_Node_Str" + consumedTime + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Populate the smartCache.
 * @param rsMeta
 * @param rowResultSet
 * @param sortSpec
 * @throws DataException
 */
private void populateData(IResultClass rsMeta,IRowResultSet rowResultSet,SortSpec sortSpec) throws DataException {
  long startTime=System.currentTimeMillis();
  int memoryCacheRowCount=computeCacheRowCount(rsMeta);
  logger.info("String_Node_Str" + memoryCacheRowCount);
  IResultObject odaObject;
  IResultObject[] resultObjects;
  List resultObjectsList=new ArrayList();
  int dataCount=0;
  while ((odaObject=rowResultSet.next()) != null) {
    dataCount++;
    if (dataCount <= memoryCacheRowCount) {
      Object[] obs=new Object[rsMeta.getFieldCount()];
      for (int i=1; i <= rsMeta.getFieldCount(); i++) {
        obs[i - 1]=odaObject.getFieldValue(rsMeta.getFieldName(i));
      }
      resultObjectsList.add(new ResultObject(rsMeta,obs));
    }
 else {
      logger.info("String_Node_Str");
      resultObjects=(IResultObject[])resultObjectsList.toArray(new IResultObject[0]);
      resultSetCache=new DiskCache(resultObjects,odaObject,rowResultSet,rsMeta,getComparator(sortSpec),memoryCacheRowCount);
      break;
    }
  }
  if (resultSetCache == null) {
    logger.info("String_Node_Str");
    resultObjects=(IResultObject[])resultObjectsList.toArray(new IResultObject[0]);
    resultSetCache=new MemoryCache(resultObjects,rsMeta,getComparator(sortSpec));
  }
  odaObject=null;
  resultObjects=null;
  resultObjectsList=null;
  rowResultSet=null;
  long consumedTime=(System.currentTimeMillis() - startTime) / 1000;
  logger.info("String_Node_Str" + consumedTime + "String_Node_Str");
}