This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: fix getPackage for bootstrap loader
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 16 Dec 2005 14:32:31 -0700
- Subject: Patch: FYI: fix getPackage for bootstrap loader
- Reply-to: tromey at redhat dot com
I'm checking this in on the 4.1 branch and the trunk.
This fixes getPackage() on a class loaded by the bootstrap loader.
It is essentially a Classpath merge -- another lesson about the
difficulties of divergence.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* java/lang/Class.java (getPackage): Get package from
VMClassLoader if needed.
Index: java/lang/Class.java
===================================================================
--- java/lang/Class.java (revision 108588)
+++ java/lang/Class.java (working copy)
@@ -455,8 +455,7 @@
/**
* Returns the <code>Package</code> in which this class is defined
* Returns null when this information is not available from the
- * classloader of this class or when the classloader of this class
- * is null.
+ * classloader of this class.
*
* @return the package for this class, if it is available
* @since 1.2
@@ -466,7 +465,8 @@
ClassLoader cl = getClassLoader();
if (cl != null)
return cl.getPackage(getPackagePortion(getName()));
- return null;
+ else
+ return VMClassLoader.getPackage(getPackagePortion(getName()));
}
/**