Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 46378 invoked from network); 10 May 2007 11:49:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 May 2007 11:49:40 -0000 Received: (qmail 21684 invoked by uid 500); 10 May 2007 11:49:45 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 21668 invoked by uid 500); 10 May 2007 11:49:44 -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 21643 invoked by uid 99); 10 May 2007 11:49:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2007 04:49:44 -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; Thu, 10 May 2007 04:49:37 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A645571406F for ; Thu, 10 May 2007 04:49:16 -0700 (PDT) Message-ID: <31978983.1178797756678.JavaMail.jira@brutus> Date: Thu, 10 May 2007 04:49:16 -0700 (PDT) From: "Alexey Petrenko (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-1799) [classlib][swing] JTextPane throws NPE after we set null font. 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-1799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexey Petrenko updated HARMONY-1799: ------------------------------------- Patch Info: (was: [Patch Available]) Assignee: (was: Alexey Petrenko) The Harmony with the patch does not pass the original test now. Need additional investigation. > [classlib][swing] JTextPane throws NPE after we set null font. > -------------------------------------------------------------- > > Key: HARMONY-1799 > URL: https://issues.apache.org/jira/browse/HARMONY-1799 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Ilya Okomin > Priority: Minor > Attachments: Harmony-1799-test.patch, Harmony-1799.patch > > > If we try to set JTextPane font to null Harmony throws NPE, while RI works silent. > Test to reproduce: > ---------------test.java------------- > import javax.swing.JTextPane; > import junit.framework.*; > import junit.textui.TestRunner; > public class test extends TestCase{ > JTextPane textPane; > public static void main(String args[]) throws Exception{ > TestRunner.run(test.class); > } > > public void testRun() throws Exception{ > JTextPane textPane = new JTextPane(); > textPane.setFont(null); > } > } > ------------------------------ > ====== Ouput RI ======= > . > Time: 0.991 > OK (1 test) > ====== Output Harmony ====== > .E > Time: 0.531 > There was 1 error: > 1) testRun(test)java.lang.NullPointerException > at javax.swing.plaf.basic.BasicTextPaneUI.updateFontAttributes(BasicTextPaneUI.java:89) > at javax.swing.plaf.basic.BasicTextPaneUI.propertyChange(BasicTextPaneUI.java:49) > at javax.swing.plaf.basic.BasicTextUI$Listener.propertyChange(BasicTextUI.java:300) > at java.beans.PropertyChangeSupport.doFirePropertyChange(PropertyChangeSupport.java:332) > at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:56) > at java.awt.Component.firePropertyChangeImpl(Component.java:1666) > at java.awt.Component.firePropertyChange(Component.java:1680) > at java.awt.Component.setFont(Component.java:3104) > at java.awt.Container.setFont(Container.java:1059) > at test.testRun(test.java:14) > at java.lang.reflect.VMReflection.invokeMethod(Native Method) > at test.main(test.java:10) > FAILURES!!! > Tests run: 1, Failures: 0, Errors: 1 > ====================================== > The reason of failure is uncompatible behavior with RI of the updating font style in javax.swing.plaf.basic.BasicTextPaneUI. > After innvestigation of this problem I found that in Harmony we do nothing if font is null, or trying to access it's fields. And in RI if font is null its style attributes related to Font just removed. > I'll provide unit test and fix for this issue. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.