From commits-return-31987-apmail-harmony-commits-archive=harmony.apache.org@harmony.apache.org Mon Apr 02 12:32:02 2007 Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 92683 invoked from network); 2 Apr 2007 12:31:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Apr 2007 12:31:56 -0000 Received: (qmail 99324 invoked by uid 500); 2 Apr 2007 12:32:02 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 99294 invoked by uid 500); 2 Apr 2007 12:32:02 -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 99285 invoked by uid 99); 2 Apr 2007 12:32:02 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2007 05:32:02 -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; Mon, 02 Apr 2007 05:31:54 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A4351714068 for ; Mon, 2 Apr 2007 05:31:32 -0700 (PDT) Message-ID: <4994688.1175517092668.JavaMail.jira@brutus> Date: Mon, 2 Apr 2007 05:31:32 -0700 (PDT) From: "Vasily Zakharov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Closed: (HARMONY-3453) [classlib][swing] JEditorPane.registerEditorKitForContentType(String, String, null) doesn't throw NPE In-Reply-To: <28055303.1174437872861.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-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vasily Zakharov closed HARMONY-3453. ------------------------------------ Resolution: Won't Fix Ok, I'm closing this issue as a non-bug-difference. Please see HARMONY-3454 for the continued discussion and the related patches. > [classlib][swing] JEditorPane.registerEditorKitForContentType(String, String, null) doesn't throw NPE > ----------------------------------------------------------------------------------------------------- > > Key: HARMONY-3453 > URL: https://issues.apache.org/jira/browse/HARMONY-3453 > Project: Harmony > Issue Type: Bug > Components: Classlib, Non-bug differences from RI > Reporter: Vasily Zakharov > Assigned To: Alexey Petrenko > Priority: Minor > > Consider the following test: > import javax.swing.JEditorPane; > public class Test { > public static void main(String args[]) throws Exception { > System.out.println(JEditorPane.createEditorKitForContentType("testContentType1")); > try { > JEditorPane.registerEditorKitForContentType("testContentType1", "MyEditorKit", null); > } catch (Exception e) { > e.printStackTrace(); > } > System.out.println(JEditorPane.createEditorKitForContentType("testContentType1")); > JEditorPane.registerEditorKitForContentType("testContentType2", "MyEditorKit"); > System.out.println(JEditorPane.createEditorKitForContentType("testContentType2")); > } > } > public class MyEditorKit extends javax.swing.text.DefaultEditorKit { > } > Output on RI: > null > java.lang.NullPointerException > at java.util.Hashtable.put(Unknown Source) > at javax.swing.JEditorPane.registerEditorKitForContentType(Unknown Source) > at TestNPE.main(TestNPE.java:8) > MyEditorKit@1a46e30 > MyEditorKit@3e25a5 > Output on Harmony: > null > null > null > The specification says nothing about passing null classloader. > The NPE occurs on RI, and doesn't occur on Harmony, it seems that RI uses Hashtable (that doesn't permit null keys/vaues) to store registered classloaders, and Harmony uses ArrayList. > Also, as one may see, RI, besides throwing NPE, also registers the specified content type anyway (compare createEditorKitForContentType results before and after registration attempt). In my opinion, this behaviour is clearly a bug in RI. So my suggestion is to consider this issue a non-bug difference. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.