JDK-6463235 : Regression on combo boxes in b96 of Mustang
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2006-08-23
  • Updated: 2011-01-22
  • Resolved: 2006-08-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b98Fixed
Related Reports
Relates :  
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
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",
31-08-2006

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.
24-08-2006