Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 39826 - [CellEditors] validator on ComboBoxCellEditor with editable combo box throws ArrayIndexOutOfBoundsException when new input is not valid
Summary: [CellEditors] validator on ComboBoxCellEditor with editable combo box throws ...
Status: RESOLVED DUPLICATE of bug 60462
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: Other Linux-GTK
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Nick Edgar CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-09 13:43 EDT by contus CLA
Modified: 2005-07-19 13:02 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description contus CLA 2003-07-09 13:43:07 EDT
Create a ComboBoxCellEditor with an editable combo box. Associate a validator 
with the cell editor. Enter text into the combo box which is not (yet) part of 
the items of the combo box. Within the validator's isValid-method, return an 
error message for that input. An ArrayIndexOutOfBoundsException is thrown. 
 
Reason: In the method applyEditorValueAndDeactivate() a ComboBoxCellEditor 
retrieves the selection index of the combo box, with is -1 when the entered 
text is not found in the items list of the combo box. When a validator 
determines that the input is not valid, an error message is constructed within 
that method via 
 
setErrorMessage(MessageFormat.format(getErrorMessage(), new Object[] 
{items[selection]}));  
 
which fails for selection = -1.
Comment 1 Eric Moffatt CLA 2005-07-19 10:26:31 EDT
Nick, this looks to be a duplicate of 60462.

Comment 2 Nick Edgar CLA 2005-07-19 13:02:13 EDT
Indeed it does.  Closing as a dup of the (later) bug 60462 since that report has
more details.


*** This bug has been marked as a duplicate of 60462 ***