Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 36050 invoked from network); 7 Dec 2006 16:29:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Dec 2006 16:29:44 -0000 Received: (qmail 69803 invoked by uid 500); 7 Dec 2006 16:29:51 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 69780 invoked by uid 500); 7 Dec 2006 16:29:51 -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 69770 invoked by uid 99); 7 Dec 2006 16:29:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2006 08:29:51 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= 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, 07 Dec 2006 08:29:42 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 628597142F8 for ; Thu, 7 Dec 2006 08:29:22 -0800 (PST) Message-ID: <21445053.1165508962400.JavaMail.jira@brutus> Date: Thu, 7 Dec 2006 08:29:22 -0800 (PST) From: "Alexei Zakharov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-2525) [classlib][jndi] javax.naming.CompoundName add(String), add(int, String) methods should follow exception throwing compatibility In-Reply-To: <20636485.1165508601068.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 [ http://issues.apache.org/jira/browse/HARMONY-2525?page=all ] Alexei Zakharov updated HARMONY-2525: ------------------------------------- Summary: [classlib][jndi] javax.naming.CompoundName add(String), add(int, String) methods should follow exception throwing compatibility (was: javax.naming.CompoundName add(String), add(int, String) methods should follow exception throwing compatibility) Anton, could you please add the corresponding summary prefix next time? Thanks. > [classlib][jndi] javax.naming.CompoundName add(String), add(int, String) methods should follow exception throwing compatibility > ------------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-2525 > URL: http://issues.apache.org/jira/browse/HARMONY-2525 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Anton Ivanov > Priority: Trivial > > The behaviour of add(String), add(int, String) methods where String parameter is null is not explicitly specified. > It is only said in the specification that String parameter have to be non-null. > 1) add(null) > RI: no exceptions are thrown > Harmony: InvalidNameException is thrown > 2) add(int, null) > RI: no exceptions are thrown or IndexOutOfBoundsException is thrown > Harmony: InvalidNameException is thrown > The following test reproduces the problem: > import junit.framework.TestCase; > import java.util.*; > import javax.naming.*; > public class ExceptionCompatibilityTest extends TestCase { > public void test1() { > try { > CompoundName name = new CompoundName("", new Properties()); > name.add(null); > } catch (InvalidNameException e) { > fail(e + " should not be thrown"); > } > } > public void test2() { > try { > CompoundName name = new CompoundName("", new Properties()); > name.add(0, null); > } catch (InvalidNameException e) { > fail(e + "should not be thrown"); > } > } > > public void test3() { > try { > CompoundName name = new CompoundName("", new Properties()); > name.add(10, null); > } catch (InvalidNameException e) { > fail("ArrayIndexOutOfBoundsException should be thrown"); > } catch (ArrayIndexOutOfBoundsException e) { > //passed > } > } > } -- 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