/[classpath]/classpath/java/lang/Package.java
ViewVC logotype

Diff of /classpath/java/lang/Package.java

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

revision 1.11.2.1 by gnu_andrew, Sat Jan 15 17:01:52 2005 UTC revision 1.11.2.2 by gnu_andrew, Sun Jan 16 15:15:12 2005 UTC
# Line 1  Line 1 
1  /* Package.java -- information about a package  /* Package.java -- information about a package
2     Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.     Copyright (C) 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 37  exception statement from your version. * Line 37  exception statement from your version. *
37    
38  package java.lang;  package java.lang;
39    
40    import gnu.classpath.VMStackWalker;
41    
42  import java.net.URL;  import java.net.URL;
43  import java.util.NoSuchElementException;  import java.util.NoSuchElementException;
44  import java.util.StringTokenizer;  import java.util.StringTokenizer;
# Line 273  public class Package Line 275  public class Package
275    public static Package getPackage(String name)    public static Package getPackage(String name)
276    {    {
277      // Get the caller's classloader      // Get the caller's classloader
278      ClassLoader cl = VMSecurityManager.currentClassLoader();      ClassLoader cl = VMStackWalker.getCallingClassLoader();
279      return cl != null ? cl.getPackage(name) : null;      return cl != null ? cl.getPackage(name) : VMClassLoader.getPackage(name);
280    }    }
281    
282    /**    /**
# Line 286  public class Package Line 288  public class Package
288    public static Package[] getPackages()    public static Package[] getPackages()
289    {    {
290      // Get the caller's classloader      // Get the caller's classloader
291      Class c = VMSecurityManager.getClassContext()[1];      ClassLoader cl = VMStackWalker.getCallingClassLoader();
292      ClassLoader cl = c.getClassLoader();      return cl != null ? cl.getPackages() : VMClassLoader.getPackages();
     // Sun's implementation returns the packages loaded by the bootstrap  
     // classloader if cl is null, but right now our bootstrap classloader  
     // does not create any Packages.  
     return cl != null ? cl.getPackages() : new Package[0];  
293    }    }
294    
295    /**    /**

Legend:
Removed from v.1.11.2.1  
changed lines
  Added in v.1.11.2.2

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