classpath-patches
[Top][All Lists]
Advanced

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

Re: [cp-patches] java.nio.ByteBuffer#compact() does not set position and


From: Michael Koch
Subject: Re: [cp-patches] java.nio.ByteBuffer#compact() does not set position and limit
Date: Thu, 30 Dec 2004 11:24:02 +0100
User-agent: KMail/1.6.2

Am Donnerstag, 30. Dezember 2004 01:19 schrieb address@hidden:
> With reference to the report in the kaffe mailing list
>
>   http://www.kaffe.org/pipermail/kaffe/2004-December/100961.html
>
> I suggest the following patch:
>
> ChangeLog enty:
> 2004-12-30  Ito Kazumitsu  <address@hidden>
>
>  * java/nio/ByteBufferImpl.java (compact):
>  Set position and limit even if no bytes were moved.
>
> #####
> --- java/nio/ByteBufferImpl.java.orig Thu Dec 30 08:47:51 2004
> +++ java/nio/ByteBufferImpl.java Thu Dec 30 08:57:35 2004
> @@ -122,6 +122,11 @@
>   position(count);
>   limit(capacity());
>        }
> +    else
> +      {
> + position(limit());
> + limit(capacity());
> +      }
>      return this;
>    }

Inspired by this mail with patch I write some new mauve testcases and 
found out that all compact() methods in java.nio have the same bug. I 
extended your patch and commited as follows:

2004-12-30  Ito Kazumitsu  <address@hidden>

 * java/nio/ByteBufferImpl.java (compact):
 Set position and limit even if no bytes were moved.

2004-12-30  Michael Koch  <address@hidden>

 * java/nio/CharViewBufferImpl.java (compact): Likewise.
 * java/nio/DirectByteBufferImpl.java (compact): Likewise.
 * java/nio/DoubleViewBufferImpl.java (compact): Likewise.
 * java/nio/FloatViewBufferImpl.java (compact): Likewise.
 * java/nio/IntViewBufferImpl.java (compact): Likewise.
 * java/nio/LongViewBufferImpl.java (compact): Likewise.
 * java/nio/MappedByteBufferImpl.java (compact): Likewise.
 * java/nio/ShortViewBufferImpl.java (compact): Likewise.
 * java/nio/FloatBufferImpl.java (compact): Set position.
 * java/nio/CharBufferImpl.java (compact): Likewise.
 * java/nio/DoubleBufferImpl.java (compact): Likewise.
 * java/nio/IntBufferImpl.java (compact): Likewise.
 * java/nio/LongBufferImpl.java (compact): Likewise.
 * java/nio/ShortBufferImpl.java (compact): Likewise.


Thanks,
Michael
-- 
Homepage: http://www.worldforge.org/

Attachment: nio.diff
Description: Text Data


reply via email to

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