United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6463235 Regression on combo boxes in b96 of Mustang
JDK-6463235 : Regression on combo boxes in b96 of Mustang

Details
Type:
Bug
Submit Date:
2006-08-23
Status:
Resolved
Updated Date:
2011-01-22
Project Name:
JDK
Resolved Date:
2006-08-31
Component:
client-libs
OS:
windows_2000
Sub-Component:
javax.swing
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Relates:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b96)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b96, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows 2000 [Version 5.00.2195]

A DESCRIPTION OF THE PROBLEM :
The code in BasicLookAndFeel initComponentDefaults is:

	    "ComboBox.ancestorInputMap",
            "ComboBox.isEnterSelectablePopup", Boolean.FALSE,
	       new UIDefaults.LazyInputMap(new Object[] {
		      "ESCAPE", "hidePopup",
		     "PAGE_UP", "pageUpPassThrough",
		   "PAGE_DOWN", "pageDownPassThrough",
		        "HOME", "homePassThrough",
		         "END", "endPassThrough",
		       "ENTER", "enterPressed"
		 }),

while it should be

            "ComboBox.isEnterSelectablePopup", Boolean.FALSE,
	    "ComboBox.ancestorInputMap",
	       new UIDefaults.LazyInputMap(new Object[] {
		      "ESCAPE", "hidePopup",
		     "PAGE_UP", "pageUpPassThrough",
		   "PAGE_DOWN", "pageDownPassThrough",
		        "HOME", "homePassThrough",
		         "END", "endPassThrough",
		       "ENTER", "enterPressed"
		 }),

The result is that for *all* third-party LAFs that extend Basic and not Metal, there's a ClassCastException in BasicComboBoxUI.getInputMap since the "ComboBox.ancestorInputMap" points to a string "ComboBox.isEnterSelectablePopup" and not to a InputMap

REGRESSION.  Last worked in version mustang


REPRODUCIBILITY :
This bug can be reproduced always.

Release Regression From : mustang
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.
The bug is a regression of the 6428549.

                                    

Comments
EVALUATION

It is a regression of the 6428549.

The problem is completely written in the description. In couple of words: there is a typo in the BasicLookAndFeel.initComponentDefaults() method. Two adjacent lines of code is swapped.

The code is:
828  "ComboBox.ancestorInputMap",
829  "ComboBox.isEnterSelectablePopup", Boolean.FALSE,
830      new UIDefaults.LazyInputMap(new Object[] {

The code should be:
828  "ComboBox.isEnterSelectablePopup", Boolean.FALSE,
829  "ComboBox.ancestorInputMap",
830      new UIDefaults.LazyInputMap(new Object[] {

It leads to a ClassCastException when using BasicComboBoxUI.getInputMap() since the "ComboBox.ancestorInputMap" points to a string "ComboBox.isEnterSelectablePopup" and not to a InputMap.
                                     
2006-08-24
SUGGESTED FIX

+++ BasicLookAndFeel.java        Thu Aug 24 20:49:41 2006
@@ -823,12 +823,12 @@
             "ComboBox.selectionBackground", textHighlight,
             "ComboBox.selectionForeground", textHighlightText,
             "ComboBox.disabledBackground", control,
             "ComboBox.disabledForeground", textInactiveText,
              "ComboBox.timeFactor", oneThousand,
-            "ComboBox.ancestorInputMap",
             "ComboBox.isEnterSelectablePopup", Boolean.FALSE,                
+            "ComboBox.ancestorInputMap",
                new UIDefaults.LazyInputMap(new Object[] {
                       "ESCAPE", "hidePopup",
                      "PAGE_UP", "pageUpPassThrough",
                    "PAGE_DOWN", "pageDownPassThrough",
                         "HOME", "homePassThrough",
                                     
2006-08-31



Hardware and Software, Engineered to Work Together