Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 70529 invoked from network); 2 Mar 2007 07:31:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Mar 2007 07:31:12 -0000 Received: (qmail 24733 invoked by uid 500); 2 Mar 2007 07:31:20 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 24638 invoked by uid 500); 2 Mar 2007 07:31:20 -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 24623 invoked by uid 99); 2 Mar 2007 07:31:20 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Mar 2007 23:31:20 -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; Thu, 01 Mar 2007 23:31:11 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id ED7557142E4 for ; Thu, 1 Mar 2007 23:30:50 -0800 (PST) Message-ID: <28639669.1172820650970.JavaMail.jira@brutus> Date: Thu, 1 Mar 2007 23:30:50 -0800 (PST) From: "Alexey Petrenko (JIRA)" To: commits@harmony.apache.org Subject: [jira] Resolved: (HARMONY-3204) [awt] Window.pack() throws NPE if the font of nested components is not set In-Reply-To: <710476.1171968485675.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-3204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexey Petrenko resolved HARMONY-3204. -------------------------------------- Resolution: Fixed The patch has been applied. Please verify. > [awt] Window.pack() throws NPE if the font of nested components is not set > -------------------------------------------------------------------------- > > Key: HARMONY-3204 > URL: https://issues.apache.org/jira/browse/HARMONY-3204 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Andrey Pavlenko > Assigned To: Alexey Petrenko > Attachments: HARMONY-3204-Window.patch, HARMONY-3204-WindowTest.patch > > > The method Window.pack() throws NPE if the font of nested components is not set. See the following example. > public void testPack() { > final Frame f = new Frame(); > final Button b = new Button(); > assertNull(b.getFont()); > f.add(b); > assertNull(b.getFont()); > assertFalse(b.isDisplayable()); > f.pack(); > assertTrue(f.isDisplayable()); > assertTrue(b.isDisplayable()); > assertNotNull(b.getFont()); > assertNotNull(f.getFont()); > f.dispose(); > } > Output: > 1) testPack(AwtTest)java.lang.NullPointerException > at org.apache.harmony.awt.gl.font.FontMetricsImpl.getFontPeer(FontMetricsImpl.java:240) > at org.apache.harmony.awt.gl.font.FontMetricsImpl.(FontMetricsImpl.java:60) > at org.apache.harmony.awt.gl.CommonGraphics2DFactory.getFontMetrics(CommonGraphics2DFactory.java:57) > at java.awt.ToolkitImpl.getFontMetrics(ToolkitImpl.java:136) > at java.awt.Component$ComponentState.getFontMetrics(Component.java:773) > at org.apache.harmony.awt.theme.DefaultButton.calculate(DefaultButton.java) > at org.apache.harmony.awt.Theme.calculateButton(Theme.java) > at java.awt.Button$State.calculate(Button.java:125) > at java.awt.Button.addNotify(Button.java:203) > at java.awt.Container.addNotify(Container.java:447) > at java.awt.Window.addNotify(Window.java:207) > at java.awt.Frame.addNotify(Frame.java:185) > at java.awt.Component.mapToDisplay(Component.java:1412) > at java.awt.Container.mapToDisplay(Container.java) > at java.awt.Window.pack(Window.java:697) > at AwtTest.testPack(AwtTest.java:146) > at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java) > at AwtTest.main(AwtTest.java:176) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.