[kaffe] Odd Jython/jar behaviour

Vesa Kaihlavirta vpkaihla at cc.jyu.fi
Mon Jan 6 21:07:01 PST 2003


On Monday 06 January 2003 21:19, Dalibor Topic wrote:
> > It's an EOFException... I'll try to isolate by using
> > kaffe-1.07 libraries and
> > the VM from CVS. Will report back soon.
>
> Copy the
> libraries/javalib/java/io/DataInputStream.java source
> from kaffe 1.07 to libraries/javalib/java/io/ of kaffe
> from CVS, rebuild (and copy other files if necessary
> to compile ;), and check again. If the exception no
> longer occurs, then you've found a probable cause of
> the bug ;) and just have to isolate the offending
> source code.

Ok, I got the bug now, though I don't know if my fix is the correct one.

from DataInputStream.java:

public final int readInt() throws IOException {
	int v1 = readUnsignedByte() << 24;
	v1 |= readUnsignedByte() << 16;
	v1 |= readUnsignedByte() << 8;
	v1 |= readUnsignedByte();
	return v1;
}

In 1.07's version, this was s/UnsignedByte//g (if you pardon the expression) 
-- the bug disappears also with "readByte()" instead of "readUnsignedByte()". 

I'm guessing readByte() is the correct one -- if it is, attached patch will 
fix this.
--
vegai
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readUnsignedByte2readByte.diff
Type: text/x-diff
Size: 526 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/20030106/cc839794/attachment-0003.diff 


More information about the kaffe mailing list