Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 33568 invoked from network); 15 Mar 2007 17:55:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Mar 2007 17:55:31 -0000 Received: (qmail 7958 invoked by uid 500); 15 Mar 2007 17:55:39 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 7931 invoked by uid 500); 15 Mar 2007 17:55:39 -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 7913 invoked by uid 99); 15 Mar 2007 17:55:39 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2007 10:55:39 -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, 15 Mar 2007 10:55:30 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BF607714084 for ; Thu, 15 Mar 2007 10:55:09 -0700 (PDT) Message-ID: <28145721.1173981309781.JavaMail.jira@brutus> Date: Thu, 15 Mar 2007 10:55:09 -0700 (PDT) From: "Alexey Petrenko (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-2853) [classlib][swing] j.s.plaf.basic.BasicScrollBarUI.configureScrollBarColors() doesn't throw NPE In-Reply-To: <21253396.1166794824208.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-2853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12481256 ] Alexey Petrenko commented on HARMONY-2853: ------------------------------------------ Sergey, your patch throws NPE in case of thumbColor or thumbDarkShadowColor and other colors are nulls. I've modified the original test a little. === cut === public class Test { private static class TestBasicScrollBarUI extends BasicScrollBarUI { @Override public void configureScrollBarColors() { super.configureScrollBarColors(); } } public static void main(String[] args) { TestBasicScrollBarUI sbr = new TestBasicScrollBarUI(); sbr.installUI(new JScrollBar()); // added string sbr.configureScrollBarColors(); } } === cut === And RI stops throwing NPE while Harmony with your patch still throws it. This means that RI throws NPE in case of scrollbar field is null but not thumbColor or thumbDarkShadowColor and other colors are nulls. So your patch does not fix the original issue and introduces regression to Harmony code and it can not be applied. Please be more careful with your patches. Thanks in advance. SY, Alexey P.S. I'll create a new patch myself. > [classlib][swing] j.s.plaf.basic.BasicScrollBarUI.configureScrollBarColors() doesn't throw NPE > ---------------------------------------------------------------------------------------------- > > Key: HARMONY-2853 > URL: https://issues.apache.org/jira/browse/HARMONY-2853 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Alexey A. Ivanov > Assigned To: Alexey Petrenko > Priority: Minor > Attachments: Harmony-2853-BasicScrollBarUI.patch, Harmony-2853-BasicScrollBarUITest.patch > > > ======= Code to Reproduce ======= > import javax.swing.plaf.basic.BasicScrollBarUI; > public class Test { > private static class TestBasicScrollBarUI extends BasicScrollBarUI { > @Override > public void configureScrollBarColors() { > super.configureScrollBarColors(); > } > } > public static void main(String[] args) { > TestBasicScrollBarUI sbr = new TestBasicScrollBarUI(); > sbr.configureScrollBarColors(); > } > } > ======= end of code ======= > Harmony works silently, but RI throws NPE: > java.lang.NullPointerException > at javax.swing.LookAndFeel.installColors(LookAndFeel.java:56) > at javax.swing.plaf.basic.BasicScrollBarUI.configureScrollBarColors(BasicScrollBarUI.java:113) > at Test$TestBasicScrollBarUI.configureScrollBarColors(Test.java:7) > at Test.main(Test.java:13) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.