private void populate ( ) throws Exception { List < T > initializer = new ArrayList < T > ( this . getMinIdle ( ) ) ; for ( int idx = 0 ; idx < this . getMinIdle ( ) && ( this . getMaxIdle ( ) == DISABLED || idx < this . getMaxIdle ( ) ) && ( this . getMaxActive ( ) == DISABLED || idx < this . getMaxActive ( ) ) ; idx ++ ) { initializer . add ( this . borrowObject ( ) ) ; } for ( int idx = 0 ; idx < this . getMinIdle ( ) && ( this . getMaxIdle ( ) == DISABLED || idx < this . getMaxIdle ( ) ) && ( this . getMaxActive ( ) == DISABLED || idx < this . getMaxActive ( ) ) ; idx ++ ) { this . returnObject ( initializer . get ( idx ) ) ; } }
Populate the pool up to minIdle instances . Is limited to maxIdle and maxActive .