classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] RFC: implementation of getPackage for the vmreference


From: Nicolas Geoffray
Subject: Re: [cp-patches] RFC: implementation of getPackage for the vmreference
Date: Sat, 22 Oct 2005 11:01:46 +0200
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051019)

Jeroen Frijters wrote:

Nicolas Geoffray wrote:
That's what I thought too in the first place, but the
ClassLoader.getPackage calls the parent loader's getPackage
method. If the parent is null, then it calls VMClassLoader.getPackage().

If VMClassLoader.getPackage had to add the package given as
parameter, then all packages (system + applications) would be
defined in VMClassLoader.definedPackages.

I hope I'm clear enough.

The suggestion you gave for getPackages (having all bootstrap packages
in VMClassLoader.definedPackages at startup) could remove the additional VMClassLoader.getVMPackage. Maybe that's a better solution?

(Sun does it)

Ah, I see what you mean now. In my VM I also have a full list of the
packages defined by the boot class loader, so there my approach does
work (I just tested it). I can't think of any other way to solve this,
there should be a native method that returns a String[] with the native
package names.

Why should it be native? It might be the same work for all VMs.
Maybe we could add a static initializer to VMClassLoader
that would look for java.boot.class.path property and fill the packages
(eg the directories) it finds in the definedPackages hashmap.

Regards,
Jeroen

Nicolas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]