Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 4636 invoked from network); 22 Mar 2007 14:37:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Mar 2007 14:37:54 -0000 Received: (qmail 35898 invoked by uid 500); 22 Mar 2007 14:38:02 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 35869 invoked by uid 500); 22 Mar 2007 14:38: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 35839 invoked by uid 99); 22 Mar 2007 14:38:02 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Mar 2007 07:38:02 -0700 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, 22 Mar 2007 07:37:53 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DD4F2714057 for ; Thu, 22 Mar 2007 07:37:32 -0700 (PDT) Message-ID: <16307397.1174574252866.JavaMail.jira@brutus> Date: Thu, 22 Mar 2007 07:37:32 -0700 (PDT) From: "Andrey Pavlenko (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-3430) [classlib][awt] DebugGraphics.getClip() throws NPE In-Reply-To: <13588178.1174330892452.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-3430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483156 ] Andrey Pavlenko commented on HARMONY-3430: ------------------------------------------ BTW, new DebugGraphics().getClip(); also throws NPE on RI. It looks like on RI this method is not invoked by Container.paint(). > [classlib][awt] DebugGraphics.getClip() throws NPE > -------------------------------------------------- > > Key: HARMONY-3430 > URL: https://issues.apache.org/jira/browse/HARMONY-3430 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Vasily Zakharov > Assigned To: Alexey Petrenko > Priority: Minor > > Consider the following test: > import java.awt.Container; > import javax.swing.DebugGraphics; > public class Test { > public static void main(String args[]) throws Exception { > new Container().paint(new DebugGraphics()); > System.out.println("SUCCESS"); > } > } > Output on RI: > SUCCESS > Output on Harmony: > Exception in thread "main" java.lang.NullPointerException > at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769) > at java.awt.Container.paintComponentsImpl(Container.java:996) > at java.awt.Container.paint(Container.java:936) > at Test.main(Test.java:6) > The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor. > The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly. > The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.