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: Michael Koch
Subject: Re: [Bug Report] java.nio.CharBuffer: toString() returns empty string
Date: Mon, 19 May 2003 10:41:40 +0200
User-agent: KMail/1.5

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Montag, 19. Mai 2003 05:16 schrieb Ito Kazumitsu:
> 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 ());
>    }

Fix commited to CVS HEAD.


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+yJjEWSOgCCdjSDsRAtu6AJwK1YMc6MyUAL7OoC48ZCy9oXNoeACffq3O
qvfkPwgsJpqACPlppfIEXnY=
=ngop
-----END PGP SIGNATURE-----





reply via email to

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