java.util.Date -> NullPointerException

Gregory R. Warnes warnes@biostat.washington.edu
Thu May 18 13:08:00 GMT 2000


On Thu, 18 May 2000, Gregory R. Warnes wrote:

  [snip]
  GRW>> However, when I try to use java.util.Date, the executable throws a
  GRW>> NullPointerException while trying to load
  GRW>> gnu/gcj/text/LocaleData_en_US.properties, and dies.  (details below)
  [snip]

Ok, I think I found the problem:

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


Now, of course, I'm getting a new error.  More on that later...


-Gregory



More information about the Java mailing list