United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4649110 : 1.4 REGRESSION: NullPointerException for UIManager.put(Object key, Object value)

Details
Type:
Bug
Submit Date:
2002-03-07
Status:
Resolved
Updated Date:
2003-04-12
Project Name:
JDK
Resolved Date:
2002-08-12
Component:
client-libs
OS:
windows_2000
Sub-Component:
javax.swing
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.4.0
Fixed Versions:
1.4.2 (mantis)

Related Reports

Sub Tasks

Description

Name: jk109818			Date: 03/07/2002


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

FULL OPERATING SYSTEM VERSION :
Windows 2000 SP2

A DESCRIPTION OF THE PROBLEM :
This technique to get rid of the stippling texture on the
cross-platform UI's toolbars no longer works in the released
version of J2SE 1.4.0 (worked fine in J2SE 1.2 and 1.3:


UIManager.put("ScrollBarUI",
"com.sun.java.swing.plaf.windows.WindowsScrollBarUI");


REGRESSION.  Last worked in version 1.3.1

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Use above code.
2. Watch it get a null pointer exception.


EXPECTED VERSUS ACTUAL BEHAVIOR :
The scrollbar should be the Windows style w/ no stippling.
Instead, you'll get a stack trace from a null pointer
exception.



ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.lang.NullPointerException
                 at
com.sun.java.swing.plaf.windows.WindowsScrollBarUI$Grid.getGrid(Windo
                 wsScrollBarUI.java:198)
                 at
com.sun.java.swing.plaf.windows.WindowsScrollBarUI.configureScrollBar
                 Colors(WindowsScrollBarUI.java:52)
                 at
javax.swing.plaf.basic.BasicScrollBarUI.installDefaults(BasicScrollBa
                 rUI.java:160)
                 at
javax.swing.plaf.basic.BasicScrollBarUI.installUI(BasicScrollBarUI.ja
                 va:102)
                 at javax.swing.JComponent.setUI(JComponent.java:445)
                 at javax.swing.JScrollBar.setUI(JScrollBar.java:185)
                 at javax.swing.JScrollBar.updateUI(JScrollBar.java:205)
                 at javax.swing.JScrollBar.<init>(JScrollBar.java:139)
                 at javax.swing.JScrollBar.<init>(JScrollBar.java:154)
                 at
javax.swing.JScrollPane$ScrollBar.<init>(JScrollPane.java:674)
                 at
javax.swing.JScrollPane.createVerticalScrollBar(JScrollPane.java:819)

                 at javax.swing.JScrollPane.<init>(JScrollPane.java:261)
                 at javax.swing.JScrollPane.<init>(JScrollPane.java:313)
                 at
FileSystemTreeScrollPane.<init>(FileSystemTreeScrollPane.java)
                 at
FileSystemTreeScrollPane.<init>(FileSystemTreeScrollPane.java)
                 at BrowserSplitPane.<init>(BrowserSplitPane.java)
                 at TriSplitPane.<init>(TriSplitPane.java)
                 at TransMedia.init(TransMedia.java)
                 at TransMedia.main(TransMedia.java)

This bug can be reproduced always.

---------- BEGIN SOURCE ----------
UIManager.put("ScrollBarUI",
                 "com.sun.java.swing.plaf.windows.WindowsScrollBarUI");
---------- END SOURCE ----------

CUSTOMER WORKAROUND :
None.
Comment out this line of code and your program will run
under JDK1.4.0.

Release Regression From : 1.3.1
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Review ID: 139822) 
======================================================================

                                    

Comments
EVALUATION

WindowsScrollBarUI is assuming the colors from the defaults table will be non-null.
###@###.### 2002-05-17

While you should not assume you can use one UI class with another class, I am
fixing this because it is such a simple change.
###@###.### 2002-07-18
                                     
2002-05-17
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mantis
mantis-b02

FIXED IN:
mantis
mantis-b02

INTEGRATED IN:
mantis
mantis-b02


                                     
2004-06-14



Hardware and Software, Engineered to Work Together