Errors & memory

Archie Cobbs archie at whistle.com
Thu Sep 24 11:31:43 PDT 1998


Maxim Kizub writes:
> > Maxim Kizub writes:
> > > 1st, java.lang.Byte extends java.lang.Number.
> > 
> > http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Byte.html
> 
> Yes, I mean this ;-)
> Please, check the kaffe sources :-|

Oh, yes this was just fixed a couple of days ago. The new version
of Byte extends Number.

> > > 2nd, java.io.File.mkdirs() has an error - NullPointerException in
> > > line 203 (looks like toString() returns null).
> > 
> > It looks like the only way this can happen is if "path" was
> > null when the constructor was called...
> 
> No, it recursivly calls mkdirs (three times, line 205, as I see from
> stack) and then throws NullPointerException.

You're right, the patch below should fix the problem... please
give it a try.

> What about memory?

The comment that JIT requires a lot more memory is accurate :-)
Also, if the incremental garbage collector worked, this would
help things also.

-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com

Index: libraries/javalib/java/io/File.java
===================================================================
RCS file: /home/cvspublic/kaffe/libraries/javalib/java/io/File.java,v
retrieving revision 1.5
diff -c -u -r1.5 File.java
--- File.java	1998/09/02 23:39:14	1.5
+++ File.java	1998/09/25 09:20:29
@@ -201,9 +201,12 @@
 
 public boolean mkdirs() {
 	if (!toString().equals(separator)) {
-		File parent = new File(getParent());
-		if (parent.mkdirs() == false) {
-			return (false);
+		String parentString = getParent();
+		if (parentString != null) {
+			File parent = new File(parentString);
+			if (parent.mkdirs() == false) {
+				return (false);
+			}
 		}
 	}
 	return (mkdir());


More information about the kaffe mailing list