This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Fix UTF_8 CharSet


Hi,

I am checking in this obvious bug fix from Julian Scheid.

2005-02-16  Julian Scheid  <julian@sektor37.de>

        * gnu/java/nio/charset/UTF_8.java (decodeLoop): Set inPos to
        in.position().
        (encodeLoop): Likewise.

A mauve test has been added.

Cheers,

Mark

--- gnu/java/nio/charset/UTF_8.java     3 Feb 2005 22:37:29 -0000       1.4
+++ gnu/java/nio/charset/UTF_8.java     16 Feb 2005 23:13:35 -0000
@@ -101,7 +101,7 @@
     protected CoderResult decodeLoop (ByteBuffer in, CharBuffer out)
     {
       // TODO: Optimize this in the case in.hasArray() / out.hasArray()
-      int inPos = 0;
+      int inPos = in.position();
       try
         {
           while (in.hasRemaining ())
@@ -196,7 +196,7 @@

     protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out)
     {
-      int inPos = 0;
+      int inPos = in.position();
       try
         {
           // TODO: Optimize this in the case in.hasArray() / out.hasArray()

Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]