if( i <= odaObject.getResultClass( ).getFieldCount( )) obs[i-1] = odaObject.getFieldValue( rsMeta.getFieldName(i)); else obs[i-1] = null;
obs[i-1] = odaObject.getFieldValue( rsMeta.getFieldName(i));
	private void populateData( IResultClass rsMeta, IRowResultSet rowResultSet,			SortSpec sortSpec ) throws DataException	{		long startTime = System.currentTimeMillis( );		// compute the number of rows which can be cached in memory		int memoryCacheRowCount = computeCacheRowCount( rsMeta );		logger.info( "memoryCacheRowCount is " + memoryCacheRowCount );				IResultObject odaObject;		IResultObject[] resultObjects;		List resultObjectsList = new ArrayList( );				int dataCount = 0;		while ( ( odaObject = rowResultSet.next( ) ) != null )		{			dataCount++;			// notice. it is less than or equal			if ( dataCount <= memoryCacheRowCount ) 			{				//Populate Data according to the given meta data.				Object[] obs = new Object[rsMeta.getFieldCount()];				for(int i = 1; i <= rsMeta.getFieldCount(); i++)				{					//The actual meta data of this odaObject may not equal to 					//rsMeta. We simply populate the new ResultObject using the 					//given rsMeta.					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( "DisckCache is used" );								resultObjects = (IResultObject[]) resultObjectsList.toArray( new IResultObject[0] );				// the order is: resultObjects, odaObject, rowResultSet				resultSetCache = new DiskCache( resultObjects,						odaObject,						rowResultSet,						rsMeta,						getComparator( sortSpec ),						memoryCacheRowCount );				break;			}		}		if ( resultSetCache == null )		{			logger.info( "MemoryCache is used" );						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( "Time consumed by cache is: " + consumedTime + " second" );	}