jdk/src/share/classes/sun/misc/Launcher.java
package のチェックを行う処理を追加しただけの URLClassLoader.loadClass() のラッパー.
/**
* Override loadClass so we can checkPackageAccess.
*/
public Class loadClass(String name, boolean resolve)
throws ClassNotFoundException
{
{- -------------------------------------------
(1) checkPackageAccess() で package のチェックを行っておく.
---------------------------------------- -}
int i = name.lastIndexOf('.');
if (i != -1) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPackageAccess(name.substring(0, i));
}
}
{- -------------------------------------------
(1) スーパークラスの loadClass() に処理を委譲.
---------------------------------------- -}
return (super.loadClass(name, resolve));
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.