jdk/src/share/classes/sun/misc/Launcher.java
public static ClassLoader getAppClassLoader(final ClassLoader extcl)
throws IOException
{
{- -------------------------------------------
(1) (変数宣言など)
(s は, クラスパス)
---------------------------------------- -}
final String s = System.getProperty("java.class.path");
final File[] path = (s == null) ? new File[0] : getClassPath(s);
{- -------------------------------------------
(1) java.security.AccessController.doPrivileged() を用いて,
特権付きの AppClassLoader インスタンスを生成し,
返値としてリターンする
(なお, この AppClassLoader のパスは, 上記の System.getProperty("java.class.path") により取得したクラスパス)
---------------------------------------- -}
// Note: on bugid 4256530
// Prior implementations of this doPrivileged() block supplied
// a rather restrictive ACC via a call to the private method
// AppClassLoader.getContext(). This proved overly restrictive
// when loading classes. Specifically it prevent
// accessClassInPackage.sun.* grants from being honored.
//
return AccessController.doPrivileged(
new PrivilegedAction<AppClassLoader>() {
public AppClassLoader run() {
URL[] urls =
(s == null) ? new URL[0] : pathToURLs(path);
return new AppClassLoader(urls, extcl);
}
});
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.