<Swing Dev> 6179357: Generics: JList: Constructors & Model
Thomas.Hawtin at Sun.COM
Thu Mar 12 09:56:49 PDT 2009
Alexander Potochkin wrote:
>> Hi Florian,
>> I'd like more consistent variant #2 because of the
>> javax.swing.ComboBoxModel#setSelectedItem() method prevents to use
>> construction like "<? extends E>" in the JComboBox class (as you
>> noticed before)...
> I second Pavel, "<? extends E>" doesn't work well for getters/setters
> #2 is preferable
Remember Josh Bloch's PECS: Producers Extends; Consumers Super.
A model is both a producer and a consumer, so we want <? extends E super
E>, i.e. <E>.
More information about the swing-dev