This patch fixes some failing Mauve tests: 2005-10-18 David Gilbert <[EMAIL PROTECTED]>
* javax/swing/JComboBox.java (setModel): update the selectedItemReminder field, (selectedItemChanged): only send ItemEvent.SELECTED event if the new selection is non-null. Regards, Dave
Index: javax/swing/JComboBox.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JComboBox.java,v retrieving revision 1.21 diff -u -r1.21 JComboBox.java --- javax/swing/JComboBox.java 12 Oct 2005 12:38:20 -0000 1.21 +++ javax/swing/JComboBox.java 18 Oct 2005 16:36:35 -0000 @@ -311,7 +311,8 @@ // Stores old data model for event notification. ComboBoxModel oldDataModel = dataModel; dataModel = newDataModel; - + selectedItemReminder = newDataModel.getSelectedItem(); + // Notifies the listeners of the model change. firePropertyChange("model", oldDataModel, dataModel); } @@ -901,8 +902,9 @@ // Fire ItemEvent to indicate that new item is selected Object newSelection = getSelectedItem(); - fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, - newSelection, ItemEvent.SELECTED)); + if (newSelection != null) + fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, + newSelection, ItemEvent.SELECTED)); // Fire Action Event to JComboBox's registered listeners fireActionEvent();
_______________________________________________ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches