jdk/src/share/classes/java/security/SecureClassLoader.java
author valeriep
Mon, 06 Apr 2009 18:46:20 -0700
changeset 2448 1e8128f3ff61
parent 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
4735126: (cl) ClassLoader.loadClass locks all instances in chain when delegating Summary: Added support for parallel-capable class loaders Reviewed-by: alanb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
2448
1e8128f3ff61 4735126: (cl) ClassLoader.loadClass locks all instances in chain when delegating
valeriep
parents: 2
diff changeset
     2
 * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.security;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.HashMap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.util.ArrayList;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.net.URL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import sun.security.util.Debug;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * This class extends ClassLoader with additional support for defining
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * classes with an associated code source and permissions which are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * retrieved by the system policy by default.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * @author  Li Gong
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * @author  Roland Schemers
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
public class SecureClassLoader extends ClassLoader {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
     * If initialization succeed this is set to true and security checks will
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
     * succeed. Otherwise the object is not initialized and the object is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
     * useless.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
     */
2448
1e8128f3ff61 4735126: (cl) ClassLoader.loadClass locks all instances in chain when delegating
valeriep
parents: 2
diff changeset
    48
    private final boolean initialized;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    // HashMap that maps CodeSource to ProtectionDomain
2448
1e8128f3ff61 4735126: (cl) ClassLoader.loadClass locks all instances in chain when delegating
valeriep
parents: 2
diff changeset
    51
    // @GuardedBy("pdcache")
1e8128f3ff61 4735126: (cl) ClassLoader.loadClass locks all instances in chain when delegating
valeriep
parents: 2
diff changeset
    52
    private final HashMap<CodeSource, ProtectionDomain> pdcache =
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
                        new HashMap<CodeSource, ProtectionDomain>(11);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    private static final Debug debug = Debug.getInstance("scl");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
2448
1e8128f3ff61 4735126: (cl) ClassLoader.loadClass locks all instances in chain when delegating
valeriep
parents: 2
diff changeset
    57
    static {
1e8128f3ff61 4735126: (cl) ClassLoader.loadClass locks all instances in chain when delegating
valeriep
parents: 2
diff changeset
    58
        ClassLoader.registerAsParallelCapable();
1e8128f3ff61 4735126: (cl) ClassLoader.loadClass locks all instances in chain when delegating
valeriep
parents: 2
diff changeset
    59
    }
1e8128f3ff61 4735126: (cl) ClassLoader.loadClass locks all instances in chain when delegating
valeriep
parents: 2
diff changeset
    60
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * Creates a new SecureClassLoader using the specified parent
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * class loader for delegation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * <p>If there is a security manager, this method first
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * calls the security manager's <code>checkCreateClassLoader</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * method  to ensure creation of a class loader is allowed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * @param parent the parent ClassLoader
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * @exception  SecurityException  if a security manager exists and its
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     *             <code>checkCreateClassLoader</code> method doesn't allow
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     *             creation of a class loader.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * @see SecurityManager#checkCreateClassLoader
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    protected SecureClassLoader(ClassLoader parent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        super(parent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        // this is to make the stack depth consistent with 1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        SecurityManager security = System.getSecurityManager();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        if (security != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
            security.checkCreateClassLoader();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        initialized = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * Creates a new SecureClassLoader using the default parent class
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * loader for delegation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * <p>If there is a security manager, this method first
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * calls the security manager's <code>checkCreateClassLoader</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * method  to ensure creation of a class loader is allowed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * @exception  SecurityException  if a security manager exists and its
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     *             <code>checkCreateClassLoader</code> method doesn't allow
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     *             creation of a class loader.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * @see SecurityManager#checkCreateClassLoader
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    protected SecureClassLoader() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        super();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        // this is to make the stack depth consistent with 1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        SecurityManager security = System.getSecurityManager();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        if (security != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
            security.checkCreateClassLoader();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        initialized = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * Converts an array of bytes into an instance of class Class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * with an optional CodeSource. Before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * class can be used it must be resolved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * If a non-null CodeSource is supplied a ProtectionDomain is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * constructed and associated with the class being defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * @param      name the expected name of the class, or <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     *                  if not known, using '.' and not '/' as the separator
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     *                  and without a trailing ".class" suffix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * @param      b    the bytes that make up the class data. The bytes in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     *             positions <code>off</code> through <code>off+len-1</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     *             should have the format of a valid class file as defined
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     *             by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     *             <a href="http://java.sun.com/docs/books/vmspec/">Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     *             Virtual Machine Specification</a>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * @param      off  the start offset in <code>b</code> of the class data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * @param      len  the length of the class data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * @param      cs   the associated CodeSource, or <code>null</code> if none
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * @return the <code>Class</code> object created from the data,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     *         and optional CodeSource.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * @exception  ClassFormatError if the data did not contain a valid class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * @exception  IndexOutOfBoundsException if either <code>off</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     *             <code>len</code> is negative, or if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     *             <code>off+len</code> is greater than <code>b.length</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * @exception  SecurityException if an attempt is made to add this class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     *             to a package that contains classes that were signed by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     *             a different set of certificates than this class, or if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     *             the class name begins with "java.".
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    protected final Class<?> defineClass(String name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
                                         byte[] b, int off, int len,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
                                         CodeSource cs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    {
2448
1e8128f3ff61 4735126: (cl) ClassLoader.loadClass locks all instances in chain when delegating
valeriep
parents: 2
diff changeset
   144
        return defineClass(name, b, off, len, getProtectionDomain(cs));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * Converts a {@link java.nio.ByteBuffer <tt>ByteBuffer</tt>}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * into an instance of class <tt>Class</tt>, with an optional CodeSource.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * Before the class can be used it must be resolved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * If a non-null CodeSource is supplied a ProtectionDomain is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * constructed and associated with the class being defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @param      name the expected name of the class, or <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     *                  if not known, using '.' and not '/' as the separator
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     *                  and without a trailing ".class" suffix.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * @param      b    the bytes that make up the class data.  The bytes from positions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     *                  <tt>b.position()</tt> through <tt>b.position() + b.limit() -1</tt>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     *                  should have the format of a valid class file as defined by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     *                  <a href="http://java.sun.com/docs/books/vmspec/">Java Virtual
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     *                  Machine Specification</a>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * @param      cs   the associated CodeSource, or <code>null</code> if none
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * @return the <code>Class</code> object created from the data,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     *         and optional CodeSource.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * @exception  ClassFormatError if the data did not contain a valid class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * @exception  SecurityException if an attempt is made to add this class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     *             to a package that contains classes that were signed by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     *             a different set of certificates than this class, or if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     *             the class name begins with "java.".
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * @since  1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    protected final Class<?> defineClass(String name, java.nio.ByteBuffer b,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                                         CodeSource cs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    {
2448
1e8128f3ff61 4735126: (cl) ClassLoader.loadClass locks all instances in chain when delegating
valeriep
parents: 2
diff changeset
   177
        return defineClass(name, b, getProtectionDomain(cs));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * Returns the permissions for the given CodeSource object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * This method is invoked by the defineClass method which takes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * a CodeSource as an argument when it is constructing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     * ProtectionDomain for the class being defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * @param codesource the codesource.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * @return the permissions granted to the codesource.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    protected PermissionCollection getPermissions(CodeSource codesource)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        check();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        return new Permissions(); // ProtectionDomain defers the binding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * Returned cached ProtectionDomain for the specified CodeSource.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    private ProtectionDomain getProtectionDomain(CodeSource cs) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        if (cs == null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        ProtectionDomain pd = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        synchronized (pdcache) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
            pd = pdcache.get(cs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
            if (pd == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                PermissionCollection perms = getPermissions(cs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
                pd = new ProtectionDomain(cs, perms, this, null);
2448
1e8128f3ff61 4735126: (cl) ClassLoader.loadClass locks all instances in chain when delegating
valeriep
parents: 2
diff changeset
   211
                pdcache.put(cs, pd);
1e8128f3ff61 4735126: (cl) ClassLoader.loadClass locks all instances in chain when delegating
valeriep
parents: 2
diff changeset
   212
                if (debug != null) {
1e8128f3ff61 4735126: (cl) ClassLoader.loadClass locks all instances in chain when delegating
valeriep
parents: 2
diff changeset
   213
                    debug.println(" getPermissions "+ pd);
1e8128f3ff61 4735126: (cl) ClassLoader.loadClass locks all instances in chain when delegating
valeriep
parents: 2
diff changeset
   214
                    debug.println("");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        return pd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * Check to make sure the class loader has been initialized.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    private void check() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        if (!initialized) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
            throw new SecurityException("ClassLoader object not initialized");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
}