private static final int getPrecacheSize ( ) { String prop = null ; long propParsed ; try { prop = System . getProperty ( PRECACHE_PROPERTY ) ; } catch ( SecurityException e ) { // security manager stopped us so use default // FIXME: should we log this somewhere? return DEFAULT_PRECACHE_SIZE ; } if ( prop == null ) return DEFAULT_PRECACHE_SIZE ; // empty value // FIXME: should we log this somewhere? if ( prop . length ( ) <= 0 ) return DEFAULT_PRECACHE_SIZE ; try { propParsed = Long . parseLong ( prop ) ; } catch ( NumberFormatException e ) { // not a valid number // FIXME: should we log this somewhere? return DEFAULT_PRECACHE_SIZE ; } // treat negative value as no cache... if ( propParsed < 0 ) return 0 ; // FIXME: should we log this somewhere? if ( propParsed > Integer . MAX_VALUE ) return Integer . MAX_VALUE ; return ( int ) propParsed ; }
Figure out the size of the precache .