[kaffe] Odd Jython/jar behaviour

Vesa Kaihlavirta vpkaihla@cc.jyu.fi
Tue Jan 7 09:51:01 2003


--Boundary-00=_sQxG+N6SCx/NVvN
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Tuesday 07 January 2003 14:55, Dalibor Topic wrote:
> Hi Vesa,
> When I switch from using readUnsignedByte() to using
> readByte() I get a ton of failures whan I run make
> check. Could you run make check yourself and see if
> your patch breaks regressions tests?

Indeed, now that I checked out the CVS afresh, it doesn't even compile with my 
patch.

With read(), everything compiles fine, and the tests pass, _and_ jython works. 
Again, I don't know why someone chose readUnsignedByte() there instead. 

Trivial patch attached.

-- 
vegai
--Boundary-00=_sQxG+N6SCx/NVvN
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="readUnsignedByte2read.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="readUnsignedByte2read.diff"

--- libraries/javalib/java/io/DataInputStream.java	2003-01-07 19:40:30.000000000 +0200
+++ libraries/javalib/java/io/DataInputStream.java.new	2003-01-07 19:39:37.000000000 +0200
@@ -80,11 +80,11 @@
 }
 
 public final int readInt() throws IOException {
-	int v1 = readUnsignedByte() << 24;
-	v1 |= readUnsignedByte() << 16;
-	v1 |= readUnsignedByte() << 8;
-	v1 |= readUnsignedByte();
-	return v1;
+	int v1 = read() << 24;
+	v1 |= read() << 16;
+    	v1 |= read() << 8;
+    	v1 |= read();
+    	return v1;
 }
 
 /**

--Boundary-00=_sQxG+N6SCx/NVvN--