diff options
Diffstat (limited to 'libjava/classpath/java/security/SecureClassLoader.java')
-rw-r--r-- | libjava/classpath/java/security/SecureClassLoader.java | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/libjava/classpath/java/security/SecureClassLoader.java b/libjava/classpath/java/security/SecureClassLoader.java index 6e173007e45..1480b71168a 100644 --- a/libjava/classpath/java/security/SecureClassLoader.java +++ b/libjava/classpath/java/security/SecureClassLoader.java @@ -41,7 +41,7 @@ import java.nio.ByteBuffer; import java.util.HashMap; /** - * A Secure Class Loader for loading classes with additional + * A Secure Class Loader for loading classes with additional * support for specifying code source and permissions when * they are retrieved by the system policy handler. * @@ -63,8 +63,8 @@ public class SecureClassLoader extends ClassLoader { } - /** - * Creates a class using an array of bytes and a + /** + * Creates a class using an array of bytes and a * CodeSource. * * @param name the name to give the class. null if unknown. @@ -78,13 +78,13 @@ public class SecureClassLoader extends ClassLoader * @exception ClassFormatError if the byte array is not in proper classfile format. */ protected final Class<?> defineClass(String name, byte[] b, int off, int len, - CodeSource cs) + CodeSource cs) { return super.defineClass(name, b, off, len, getProtectionDomain(cs)); } - /** - * Creates a class using an ByteBuffer and a + /** + * Creates a class using an ByteBuffer and a * CodeSource. * * @param name the name to give the class. null if unknown. @@ -109,31 +109,31 @@ public class SecureClassLoader extends ClassLoader ProtectionDomain protectionDomain = null; if (cs != null) { - synchronized (protectionDomainCache) - { - protectionDomain = protectionDomainCache.get(cs); - } - - if (protectionDomain == null) - { - protectionDomain - = new ProtectionDomain(cs, getPermissions(cs), this, null); - synchronized (protectionDomainCache) - { - ProtectionDomain domain = protectionDomainCache.get(cs); - if (domain == null) - protectionDomainCache.put(cs, protectionDomain); - else - protectionDomain = domain; - } - } + synchronized (protectionDomainCache) + { + protectionDomain = protectionDomainCache.get(cs); + } + + if (protectionDomain == null) + { + protectionDomain + = new ProtectionDomain(cs, getPermissions(cs), this, null); + synchronized (protectionDomainCache) + { + ProtectionDomain domain = protectionDomainCache.get(cs); + if (domain == null) + protectionDomainCache.put(cs, protectionDomain); + else + protectionDomain = domain; + } + } } return protectionDomain; } /** * Returns a PermissionCollection for the specified CodeSource. - * The default implementation invokes + * The default implementation invokes * java.security.Policy.getPermissions. * * This method is called by defineClass that takes a CodeSource |