java.util.Date -> NullPointerException

Bryce McKinlay bryce@albatross.co.nz
Thu May 18 16:23:00 GMT 2000


OK, the existing code is definitely wrong here. I'm going to check in your
change.

What is not clear is why the URLClassLoader is being used at all here. The
system classloader should find the compiled "gnu.gcj.text.LocaleData_en_US" in
libgcj.so, but it seems that if you explicitly put "libgcj.zip" on your
classpath (which you shouldn't), Class.forName() prefers the .class version,
and loads it that way. This is strange, because I thought it was designed to
prefer native classes if available. Perhaps the fact that this class is in a
.zip confuses this?

Anyway, I strongly recommend not putting libgcj.zip in your CLASSPATH.

regards

  [ bryce ]

"Gregory R. Warnes" wrote:

> --- libgcj/libjava/gnu/gcj/protocol/jar/Connection.java.orig    Thu May 18
> 12:24:07 2000
> +++ libgcj/libjava/gnu/gcj/protocol/jar/Connection.java Thu May 18
> 12:23:25 2000
> @@ -59,7 +59,7 @@
>         if (getUseCaches())
>           {
>             jarfile = (JarFile) file_cache.get(jarFileURL);
> -           if (jarFileURL == null)
> +           if (jarfile == null)
>               {
>                 jarfile = new JarFile (jarFileURL.getFile ());
>                 file_cache.put (jarFileURL, jarfile);
>
> Making this change lets HelloDate work:
>
> hydra:/tmp> gcj -o HelloDate HelloDate.java --main=HelloDate
> hydra:/tmp> ./HelloDate
> Hello World, Today is Thu May 18 19:49:22 GMT 2000



More information about the Java mailing list