Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 23069 invoked from network); 7 Feb 2007 00:42:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Feb 2007 00:42:27 -0000 Received: (qmail 16764 invoked by uid 500); 7 Feb 2007 00:42:34 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 16662 invoked by uid 500); 7 Feb 2007 00:42:33 -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 16653 invoked by uid 99); 7 Feb 2007 00:42:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Feb 2007 16:42:33 -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; Tue, 06 Feb 2007 16:42:26 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C58FF7142BF for ; Tue, 6 Feb 2007 16:42:05 -0800 (PST) Message-ID: <1222044.1170808925806.JavaMail.jira@brutus> Date: Tue, 6 Feb 2007 16:42:05 -0800 (PST) From: "Vasily Zakharov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-2613) [classlib][swing][plaf] javax.swing.plaf.basic.BasicTableUI methods throw unspecified NPE if UI is not attached to a table In-Reply-To: <33027441.1165852701208.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-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vasily Zakharov updated HARMONY-2613: ------------------------------------- Attachment: Harmony-2613-Make.patch Harmony-2613-Fix-BasicTableHeaderUI.patch Harmony-2613-Fix-BasicTableUI.patch While regression is unclear, the fix looks pretty trivial. Attached fix patches (may be applied independently) and a make patch to remove javax/swing/plaf/basic/BasicTableUITest from make/exclude.common. > [classlib][swing][plaf] javax.swing.plaf.basic.BasicTableUI methods throw unspecified NPE if UI is not attached to a table > -------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-2613 > URL: https://issues.apache.org/jira/browse/HARMONY-2613 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Anton Luht > Priority: Minor > Attachments: Harmony-2613-Fix-BasicTableHeaderUI.patch, Harmony-2613-Fix-BasicTableUI.patch, Harmony-2613-Make.patch > > > If BasicTableUI is not attached to a JTable (for example, using installUI), calling some methods on it cause NPE. Please see the code below for example, but the code inspection shows that there are many methods that can cause similar effect (direct calling methods of member 'table' without checking it for null) . If you uncomment line with 'installUI', the test will work on Harmony as well as on RI > Code to reproduce: > import javax.swing.plaf.basic.*; > import javax.swing.*; > import java.awt.*; > import java.awt.event.MouseWheelEvent; > public class Test > { > public static MouseWheelEvent getEvent() { > Label l = new Label(); > return new MouseWheelEvent(l, 0, 0, 0, 0, 0, 0, false, 0, > MouseWheelEvent.WHEEL_UNIT_SCROLL, 0); > } > public static void main(String args[]) { > BasicTableUI localBasicTableUI = new BasicTableUI(); > //localBasicTableUI.installUI(new JTable()); > BasicTableUI.MouseInputHandler > localBasicTableUI$MouseInputHandler = localBasicTableUI.new > MouseInputHandler(); > MouseWheelEvent localMouseWheelEvent = getEvent(); > try { > > localBasicTableUI$MouseInputHandler.mousePressed(localMouseWheelEvent); > System.out.println("mousePressed work silently"); > } catch (NullPointerException e) { > e.printStackTrace(); > System.out.println("Got NullPointerException"); > } > } > } > output in RI: > java version "1.5.0_06" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05) > Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode) > mousePressed work silently > Output in Harmony: > Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundatio > n or its licensors, as applicable. > java version "1.5.0" > pre-alpha : not complete or compatible > svn = r485537, (Dec 11 2006), Windows/ia32/msvc 1310, debug build > http://incubator.apache.org/harmony > java.lang.NullPointerException > at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.mousePressed(Ba > sicTableUI.java:122) > at Test.main(Test.java:20) > Got NullPointerException -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.