Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 63774 invoked from network); 11 Oct 2006 05:44:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Oct 2006 05:44:02 -0000 Received: (qmail 5264 invoked by uid 500); 11 Oct 2006 05:44:01 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 5159 invoked by uid 500); 11 Oct 2006 05:44:01 -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 5145 invoked by uid 99); 11 Oct 2006 05:44:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Oct 2006 22:44:01 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Oct 2006 22:44:00 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id AAF067142D8 for ; Tue, 10 Oct 2006 22:43:20 -0700 (PDT) Message-ID: <11223655.1160545400697.JavaMail.root@brutus> Date: Tue, 10 Oct 2006 22:43:20 -0700 (PDT) From: "Aleksey Victorivich Yantsen (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Created: (HARMONY-1817) [classlib][swing] javax.swing.text.html.HTMLEditorKit.createInputAttributes(Element element,MutableAttributeSet set) does not throw NullPointerException when RI does 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 [classlib][swing] javax.swing.text.html.HTMLEditorKit.createInputAttributes(Element element,MutableAttributeSet set) does not throw NullPointerException when RI does --------------------------------------------------------------------------------------------------------------------------------------------------------------------- Key: HARMONY-1817 URL: http://issues.apache.org/jira/browse/HARMONY-1817 Project: Harmony Issue Type: Bug Components: Classlib Reporter: Aleksey Victorivich Yantsen Priority: Minor Attachments: StyledEditorKit_patch.txt Problem: createInputAttributes(Element element, MutableAttributeSet set) does not throw NullPointerException when element or set are null. Reference implementation throws unspecified NullPointerException in such cases. This is compatibility issue. Test to reproduce: import junit.framework.TestCase; import javax.swing.text.Element; import javax.swing.text.MutableAttributeSet; import javax.swing.text.SimpleAttributeSet; import javax.swing.text.html.HTMLDocument; import javax.swing.text.html.HTMLEditorKit; public class Test extends TestCase { class MyHTMLEditorKit extends HTMLEditorKit { public void createInputAttributes(Element element, MutableAttributeSet set) { super.createInputAttributes(element, set); } } public void testElementIsNull() { MyHTMLEditorKit mhe = new MyHTMLEditorKit(); Element e = null; MutableAttributeSet mas = new SimpleAttributeSet(); mhe.createInputAttributes(e, mas); } public void testSetIsNull() { MyHTMLEditorKit mhe = new MyHTMLEditorKit(); HTMLDocument hd = new HTMLDocument(); Element e = hd.getDefaultRootElement(); MutableAttributeSet mas = null; mhe.createInputAttributes(e, mas); } } Output on RI: ================== 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) .E.E Time: 0.375 There were 2 errors: 1) testElementIsNull(Test)java.lang.NullPointerException at javax.swing.text.html.HTMLEditorKit.createInputAttributes(HTMLEditorKit.java:415) at Test$MyHTMLEditorKit.createInputAttributes(Test.java:14) at Test.testElementIsNull(Test.java:22) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 2) testSetIsNull(Test)java.lang.NullPointerException at javax.swing.text.html.HTMLEditorKit.createInputAttributes(HTMLEditorKit.java:414) at Test$MyHTMLEditorKit.createInputAttributes(Test.java:14) at Test.testSetIsNull(Test.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) FAILURES!!! Tests run: 2, Failures: 0, Errors: 2 Output on Harmony: ================== java version "1.5.0" pre-alpha : not complete or compatible svn = r453981, (Oct 9 2006), Windows/ia32/msvc 1310, release build http://incubator.apache.org/harmony .. Time: 0.39 OK (2 tests) -- 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