JDK-4472389 : IllegalArgumentException thrown by JComboBox.setSelectedIndex() on Sol9,java 1.4
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: solaris_9,2.0_beta,1.4.0
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_9,windows_2000
  • CPU: x86,sparc
  • Submitted: 2001-06-20
  • Updated: 2002-01-15
  • Resolved: 2001-06-22
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.
Other
1.4.0 beta2Fixed
Related Reports
Duplicate :  
Description
Attached is a test java source (ComboBoxSol9Bug.java) which creates a JDialog with a simple JComboBox. The sample code compiles and runs fine on Solaris 8 and Solaris 9 (java version Solaris VM (build Solaris_JDK_1.2.2_08, native threads, sunwjit).

However, the following exception gets thrown on Solaris 9 with Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta_refresh-b67):

Exception in thread "main" java.lang.IllegalArgumentException: setSelectedIndex: 0 out of bounds
        at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:593)
        at ComboBoxSol9Bug.modifyComboList(ComboBoxSol9Bug.java:36)
        at ComboBoxSol9Bug.<init>(ComboBoxSol9Bug.java:17)
        at ComboBoxSol9Bug.main(ComboBoxSol9Bug.java:24)


Please let me know if I'm doing something wrong.  We are hoping this issue would get resolved quickly as it makes our application (ShowMeTV2.0) unusable in Solaris 9 + default java configuration.  (cross reference bugID 4466457).

=============================================================================
Verified in MB91 

###@###.### 2002-01-15
==============================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin-beta2 FIXED IN: merlin-beta2 INTEGRATED IN: merlin-beta2 VERIFIED IN: merlin-rc1
14-06-2004

PUBLIC COMMENTS .
10-06-2004

EVALUATION The java_solaris category is reserved for bugs in Java 1.2.2 and earlier. Moving to the java/classes_awt category. james.melvin@East 2001-06-20 Since the Description references Swing code, I'll let swing take the first cut at this. eric.hawkes@eng 2001-06-20 This bug was introduced in jdk 1.4.b59 as a result of the fix to bug 4413653. The reason that this has regressed is that the constructor of DefaultComboBoxModel stores a clone of the Vector passed as the argument rather than a reference. I think I'm going to roll back the bug fix because this was the previous semantics of the combo box model and applications (like this one) may rely on these semantics. I want to make this very clear: direct manipulation of the Vector outside of the framework of the combo box and combo box model is a *very bad* idea. You should be using either JComboBox.addItem() or MutableComboBoxModel.addElement() to add elements to the combo box so that the ui or the registered listeners are correctly notified of the contect changes. mark.davidson@Eng 2001-06-20 baskaran.vijayakumar@eng 2001-06-21 I'm reducing the priority and severity of this bug since we have worked out an alternative (in line with Mark's suggestion) which no longer makes the application throw an exception. As a result, this bug is no longer a show-stopper as far as ShowMeTV2.0 is concerned. baskaran.vijayakumar@eng 2001-06-21 Cleared the Program Management field.
21-06-2001