private static ClassLoader getBootstrapClassLoader ( ) { if ( BOOTSTRAP_CLASSLOADER == null ) { synchronized ( ClassLoaderUtil . class ) { if ( BOOTSTRAP_CLASSLOADER == null ) { ClassLoader cl = null ; if ( System . getSecurityManager ( ) != null ) { cl = AccessController . doPrivileged ( new PrivilegedAction < ClassLoader > ( ) { @ Override public BootstrapClassLoader run ( ) { return new BootstrapClassLoader ( ) ; } } ) ; } else { cl = new BootstrapClassLoader ( ) ; } BOOTSTRAP_CLASSLOADER = cl ; } } } return BOOTSTRAP_CLASSLOADER ; }
Lazily create a singleton BootstrapClassLoader . This class loader might be necessary when ICU4J classes are initialized by bootstrap class loader .