/[classpath]/classpath/vm/reference/java/lang/Class.java
ViewVC logotype

Diff of /classpath/vm/reference/java/lang/Class.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22 by mark, Sat Oct 26 15:49:18 2002 UTC revision 1.23 by mark, Sat Oct 26 18:41:59 2002 UTC
# Line 177  public final class Class implements Seri Line 177  public final class Class implements Seri
177    {    {
178      if (classloader == null)      if (classloader == null)
179        {        {
180          // Check if we may get the system classloader          // Check if we may access the bootstrap classloader
181          SecurityManager sm = System.getSecurityManager();          SecurityManager sm = System.getSecurityManager();
182          if (sm != null)          if (sm != null)
183            {            {
184              // Get the calling class and classloader              // Get the calling class and classloader
185              Class c = VMSecurityManager.getClassContext()[1];              Class c = VMSecurityManager.getClassContext()[1];
186              ClassLoader cl = c.getClassLoader();              ClassLoader cl = c.getClassLoader();
187              if (cl != null && cl != ClassLoader.systemClassLoader)              if (cl != null)
188                sm.checkPermission(new RuntimePermission("getClassLoader"));                sm.checkPermission(new RuntimePermission("getClassLoader"));
189            }            }
190          classloader = ClassLoader.systemClassLoader;          return VMClassLoader.loadClass(name, initialize);
191        }        }
192      return classloader.loadClass(name, initialize);      return classloader.loadClass(name, initialize);
193    }    }

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26