|
From: | Nicolas Geoffray |
Subject: | Re: [cp-patches] RFC: implementation of getPackage for the vm reference |
Date: | Sat, 22 Oct 2005 00:07:00 +0200 |
User-agent: | Mozilla Thunderbird 1.0.7 (X11/20051019) |
Hi Jeroen
After looking at it some more, I think the patch is actually incorrect. There should be no need to introduce the new VMClassLoader.getVMPackage() method. VMClassLoader.getPackage() should actually be doing that work and Class.getPackage() should be calling VMClassLoader.getPackage if cl is null.
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)
Regards, Jeroen
Nicolas
[Prev in Thread] | Current Thread | [Next in Thread] |