Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 70502 invoked from network); 14 Feb 2006 15:44:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Feb 2006 15:44:39 -0000 Received: (qmail 59884 invoked by uid 500); 14 Feb 2006 15:44:33 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 59829 invoked by uid 500); 14 Feb 2006 15:44:32 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 59817 invoked by uid 99); 14 Feb 2006 15:44:32 -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; Tue, 14 Feb 2006 07:44:32 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 368CEDD for ; Tue, 14 Feb 2006 16:44:11 +0100 (CET) Message-ID: <1042897246.1139931851220.JavaMail.jira@ajax.apache.org> Date: Tue, 14 Feb 2006 16:44:11 +0100 (CET) From: "Tim Ellison (JIRA)" To: harmony-dev@incubator.apache.org Subject: [jira] Closed: (HARMONY-33) java.nio.BufferOverflow exception while decoding ByteBuffer with UTF-16 charset In-Reply-To: <1216278676.1137506382646.JavaMail.jira@ajax.apache.org> 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 [ http://issues.apache.org/jira/browse/HARMONY-33?page=all ] Tim Ellison closed HARMONY-33: ------------------------------ Validated by Vladimir. > java.nio.BufferOverflow exception while decoding ByteBuffer with UTF-16 charset > ------------------------------------------------------------------------------- > > Key: HARMONY-33 > URL: http://issues.apache.org/jira/browse/HARMONY-33 > Project: Harmony > Type: Bug > Components: Classlib > Reporter: Vladimir Strigun > Assignee: Tim Ellison > Priority: Minor > > If I try to decode ByteBuffer with lengh 1 using UTF-16 decoder unexpected java.nio.BufferOverflow exception occured. Please see testcase below. > import java.nio.*; > import java.nio.charset.*; > import junit.framework.TestCase; > public class TestDecoder extends TestCase { > public static void main(String[] args) { > junit.textui.TestRunner.run(TestDecoder.class); > } > public static void testDecoder(){ > try{ > ByteBuffer bb = ByteBuffer.allocate(1); > bb.put(0,(byte)77); > CharsetDecoder utf16D = Charset.forName("UTF-16").newDecoder(); > CharBuffer cb = utf16D.onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE).decode(bb); > }catch(Exception e){ > fail("Exception occured: "+e); > } > } > } > Output on RI: > . > Time: 0,03 > OK (1 test) > Output with Harmony: > .F > Time: 0,01 > There was 1 failure: > 1) testDecoder(TestDecoder)junit.framework.AssertionFailedError: Exception occured: java.nio.BufferOverflowException > at TestDecoder.testDecoder(TestDecoder.java:20) > at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:211) > at TestDecoder.main(TestDecoder.java:10) > FAILURES!!! > Tests run: 1, Failures: 1, Errors: 0 -- 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