classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug Report] java.nio.CharBuffer: toString() returns empty string


From: Ito Kazumitsu
Subject: Re: [Bug Report] java.nio.CharBuffer: toString() returns empty string
Date: Mon, 19 May 2003 12:16:54 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (Unebigory ōmae) APEL/10.3 Emacs/20.7 (i386-*-windows98.2222) MULE/4.1 (AOI) Meadow/1.14 (AWSAKA:62)

In message "[Bug Report] java.nio.CharBuffer: toString() returns empty string"
    on 03/05/19, Ito Kazumitsu <address@hidden> writes:

> toString() of java.nio.CharBuffer should not change the buffer's position
> but the get() used in the toString() changes it.  So the output of
> toString() is always empty.

And my simple patch:

--- java/nio/CharBuffer.java.orig       Mon May 19 11:06:28 2003
+++ java/nio/CharBuffer.java    Mon May 19 12:14:52 2003
@@ -409,7 +409,9 @@
   public String toString ()
   {
     char[] data = new char [length ()];
+    int pos = position ();
     get (data, 0, length ());
+    position (pos);
     return new String (data, position (), length ());
   }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]