Class's #getPackage() returns null - (old) bug?

Martin Egholm Nielsen martin@egholm-nielsen.dk
Fri Aug 5 10:17:00 GMT 2005


Hi there,
I just tried the following:
--- 8< 8< 8< ---
package men.gcjpackage;
public class TestPackage
{
 public static void main(String[] args)
 {
 System.out.println("ClassLoader: " + 
TestPackage.class.getClassLoader() );
 System.out.println("Package: " + TestPackage.class.getPackage());
 } // main
} // TestPackage
--- 8< 8< 8< ---
I would expect the #getPackage to return "something" else but null - but 
nevertheless I get:
# ./testpackage
ClassLoader: gnu.gcj.runtime.VMClassLoader@10074fc0
Package: null
This may have to do with the fact that I run an old GCJ - 3.4.3...
// ME


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /