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 vm reference


From: Jeroen Frijters
Subject: RE: [cp-patches] RFC: implementation of getPackage for the vm reference
Date: Fri, 21 Oct 2005 23:56:18 +0200

Jeroen Frijters wrote:
> Nicolas Geoffray wrote:
> > This patch was written when we wanted to test our vm and gnu 
> > classpath with jonas.
> > Jonas complained (crashed) because it got a null package 
> for a system 
> > class. This patch corrects the issue, and should be 
> adequate for all vms.
> 
> Looks good, but you should use SystemProperty.getProperty() 
> instead of System.getProperty(). Using System.getProperty() 
> does a security check and that is not correct in this case.
> 
> I don't think this is very important, but getPackages() 
> should return all packages, not just the ones that have 
> already been specifically requested. Since there is no VM 
> independent way of enumerating all the packages in the boot 
> class loader we probably shouldn't worry about it too much.

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.

Regards,
Jeroen




reply via email to

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