Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 77921 invoked from network); 16 Jan 2007 19:32:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Jan 2007 19:32:54 -0000 Received: (qmail 86690 invoked by uid 500); 16 Jan 2007 19:32:57 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 86653 invoked by uid 500); 16 Jan 2007 19:32:57 -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 86611 invoked by uid 99); 16 Jan 2007 19:32:57 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jan 2007 11:32:57 -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; Tue, 16 Jan 2007 11:32:48 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A3CD07142FC for ; Tue, 16 Jan 2007 11:32:28 -0800 (PST) Message-ID: <16901629.1168975948668.JavaMail.jira@brutus> Date: Tue, 16 Jan 2007 11:32:28 -0800 (PST) From: "Mark Hindess (JIRA)" To: commits@harmony.apache.org Subject: [jira] Closed: (HARMONY-1767) [classlib][swing]javax.swing.text.ComponentView(Element) throws unexpected NullPointerException on user's implementation 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-1767?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mark Hindess closed HARMONY-1767. --------------------------------- Fixed title. > [classlib][swing]javax.swing.text.ComponentView(Element) throws unexpected NullPointerException on user's implementation > ------------------------------------------------------------------------------------------------------------------------ > > Key: HARMONY-1767 > URL: https://issues.apache.org/jira/browse/HARMONY-1767 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Svetlana Samoilenko > Assigned To: Mark Hindess > Priority: Trivial > Attachments: ComponentViewTest.patch, Harmony-1767-Test.patch, Harmony-1767.patch > > > Harmony throws unexpected NPE for ComponentView(Element) on user's Element implementation. > RI works correctly. > Test for reproducing: > import junit.framework.TestCase; > import javax.swing.text.*; > import javax.swing.text.html.*; > public class test extends TestCase { > > public void testSetParent_View(){ > HTMLDocument doc = new HTMLDocument(); > Element e=doc.getDefaultRootElement(); > ComponentView obj = new ComponentView(new testElement()); > obj.setParent(new ListView(e)); > } > private class testElement implements Element { > public boolean isLeaf() { > return false; > } > public Element getElement(int p0) { > return null; > } > public int getElementCount() { > return 0; > } > public int getElementIndex(int p0) { > return 0; > } > public int getEndOffset() { > return 0; > } > public int getStartOffset() { > return 0; > } > public AttributeSet getAttributes() { > return null; > } > public String getName() { > return "AA"; > } > public Element getParentElement() { > return null; > } > public Document getDocument() { > return null; > } > } > } > HARMONY output: > ============= > Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable. > java version "1.5.0" > pre-alpha : not complete or compatible > svn = r450941, (Sep 28 2006), Windows/ia32/msvc 1310, release build > http://incubator.apache.org/harmony > .E > Time: 0.578 > There was 1 error: > 1) testSetParent_View(test)java.lang.NullPointerException > at javax.swing.text.StyleConstants.getComponent(StyleConstants.java:202) > at javax.swing.text.ComponentView.createComponent(ComponentView.java:182) > at javax.swing.text.ComponentView.setParent(ComponentView.java:163) > at test.testSetParent_View(test.java:9) > at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java) > FAILURES!!! > Tests run: 1, Failures: 0, Errors: 1 > SUN output: > ========== > java version "1.5.0_06" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05) > Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode) > . > Time: 0.01 > OK (1 test -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira