Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 52992 invoked from network); 30 Oct 2006 12:48:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2006 12:48:28 -0000 Received: (qmail 3619 invoked by uid 500); 30 Oct 2006 12:48:39 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 3585 invoked by uid 500); 30 Oct 2006 12:48:39 -0000 Mailing-List: contact harmony-commits-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-commits@incubator.apache.org Received: (qmail 3574 invoked by uid 99); 30 Oct 2006 12:48:39 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Oct 2006 04:48:39 -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; Mon, 30 Oct 2006 04:48:27 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BF2477141D1 for ; Mon, 30 Oct 2006 04:47:19 -0800 (PST) Message-ID: <23715632.1162212439778.JavaMail.root@brutus> Date: Mon, 30 Oct 2006 04:47:19 -0800 (PST) From: "Denis Kishenko (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Commented: (HARMONY-1244) [classlib][text] AttributedString.addAttribute(null, ...) throws nothing while RI throws NPE In-Reply-To: <2379313.1156162753898.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-1244?page=comments#action_12445585 ] Denis Kishenko commented on HARMONY-1244: ----------------------------------------- Verified, thanks > [classlib][text] AttributedString.addAttribute(null, ...) throws nothing while RI throws NPE > -------------------------------------------------------------------------------------------- > > Key: HARMONY-1244 > URL: http://issues.apache.org/jira/browse/HARMONY-1244 > Project: Harmony > Issue Type: Bug > Reporter: Denis Kishenko > Assigned To: Paulex Yang > Attachments: 1244-AttributeString.patch, 1244-AttributeStringTest.patch, 1244.diff > > > Harmony implementation of AttributedString.addAttribute(null, ...) throws nothing while RI throws NPE. > =============== Spec ====================== > public void addAttribute(AttributedCharacterIterator.Attribute attribute, Object value) > Throws: > IllegalArgumentException - if the AttributedString has length 0 (attributes cannot be applied to a 0-length range). > public void addAttribute(AttributedCharacterIterator.Attribute attribute, Object value, int beginIndex, int endIndex) > Throws: > IllegalArgumentException - if beginIndex is less then 0, endIndex is greater than the length of the string, or beginIndex and endIndex together don't define a non-empty subrange of the string. > ===================== Test ===================== > import java.text.*; > import java.util.*; > public class bug9291 { > public static void main (String[] args) { > try { > new AttributedString("123", new WeakHashMap()).addAttribute(null, new TreeSet()); > } catch (Exception e) { > e.printStackTrace(); > } > try { > new AttributedString("123", new WeakHashMap()).addAttribute(null, new TreeSet(), 0, 1); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > =============== Output ===================== > RI > java.lang.NullPointerException > at java.text.AttributedString.addAttribute(AttributedString.java:286) > at bug9291.main(bug9291.java:8) > java.lang.NullPointerException > at java.text.AttributedString.addAttribute(AttributedString.java:311) > at bug9291.main(bug9291.java:13) > Harmony > -- 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