I need an advice

Jeff Sturm jsturm@one-point.com
Fri Aug 17 09:40:00 GMT 2001


On 2001年8月17日, Martin Kahlert wrote:
> at 0x401560f6: _Jv_ThrowBadArrayIndex (/sw/snapshots/lib/libgcj.so.2)
> at 0x402598f9: gnu.gcj.convert.Output_UTF8.write(char[], int, int) (/sw/snapshots/lib/libgcj.so.2)
> at 0x40259a8c: gnu.gcj.convert.UnicodeToBytes.write(java.lang.String, int, int, char[]) (/sw/snapshots/lib/libgcj.so.2)
> at 0x401a4cdd: java.io.PrintStream.writeChars(java.lang.String, int, int) (/sw/snapshots/lib/libgcj.so.2)

Ah-hah. I got this too but didn't quite understand what triggered it.
Try this patch:
2001年08月17日 Jeff Sturm <jsturm@one-point.com>
	* gnu/gcj/convert/UnicodeToBytes.java (write): Write work buffer
	starting from zero offset.
Index: gnu/gcj/convert/UnicodeToBytes.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/gcj/convert/UnicodeToBytes.java,v
retrieving revision 1.8
diff -u -r1.8 UnicodeToBytes.java
--- UnicodeToBytes.java	2001年07月30日 20:24:18	1.8
+++ UnicodeToBytes.java	2001年08月17日 16:34:40
@@ -143,7 +143,7 @@
 work = new char[inlength];
 int srcEnd = inpos + (inlength > work.length ? work.length : inlength);
 str.getChars(inpos, srcEnd, work, 0);
- return write(work, inpos, inlength);
+ return write(work, 0, inlength);
 }
 
 /** Indicate that the converter is resuable.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /