Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 83795 invoked from network); 17 Dec 2005 11:49:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Dec 2005 11:49:59 -0000 Received: (qmail 33366 invoked by uid 500); 17 Dec 2005 11:49:58 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 33135 invoked by uid 500); 17 Dec 2005 11:49:57 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 33123 invoked by uid 99); 17 Dec 2005 11:49:57 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Dec 2005 03:49:56 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 8C7A2CB for ; Sat, 17 Dec 2005 12:49:35 +0100 (CET) Message-ID: <133626431.1134820175212.JavaMail.jira@ajax.apache.org> Date: Sat, 17 Dec 2005 12:49:35 +0100 (CET) From: "Niklas Therning (JIRA)" To: dev@directory.apache.org Subject: [jira] Created: (DIRMINA-146) ByteBuffer.wrap(byte[] n, int offset, int length) calls clear() on the wrapped NIO buffer Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ByteBuffer.wrap(byte[] n, int offset, int length) calls clear() on the wrapped NIO buffer ----------------------------------------------------------------------------------------- Key: DIRMINA-146 URL: http://issues.apache.org/jira/browse/DIRMINA-146 Project: Directory MINA Type: Bug Versions: 0.9 Reporter: Niklas Therning Fix For: 0.9.1 clear() is called on the underlying NIO buffer wrapping the byte array. The consequence is that the position is set to 0 and the limit is set to capacity (the length of the wrapped array). Since this method should behave exactly as the NIO ByteBuffer equivalent the position should be set to offset and the limit should be set to offset+length. Whenever an existing NIO ByteBuffer is wrapped in a MINA ByteBuffer the NIO buffer is cleared. That may not always be desirable. I suggest that the call to clear() is removed from DefaultByteBuffer.init(). That would take care of the bug described above. If the user wishes to wrap an NIO buffer she would have to make sure it is cleared if that is desired. NOTE: This isn't a problem in MINA 0.8. clear() isn't called on the wrapped NIO buffer in DefaultByteBuffer.init(). Does anyone know why this was introduced in 0.9? -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira