-
Bug
-
Resolution: Incomplete
-
P4
-
None
-
8u212
-
x86_64
-
windows_10
ADDITIONAL SYSTEM INFORMATION :
I'm using Eclipse to develop on Windows 10.
A DESCRIPTION OF THE PROBLEM :
When I initialize multiple DefaultComboBoxModel objects with the same Vector object, and then I modify one of the DefaultComboBoxModel objects (by adding or removing items), the other ComboBoxe are also modified.
This is unexpected because the constructor that takes a Vector says it initializes with that Vector (it looks just like the constructor that initializes with an array).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create several ComboBox<String> objects, and add them to an interface.
Create a Vector<String> (initially empty),
For each ComboBox, setModel to a new DefaultComboBoxModel<String>, initialized with the Vector.
Create a String.
Call addElement(String) on each ComboBox.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Each ComboBox will have only one element.
ACTUAL -
Each ComboBox has several elements.
CUSTOMER SUBMITTED WORKAROUND :
Initialize DefaultComboBoxModel without a Vector, and then loop through the Vector to add each element.
FREQUENCY : always
I'm using Eclipse to develop on Windows 10.
A DESCRIPTION OF THE PROBLEM :
When I initialize multiple DefaultComboBoxModel objects with the same Vector object, and then I modify one of the DefaultComboBoxModel objects (by adding or removing items), the other ComboBoxe are also modified.
This is unexpected because the constructor that takes a Vector says it initializes with that Vector (it looks just like the constructor that initializes with an array).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create several ComboBox<String> objects, and add them to an interface.
Create a Vector<String> (initially empty),
For each ComboBox, setModel to a new DefaultComboBoxModel<String>, initialized with the Vector.
Create a String.
Call addElement(String) on each ComboBox.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Each ComboBox will have only one element.
ACTUAL -
Each ComboBox has several elements.
CUSTOMER SUBMITTED WORKAROUND :
Initialize DefaultComboBoxModel without a Vector, and then loop through the Vector to add each element.
FREQUENCY : always