src/share/classes/java/security/SecureClassLoader.java

Print this page
rev 10449 : [mq]: cds
rev 10450 : mq


 198     private ProtectionDomain getProtectionDomain(CodeSource cs) {
 199         if (cs == null)
 200             return null;
 201 
 202         ProtectionDomain pd = null;
 203         synchronized (pdcache) {
 204             pd = pdcache.get(cs);
 205             if (pd == null) {
 206                 PermissionCollection perms = getPermissions(cs);
 207                 pd = new ProtectionDomain(cs, perms, this, null);
 208                 pdcache.put(cs, pd);
 209                 if (debug != null) {
 210                     debug.println(" getPermissions "+ pd);
 211                     debug.println("");
 212                 }
 213             }
 214         }
 215         return pd;
 216     }
 217 









 218     /*
 219      * Check to make sure the class loader has been initialized.
 220      */
 221     private void check() {
 222         if (!initialized) {
 223             throw new SecurityException("ClassLoader object not initialized");
 224         }
 225     }
 226 
 227 }


 198     private ProtectionDomain getProtectionDomain(CodeSource cs) {
 199         if (cs == null)
 200             return null;
 201 
 202         ProtectionDomain pd = null;
 203         synchronized (pdcache) {
 204             pd = pdcache.get(cs);
 205             if (pd == null) {
 206                 PermissionCollection perms = getPermissions(cs);
 207                 pd = new ProtectionDomain(cs, perms, this, null);
 208                 pdcache.put(cs, pd);
 209                 if (debug != null) {
 210                     debug.println(" getPermissions "+ pd);
 211                     debug.println("");
 212                 }
 213             }
 214         }
 215         return pd;
 216     }
 217 
 218     // Used by the VM to create the ProtectionDomain for the url. Assumes
 219     // that the url points to an unsigned code source.
 220     private ProtectionDomain getProtectionDomain(URL url) {
 221         CodeSigner[] signers = null;
 222         CodeSource cs = new CodeSource(url, signers);
 223 
 224         return getProtectionDomain(cs);
 225     }
 226 
 227     /*
 228      * Check to make sure the class loader has been initialized.
 229      */
 230     private void check() {
 231         if (!initialized) {
 232             throw new SecurityException("ClassLoader object not initialized");
 233         }
 234     }
 235 
 236 }