United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4909150 WindowsTreeUI can cause NullPointerException occasionally
JDK-4909150 : WindowsTreeUI can cause NullPointerException occasionally

Details
Type:
Bug
Submit Date:
2003-08-19
Status:
Closed
Updated Date:
2012-12-04
Project Name:
JDK
Resolved Date:
2012-06-06
Component:
client-libs
OS:
windows_2000
Sub-Component:
javax.swing
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.4.2
Fixed Versions:

Related Reports
Backport:
Relates:
Relates:

Sub Tasks

Description

Name: jk109818			Date: 08/19/2003


FULL PRODUCT VERSION :
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)

FULL OS VERSION :
Microsoft Windows 2000 [Version 5.00.2195]

A DESCRIPTION OF THE PROBLEM :
WindowsTreeUI.ensureRowsAreVisible remembers to check for getPathBounds returning null in the 1st half of the method, but forgets to check for it in the 2nd half of the method.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just looking at the WindowsTreeUI.ensureRowsAreVisible shows why this problem is occuring, simply checking for testRect == null like the same method already does with scrollBounds will fix the problem, hence I am not providing a test case.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
no exception
ACTUAL -
NullPointerException

ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.NullPointerException
	at com.sun.java.swing.plaf.windows.WindowsTreeUI.ensureRowsAreVisible(WindowsTreeUI.java:91)
	at javax.swing.plaf.basic.BasicTreeUI.toggleExpandState(BasicTreeUI.java:2099)
	at javax.swing.plaf.basic.BasicTreeUI.handleExpandControlClick(BasicTreeUI.java:2082)
	at javax.swing.plaf.basic.BasicTreeUI.checkForClickInExpandControl(BasicTreeUI.java:2036)
	at javax.swing.plaf.basic.BasicTreeUI$MouseHandler.handleSelection(BasicTreeUI.java:2831)
	at javax.swing.plaf.basic.BasicTreeUI$MouseHandler.mouseReleased(BasicTreeUI.java:2864)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:232)
	at java.awt.Component.processMouseEvent(Component.java:5100)
	at java.awt.Component.processEvent(Component.java:4897)
	at java.awt.Container.processEvent(Container.java:1569)
	at java.awt.Component.dispatchEventImpl(Component.java:3615)
	at java.awt.Container.dispatchEventImpl(Container.java:1627)
	at java.awt.Component.dispatchEvent(Component.java:3477)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
	at java.awt.Container.dispatchEventImpl(Container.java:1613)
	at java.awt.Window.dispatchEventImpl(Window.java:1606)
	at java.awt.Component.dispatchEvent(Component.java:3477)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

REPRODUCIBILITY :
This bug can be reproduced occasionally.

---------- BEGIN SOURCE ----------
See steps to reproduce.
---------- END SOURCE ----------
(Incident Review ID: 191525) 
======================================================================

                                    

Comments
EVALUATION



Name: apR10133			Date: 09/04/2003


This changes have a sense. We need to do this.
###@###.###


======================================================================

Name: apR10133			Date: 09/16/2003


The WindowsTreeUI.ensureRowsAreVisible is called with a valid rows only.
###@###.###
======================================================================
                                     
2004-08-24



Hardware and Software, Engineered to Work Together