This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: java.util.Date -> NullPointerException


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]