/[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.12 by mkoch, Wed Oct 13 08:24:05 2004 UTC revision 1.13 by archie172, Tue Jan 4 17:45:50 2005 UTC
# 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) : null;
280    }    }
281    
# 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();
     ClassLoader cl = c.getClassLoader();  
292      // Sun's implementation returns the packages loaded by the bootstrap      // Sun's implementation returns the packages loaded by the bootstrap
293      // classloader if cl is null, but right now our bootstrap classloader      // classloader if cl is null, but right now our bootstrap classloader
294      // does not create any Packages.      // does not create any Packages.

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

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