Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 92531 invoked from network); 29 Mar 2007 14:42:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Mar 2007 14:42:46 -0000 Received: (qmail 81613 invoked by uid 500); 29 Mar 2007 14:42:53 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 81595 invoked by uid 500); 29 Mar 2007 14:42:53 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 81584 invoked by uid 99); 29 Mar 2007 14:42:53 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Mar 2007 07:42:53 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Mar 2007 07:42:45 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id ACFDE71406C for ; Thu, 29 Mar 2007 07:42:25 -0700 (PDT) Message-ID: <23310254.1175179345704.JavaMail.jira@brutus> Date: Thu, 29 Mar 2007 07:42:25 -0700 (PDT) From: "Mikhail Markov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-2467) [classlib][nio charset] java.nio.charset.CharsetDecoder(cs, Float.MIN_VALUE,Float.MIN_VALUE) does not throw IllegalArgumentException In-Reply-To: <25232761.1165328182641.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12485200 ] Mikhail Markov commented on HARMONY-2467: ----------------------------------------- Alexei, you were correct: RI returns incorrect number of chars per each byte of input. Here is the link to SUN bugtraq complaining to this: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6230719 (and it seems that Harmony returns not the same values as RI does for different charsets - possible topic for the new JIRA). > [classlib][nio charset] java.nio.charset.CharsetDecoder(cs, Float.MIN_VALUE,Float.MIN_VALUE) does not throw IllegalArgumentException > ------------------------------------------------------------------------------------------------------------------------------------ > > Key: HARMONY-2467 > URL: https://issues.apache.org/jira/browse/HARMONY-2467 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Anton Ivanov > Assigned To: Alexei Zakharov > Priority: Minor > Attachments: H-2467.patch > > > According to the specification constructor must throw IllegalArgumentException if the preconditions on the parameters do not hold. > java.nio.charset.CharsetDecoder(cs, Float.MIN_VALUE,Float.MIN_VALUE) does not throw IllegalArgumentException while RI does with message: > java.lang.IllegalArgumentException: Replacement too long > Test to reproduce the problem: > import junit.framework.TestCase; > import java.nio.charset.*; > import java.nio.*; > public class test10036 extends TestCase { > public void test1 () { > try { > CharsetDecoderImpl obj = new CharsetDecoderImpl(Charset.forName("UTF-8"), > Float.MIN_VALUE , Float.MIN_VALUE ); > fail("IllegalArgumentException should be thrown"); > } catch (IllegalArgumentException e) { > //expected > } > } > } > class CharsetDecoderImpl extends CharsetDecoder{ > public CharsetDecoderImpl(Charset cs, float averageBytesPerChar, > float maxBytesPerChar){ > super(cs, averageBytesPerChar, maxBytesPerChar); > } > public CoderResult decodeLoop(ByteBuffer out, CharBuffer in) { > return CoderResult.UNDERFLOW; > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.