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 |
|
|
276 |
{ |
{ |
277 |
// Get the caller's classloader |
// Get the caller's classloader |
278 |
ClassLoader cl = VMStackWalker.getCallingClassLoader(); |
ClassLoader cl = VMStackWalker.getCallingClassLoader(); |
279 |
return cl != null ? cl.getPackage(name) : null; |
return cl != null ? cl.getPackage(name) : VMClassLoader.getPackage(name); |
280 |
} |
} |
281 |
|
|
282 |
/** |
/** |
289 |
{ |
{ |
290 |
// Get the caller's classloader |
// Get the caller's classloader |
291 |
ClassLoader cl = VMStackWalker.getCallingClassLoader(); |
ClassLoader cl = VMStackWalker.getCallingClassLoader(); |
292 |
// Sun's implementation returns the packages loaded by the bootstrap |
return cl != null ? cl.getPackages() : VMClassLoader.getPackages(); |
|
// 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 |
/** |
/** |