This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[Patch] Fix broken ByteArrayOutputStream.toString(int)...
- From: David Daney <ddaney at avtrex dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Mon, 12 Sep 2005 10:40:20 -0700
- Subject: [Patch] Fix broken ByteArrayOutputStream.toString(int)...
ByteArrayOutputStream.toString(int) is broken. It just passes its
parameters to a String constructor, but has the order all horked up.
I am guessing that nobody has ever tried calling this method as there is
no way it could have ever worked.
2005-09-08 David Daney <ddaney@avtrex.com>
* classpath/java/io/ByteArrayOutputStream.java (toString(int)): Pass
correct parameters to String constructor.
Bootstrapped on i686-pc-linux-gnu with make -k check showing no new
failures.
OK to commit?
This is not a regression as it was always broken. Should I commit to
4.0.x as well?
If I ever figure out how to make my classpath CVS access work I could
commit there as well.
David Daney.
Index: classpath/java/io/ByteArrayOutputStream.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/classpath/java/io/ByteArrayOutputStream.java,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 ByteArrayOutputStream.java
--- classpath/java/io/ByteArrayOutputStream.java 16 Jul 2005 00:32:20 -0000 1.1.1.1
+++ classpath/java/io/ByteArrayOutputStream.java 12 Sep 2005 17:19:45 -0000
@@ -192,7 +192,7 @@ public class ByteArrayOutputStream exten
*/
public String toString (int hibyte)
{
- return new String (buf, 0, count, hibyte);
+ return new String (buf, hibyte, 0, count);
}
// Resize buffer to accommodate new bytes.