Index: trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java	(revision 7015)
@@ -48,6 +48,6 @@
 
     /** the combo box used as editor */
-    private JosmComboBox editor;
-    private DefaultComboBoxModel editorModel;
+    private JosmComboBox<Object> editor;
+    private DefaultComboBoxModel<Object> editorModel;
     private CopyOnWriteArrayList<NavigationListener> listeners;
 
@@ -78,6 +78,6 @@
      */
     public MultiValueCellEditor() {
-        editorModel = new DefaultComboBoxModel();
-        editor = new JosmComboBox(editorModel) {
+        editorModel = new DefaultComboBoxModel<>();
+        editor = new JosmComboBox<Object>(editorModel) {
             @Override
             public void processKeyEvent(KeyEvent e) {
@@ -172,5 +172,5 @@
      *
      */
-    private static class EditorCellRenderer extends JLabel implements ListCellRenderer {
+    private static class EditorCellRenderer extends JLabel implements ListCellRenderer<Object> {
 
         /**
@@ -224,5 +224,5 @@
 
         @Override
-        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+        public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
             renderColors(isSelected);
             renderValue(value);
Index: trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionEditor.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionEditor.java	(revision 7015)
@@ -12,5 +12,5 @@
 import org.openstreetmap.josm.gui.widgets.JosmComboBox;
 
-public class RelationMemberConflictDecisionEditor extends JosmComboBox implements TableCellEditor {
+public class RelationMemberConflictDecisionEditor extends JosmComboBox<RelationMemberConflictDecisionType> implements TableCellEditor {
 
     /**
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 7015)
@@ -154,5 +154,5 @@
          * @see Arrays#asList(Object[])
          */
-        public static List list(Object... args) {
+        public static List<Object> list(Object... args) {
             return Arrays.asList(args);
         }
Index: trunk/src/org/openstreetmap/josm/gui/oauth/AuthorizationProcedureComboBox.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/oauth/AuthorizationProcedureComboBox.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/oauth/AuthorizationProcedureComboBox.java	(revision 7015)
@@ -13,5 +13,5 @@
 import org.openstreetmap.josm.gui.widgets.JosmComboBox;
 
-public class AuthorizationProcedureComboBox extends JosmComboBox {
+public class AuthorizationProcedureComboBox extends JosmComboBox<AuthorizationProcedure> {
 
     /**
Index: trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java	(revision 7015)
@@ -61,5 +61,5 @@
     private JRadioButton colorTypeNone = new JRadioButton(tr("Single Color (can be customized for named layers)"));
     private JRadioButton colorTypeGlobal  = new JRadioButton(tr("Use global settings"));
-    private JosmComboBox colorTypeVelocityTune = new JosmComboBox(new String[] {tr("Car"), tr("Bicycle"), tr("Foot")});
+    private JosmComboBox<String> colorTypeVelocityTune = new JosmComboBox<>(new String[] {tr("Car"), tr("Bicycle"), tr("Foot")});
     private JCheckBox makeAutoMarkers = new JCheckBox(tr("Create markers when reading GPX"));
     private JCheckBox drawGpsArrows = new JCheckBox(tr("Draw Direction Arrows"));
@@ -67,7 +67,7 @@
     private JosmTextField drawGpsArrowsMinDist = new JosmTextField(8);
     private JCheckBox colorDynamic = new JCheckBox(tr("Dynamic color range based on data limits"));
-    private JosmComboBox waypointLabel = new JosmComboBox(LABEL_PATTERN_DESC);
+    private JosmComboBox<String> waypointLabel = new JosmComboBox<>(LABEL_PATTERN_DESC);
     private JosmTextField waypointLabelPattern = new JosmTextField();
-    private JosmComboBox audioWaypointLabel = new JosmComboBox(LABEL_PATTERN_DESC);
+    private JosmComboBox<String> audioWaypointLabel = new JosmComboBox<>(LABEL_PATTERN_DESC);
     private JosmTextField audioWaypointLabelPattern = new JosmTextField();
     private JCheckBox useGpsAntialiasing = new JCheckBox(tr("Smooth GPX graphics (antialiasing)"));
@@ -368,5 +368,4 @@
     }
 
-
     /**
      * Save preferences from UI controls, globally or for a specified layer.
@@ -443,5 +442,5 @@
     }
 
-    private void updateWaypointLabelCombobox(JosmComboBox cb, JosmTextField tf, TemplateEntryProperty property) {
+    private void updateWaypointLabelCombobox(JosmComboBox<String> cb, JosmTextField tf, TemplateEntryProperty property) {
         String labelPattern = property.getAsString();
         boolean found = false;
@@ -460,5 +459,5 @@
     }
 
-    private void updateWaypointPattern(JosmComboBox cb, JosmTextField tf) {
+    private void updateWaypointPattern(JosmComboBox<String> cb, JosmTextField tf) {
         if (cb.getSelectedIndex() == WAYPOINT_LABEL_CUSTOM) {
             tf.setEnabled(true);
Index: trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java	(revision 7015)
@@ -49,5 +49,5 @@
      * ComboBox with all look and feels.
      */
-    private JosmComboBox lafCombo;
+    private JosmComboBox<LookAndFeelInfo> lafCombo;
     JPanel panel;
     private JCheckBox showSplashScreen = new JCheckBox(tr("Show splash screen at startup"));
@@ -59,5 +59,5 @@
     @Override
     public void addGui(PreferenceTabbedPane gui) {
-        lafCombo = new JosmComboBox(UIManager.getInstalledLookAndFeels());
+        lafCombo = new JosmComboBox<>(UIManager.getInstalledLookAndFeels());
 
         // let's try to load additional LookAndFeels and put them into the list
Index: trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java	(revision 7015)
@@ -44,5 +44,5 @@
 
     /** the combo box with the available locales */
-    private JosmComboBox langCombo;
+    private JosmComboBox<Locale> langCombo;
 
     @Override
@@ -52,5 +52,5 @@
         // See https://stackoverflow.com/questions/3194958/fast-replacement-for-jcombobox-basiccomboboxui
         model.selectLanguage(Main.pref.get("language"));
-        langCombo = new JosmComboBox(model);
+        langCombo = new JosmComboBox<>(model);
         langCombo.setRenderer(new LanguageCellRenderer(langCombo.getRenderer()));
 
@@ -75,5 +75,5 @@
     }
 
-    private static class LanguageComboBoxModel extends DefaultComboBoxModel {
+    private static class LanguageComboBoxModel extends DefaultComboBoxModel<Locale> {
         private final List<Locale> data = new ArrayList<>();
 
@@ -99,5 +99,5 @@
 
         @Override
-        public Object getElementAt(int index) {
+        public Locale getElementAt(int index) {
             return data.get(index);
         }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java	(revision 7015)
@@ -38,5 +38,5 @@
     private final JCheckBox endpoint = new JCheckBox(tr("Store WMS endpoint only, select layers at usage"));
     private final WMSLayerTree tree = new WMSLayerTree();
-    private final JComboBox formats = new JComboBox();
+    private final JComboBox<String> formats = new JComboBox<>();
     private final JLabel wmsInstruction;
     private final JosmTextArea wmsUrl = new JosmTextArea(3, 40);
@@ -77,5 +77,5 @@
                     wms.attemptGetCapabilities(rawUrl.getText());
                     tree.updateTree(wms);
-                    formats.setModel(new DefaultComboBoxModel(wms.getFormats().toArray()));
+                    formats.setModel(new DefaultComboBoxModel<>(wms.getFormats().toArray(new String[0])));
                     formats.setSelectedItem(wms.getPreferredFormats());
                 } catch (MalformedURLException ex) {
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/CommonSettingsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/CommonSettingsPanel.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/CommonSettingsPanel.java	(revision 7015)
@@ -30,5 +30,5 @@
     private final JButton btnFadeColor;
     private final JSlider fadeAmount = new JSlider(0, 100);
-    private final JosmComboBox sharpen;
+    private final JosmComboBox<String> sharpen;
 
     /**
@@ -65,5 +65,5 @@
         add(this.fadeAmount, GBC.eol().fill(GBC.HORIZONTAL));
 
-        this.sharpen = new JosmComboBox(new String[] {
+        this.sharpen = new JosmComboBox<>(new String[] {
                 tr("None"),
                 tr("Soft"),
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/WMSSettingsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/WMSSettingsPanel.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/WMSSettingsPanel.java	(revision 7015)
@@ -27,5 +27,5 @@
     // WMS Settings
     private final JCheckBox autozoomActive;
-    private final JosmComboBox browser;
+    private final JosmComboBox<String> browser;
     private final JCheckBox overlapCheckBox;
     private final JSpinner spinEast;
@@ -46,5 +46,5 @@
 
         // Downloader
-        browser = new JosmComboBox(new String[] {
+        browser = new JosmComboBox<>(new String[] {
                 "webkit-image {0}",
                 "gnome-web-photo --mode=photo --format=png {0} /dev/stdout",
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java	(revision 7015)
@@ -115,5 +115,5 @@
             filter.getDocument().addDocumentListener(this);
 
-            selectionList = new JList(data.toArray());
+            selectionList = new JList<>(data.toArray(new String[0]));
             selectionList.setModel(model = new ProjectionCodeListModel());
             JScrollPane scroll = new JScrollPane(selectionList);
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java	(revision 7015)
@@ -37,5 +37,5 @@
 
     private class LambertCC9CBPanel extends CBPanel {
-        public LambertCC9CBPanel(Object[] entries, int initialIndex, String label, ActionListener listener) {
+        public LambertCC9CBPanel(String[] entries, int initialIndex, String label, ActionListener listener) {
             super(entries, initialIndex, label, listener);
             this.add(new JLabel(ImageProvider.get("data/projection", "LambertCC9Zones.png")), GBC.eol().fill(GBC.HORIZONTAL));
@@ -85,6 +85,6 @@
 
     @Override
-    protected String indexToZone(int index) {
-        return Integer.toString(index + 1);
+    protected String indexToZone(int idx) {
+        return Integer.toString(idx + 1);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertProjectionChoice.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertProjectionChoice.java	(revision 7015)
@@ -32,5 +32,5 @@
 
     private class LambertCBPanel extends CBPanel {
-        public LambertCBPanel(Object[] entries, int initialIndex, String label, ActionListener listener) {
+        public LambertCBPanel(String[] entries, int initialIndex, String label, ActionListener listener) {
             super(entries, initialIndex, label, listener);
             this.add(new JLabel(ImageProvider.get("data/projection", "Departements_Lambert4Zones.png")), GBC.eol().fill(GBC.HORIZONTAL));
@@ -79,6 +79,6 @@
 
     @Override
-    protected String indexToZone(int index) {
-        return Integer.toString(index + 1);
+    protected String indexToZone(int idx) {
+        return Integer.toString(idx + 1);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java	(revision 7015)
@@ -21,5 +21,5 @@
     protected int index;        // 0-based index
     protected int defaultIndex;
-    protected Object[] entries;
+    protected String[] entries;
     protected String label;
 
@@ -33,5 +33,5 @@
      * @param defaultIndex the default index for the combo-box
      */
-    public ListProjectionChoice(String name, String id, Object[] entries, String label, int defaultIndex) {
+    public ListProjectionChoice(String name, String id, String[] entries, String label, int defaultIndex) {
         super(name, id);
         this.entries = Utils.copyArray(entries);
@@ -47,5 +47,5 @@
      * @param label a label shown left to the combo-box
      */
-    public ListProjectionChoice(String name, String id, Object[] entries, String label) {
+    public ListProjectionChoice(String name, String id, String[] entries, String label) {
         this(name, id, entries, label, 0);
     }
@@ -54,5 +54,5 @@
      * Convert 0-based index to preference value.
      */
-    protected abstract String indexToZone(int index);
+    protected abstract String indexToZone(int idx);
 
     /**
@@ -67,21 +67,21 @@
             zone = args.iterator().next();
         }
-        int index;
+        int idx;
         if (zone == null) {
-            index = defaultIndex;
+            idx = defaultIndex;
         } else {
-            index = zoneToIndex(zone);
-            if (index < 0 || index >= entries.length) {
-                index = defaultIndex;
+            idx = zoneToIndex(zone);
+            if (idx < 0 || idx >= entries.length) {
+                idx = defaultIndex;
             }
         }
-        this.index = index;
+        this.index = idx;
     }
 
     protected class CBPanel extends JPanel {
-        public JosmComboBox prefcb;
+        public JosmComboBox<String> prefcb;
 
-        public CBPanel(Object[] entries, int initialIndex, String label, final ActionListener listener) {
-            prefcb = new JosmComboBox(entries);
+        public CBPanel(String[] entries, int initialIndex, String label, final ActionListener listener) {
+            prefcb = new JosmComboBox<>(entries);
 
             prefcb.setSelectedIndex(initialIndex);
@@ -109,7 +109,6 @@
         }
         CBPanel p = (CBPanel) panel;
-        int index = p.prefcb.getSelectedIndex();
-        return Collections.singleton(indexToZone(index));
+        int idx = p.prefcb.getSelectedIndex();
+        return Collections.singleton(indexToZone(idx));
     }
-
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java	(revision 7015)
@@ -258,12 +258,12 @@
      * Combobox with all projections available
      */
-    private final JosmComboBox projectionCombo = new JosmComboBox(projectionChoices.toArray());
+    private final JosmComboBox<ProjectionChoice> projectionCombo = new JosmComboBox<>(projectionChoices.toArray(new ProjectionChoice[0]));
 
     /**
      * Combobox with all coordinate display possibilities
      */
-    private final JosmComboBox coordinatesCombo = new JosmComboBox(CoordinateFormat.values());
-
-    private final JosmComboBox unitsCombo = new JosmComboBox(unitsValuesTr);
+    private final JosmComboBox<CoordinateFormat> coordinatesCombo = new JosmComboBox<>(CoordinateFormat.values());
+
+    private final JosmComboBox<String> unitsCombo = new JosmComboBox<>(unitsValuesTr);
 
     /**
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java	(revision 7015)
@@ -44,5 +44,5 @@
      */
     public UTMProjectionChoice() {
-        super(tr("UTM"), "core:utm", cbEntries.toArray(), tr("UTM Zone"));
+        super(tr("UTM"), "core:utm", cbEntries.toArray(new String[0]), tr("UTM Zone"));
     }
 
@@ -51,8 +51,7 @@
         public JRadioButton north, south;
 
-        public UTMPanel(Object[] entries, int initialIndex, String label, ActionListener listener) {
+        public UTMPanel(String[] entries, int initialIndex, String label, ActionListener listener) {
             super(entries, initialIndex, label, listener);
 
-            //Hemisphere
             north = new JRadioButton();
             north.setSelected(hemisphere == Hemisphere.North);
@@ -110,7 +109,7 @@
         }
         UTMPanel p = (UTMPanel) panel;
-        int index = p.prefcb.getSelectedIndex();
-        Hemisphere hemisphere = p.south.isSelected()?Hemisphere.South:Hemisphere.North;
-        return Arrays.asList(indexToZone(index), hemisphere.toString());
+        int idx = p.prefcb.getSelectedIndex();
+        Hemisphere hem = p.south.isSelected()?Hemisphere.South:Hemisphere.North;
+        return Arrays.asList(indexToZone(idx), hem.toString());
     }
 
@@ -119,6 +118,6 @@
         List<String> projections = new ArrayList<>(60*4);
         for (int zone = 1;zone <= 60; zone++) {
-            for (Hemisphere hemisphere : Hemisphere.values()) {
-                projections.add("EPSG:" + (32600 + zone + (hemisphere == Hemisphere.South?100:0)));
+            for (Hemisphere hem : Hemisphere.values()) {
+                projections.add("EPSG:" + (32600 + zone + (hem == Hemisphere.South?100:0)));
             }
         }
@@ -131,9 +130,9 @@
         if (code.startsWith("EPSG:326") || code.startsWith("EPSG:327")) {
             try {
-                Hemisphere hemisphere = code.charAt(7)=='6'?Hemisphere.North:Hemisphere.South;
+                Hemisphere hem = code.charAt(7)=='6'?Hemisphere.North:Hemisphere.South;
                 String zonestring = code.substring(8);
                 int zoneval = Integer.parseInt(zonestring);
                 if(zoneval > 0 && zoneval <= 60)
-                    return Arrays.asList(zonestring, hemisphere.toString());
+                    return Arrays.asList(zonestring, hem.toString());
             } catch(NumberFormatException e) {
                 Main.warn(e);
@@ -146,5 +145,5 @@
     public void setPreferences(Collection<String> args) {
         super.setPreferences(args);
-        Hemisphere hemisphere = DEFAULT_HEMISPHERE;
+        Hemisphere hem = DEFAULT_HEMISPHERE;
 
         if (args != null) {
@@ -152,13 +151,13 @@
 
             if (array.length > 1) {
-                hemisphere = Hemisphere.valueOf(array[1]);
+                hem = Hemisphere.valueOf(array[1]);
             }
         }
-        this.hemisphere = hemisphere;
+        this.hemisphere = hem;
     }
 
     @Override
-    protected String indexToZone(int index) {
-        return Integer.toString(index + 1);
+    protected String indexToZone(int idx) {
+        return Integer.toString(idx + 1);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java	(revision 7015)
@@ -97,5 +97,5 @@
     private JCheckBox cbDefault = new JCheckBox();
     private JCheckBox cbDisable = new JCheckBox();
-    private JosmComboBox tfKey = new JosmComboBox();
+    private JosmComboBox<String> tfKey = new JosmComboBox<>();
 
     JTable shortcutTable = new JTable();
@@ -218,5 +218,5 @@
         cbAlt.setText(ALT); // see above for why no tr()
         tfKey.setAction(action);
-        tfKey.setModel(new DefaultComboBoxModel(keyList.values().toArray()));
+        tfKey.setModel(new DefaultComboBoxModel<>(keyList.values().toArray(new String[0])));
         cbMeta.setAction(action);
         cbMeta.setText(META); // see above for why no tr()
Index: trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java	(revision 7015)
@@ -618,5 +618,5 @@
             } else {
                 // the objects have different values
-                JosmComboBox comboBox = new JosmComboBox(usage.values.toArray());
+                JosmComboBox<String> comboBox = new JosmComboBox<>(usage.values.toArray(new String[0]));
                 comboBox.setEditable(true);
                 comboBox.setEditor(textField);
@@ -697,5 +697,5 @@
         private static String getValue(Component comp) {
             if (comp instanceof JosmComboBox) {
-                return ((JosmComboBox) comp).getEditor().getItem().toString();
+                return ((JosmComboBox<?>) comp).getEditor().getItem().toString();
             } else if (comp instanceof JosmTextField) {
                 return ((JosmTextField) comp).getText();
@@ -1174,5 +1174,5 @@
 
         public boolean editable = true;
-        protected JosmComboBox combo;
+        protected JosmComboBox<PresetListEntry> combo;
         public String length;
 
@@ -1198,5 +1198,5 @@
             lhm.put("", new PresetListEntry(""));
 
-            combo = new JosmComboBox(lhm.values().toArray());
+            combo = new JosmComboBox<>(lhm.values().toArray(new PresetListEntry[0]));
             component = combo;
             combo.setRenderer(getListCellRenderer());
@@ -1265,7 +1265,7 @@
         @Override
         protected void addToPanelAnchor(JPanel p, String def, boolean presetInitiallyMatches) {
-            list = new ConcatenatingJList(delimiter, lhm.values().toArray());
+            list = new ConcatenatingJList(delimiter, lhm.values().toArray(new PresetListEntry[0]));
             component = list;
-            ListCellRenderer renderer = getListCellRenderer();
+            ListCellRenderer<PresetListEntry> renderer = getListCellRenderer();
             list.setCellRenderer(renderer);
 
@@ -1315,7 +1315,7 @@
     * string (extracted from TaggingPreset)
     */
-    private static class ConcatenatingJList extends JList {
+    private static class ConcatenatingJList extends JList<PresetListEntry> {
         private String delimiter;
-        public ConcatenatingJList(String del, Object[] o) {
+        public ConcatenatingJList(String del, PresetListEntry[] o) {
             super(o);
             delimiter = del;
@@ -1328,9 +1328,9 @@
                 String s = o.toString();
                 TreeSet<String> parts = new TreeSet<>(Arrays.asList(s.split(delimiter)));
-                ListModel lm = getModel();
+                ListModel<PresetListEntry> lm = getModel();
                 int[] intParts = new int[lm.getSize()];
                 int j = 0;
                 for (int i = 0; i < lm.getSize(); i++) {
-                    if (parts.contains((((PresetListEntry)lm.getElementAt(i)).value))) {
+                    if (parts.contains((lm.getElementAt(i).value))) {
                         intParts[j++]=i;
                     }
@@ -1345,5 +1345,5 @@
 
         public String getSelectedItem() {
-            ListModel lm = getModel();
+            ListModel<PresetListEntry> lm = getModel();
             int[] si = getSelectedIndices();
             StringBuilder builder = new StringBuilder();
@@ -1352,5 +1352,5 @@
                     builder.append(delimiter);
                 }
-                builder.append(((PresetListEntry)lm.getElementAt(si[i])).value);
+                builder.append(lm.getElementAt(si[i]).value);
             }
             return builder.toString();
Index: trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSelector.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSelector.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSelector.java	(revision 7015)
@@ -82,6 +82,5 @@
     private static class ResultListCellRenderer extends DefaultListCellRenderer {
         @Override
-        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
-                boolean cellHasFocus) {
+        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
             JLabel result = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
             TaggingPreset tp = (TaggingPreset)value;
Index: trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java	(revision 7015)
@@ -30,5 +30,5 @@
  * @author guilhem.bonnefille@gmail.com
  */
-public class AutoCompletingComboBox extends JosmComboBox {
+public class AutoCompletingComboBox extends JosmComboBox<AutoCompletionListItem> {
 
     private boolean autocompleteEnabled = true;
@@ -43,8 +43,8 @@
      */
     class AutoCompletingComboBoxDocument extends PlainDocument {
-        private JosmComboBox comboBox;
+        private JosmComboBox<AutoCompletionListItem> comboBox;
         private boolean selecting = false;
 
-        public AutoCompletingComboBoxDocument(final JosmComboBox comboBox) {
+        public AutoCompletingComboBoxDocument(final JosmComboBox<AutoCompletionListItem> comboBox) {
             this.comboBox = comboBox;
         }
@@ -114,13 +114,13 @@
                 }
             }
-            JTextComponent editor = (JTextComponent)comboBox.getEditor().getEditorComponent();
+            JTextComponent editorComponent = (JTextComponent)comboBox.getEditor().getEditorComponent();
             // save unix system selection (middle mouse paste)
             Clipboard sysSel = Toolkit.getDefaultToolkit().getSystemSelection();
             if(sysSel != null) {
                 Transferable old = sysSel.getContents(null);
-                editor.select(start, end);
+                editorComponent.select(start, end);
                 sysSel.setContents(old, null);
             } else {
-                editor.select(start, end);
+                editorComponent.select(start, end);
             }
         }
@@ -133,5 +133,5 @@
 
         private Object lookupItem(String pattern, boolean match) {
-            ComboBoxModel model = comboBox.getModel();
+            ComboBoxModel<AutoCompletionListItem> model = comboBox.getModel();
             AutoCompletionListItem bestItem = null;
             for (int i = 0, n = model.getSize(); i < n; i++) {
@@ -153,5 +153,5 @@
      */
     public AutoCompletingComboBox() {
-        this(JosmComboBox.DEFAULT_PROTOTYPE_DISPLAY_VALUE);
+        this("Foo");
     }
 
@@ -165,7 +165,7 @@
         super(new AutoCompletionListItem(prototype));
         setRenderer(new AutoCompleteListCellRenderer());
-        final JTextComponent editor = (JTextComponent) this.getEditor().getEditorComponent();
-        editor.setDocument(new AutoCompletingComboBoxDocument(this));
-        editor.addFocusListener(
+        final JTextComponent editorComponent = (JTextComponent) this.getEditor().getEditorComponent();
+        editorComponent.setDocument(new AutoCompletingComboBoxDocument(this));
+        editorComponent.addFocusListener(
                 new FocusListener() {
                     @Override
@@ -178,8 +178,8 @@
                         if(sysSel != null) {
                             Transferable old = sysSel.getContents(null);
-                            editor.selectAll();
+                            editorComponent.selectAll();
                             sysSel.setContents(old, null);
                         } else {
-                            editor.selectAll();
+                            editorComponent.selectAll();
                         }
                     }
@@ -188,23 +188,22 @@
     }
 
-    public void setMaxTextLength(int length)
-    {
+    public void setMaxTextLength(int length) {
         this.maxTextLength = length;
     }
 
     /**
-     * Convert the selected item into a String
-     * that can be edited in the editor component.
+     * Convert the selected item into a String that can be edited in the editor component.
      *
-     * @param editor    the editor
+     * @param cbEditor    the editor
      * @param item      excepts AutoCompletionListItem, String and null
      */
-    @Override public void configureEditor(ComboBoxEditor editor, Object item) {
+    @Override
+    public void configureEditor(ComboBoxEditor cbEditor, Object item) {
         if (item == null) {
-            editor.setItem(null);
+            cbEditor.setItem(null);
         } else if (item instanceof String) {
-            editor.setItem(item);
+            cbEditor.setItem(item);
         } else if (item instanceof AutoCompletionListItem) {
-            editor.setItem(((AutoCompletionListItem)item).getValue());
+            cbEditor.setItem(((AutoCompletionListItem)item).getValue());
         } else
             throw new IllegalArgumentException();
@@ -215,5 +214,6 @@
      * @param item      excepts AutoCompletionListItem, String and null
      */
-    @Override public void setSelectedItem(Object item) {
+    @Override
+    public void setSelectedItem(Object item) {
         if (item == null) {
             super.setSelectedItem(null);
@@ -239,5 +239,5 @@
      */
     public void setPossibleItems(Collection<String> elems) {
-        DefaultComboBoxModel model = (DefaultComboBoxModel)this.getModel();
+        DefaultComboBoxModel<AutoCompletionListItem> model = (DefaultComboBoxModel<AutoCompletionListItem>)this.getModel();
         Object oldValue = this.getEditor().getItem(); // Do not use getSelectedItem(); (fix #8013)
         model.removeAllElements();
@@ -245,6 +245,5 @@
             model.addElement(new AutoCompletionListItem(elem, AutoCompletionItemPriority.UNKNOWN));
         }
-        // disable autocomplete to prevent unnecessary actions in
-        // AutoCompletingComboBoxDocument#insertString
+        // disable autocomplete to prevent unnecessary actions in AutoCompletingComboBoxDocument#insertString
         autocompleteEnabled = false;
         this.getEditor().setItem(oldValue); // Do not use setSelectedItem(oldValue); (fix #8013)
@@ -256,5 +255,5 @@
      */
     public void setPossibleACItems(Collection<AutoCompletionListItem> elems) {
-        DefaultComboBoxModel model = (DefaultComboBoxModel)this.getModel();
+        DefaultComboBoxModel<AutoCompletionListItem> model = (DefaultComboBoxModel<AutoCompletionListItem>)this.getModel();
         Object oldValue = getSelectedItem();
         Object editorOldValue = this.getEditor().getItem();
@@ -266,5 +265,4 @@
         this.getEditor().setItem(editorOldValue);
     }
-
 
     protected boolean isAutocompleteEnabled() {
Index: trunk/src/org/openstreetmap/josm/gui/widgets/ComboBoxHistory.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/ComboBoxHistory.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/ComboBoxHistory.java	(revision 7015)
@@ -10,5 +10,5 @@
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem;
 
-public class ComboBoxHistory extends DefaultComboBoxModel implements Iterable<AutoCompletionListItem> {
+public class ComboBoxHistory extends DefaultComboBoxModel<AutoCompletionListItem> implements Iterable<AutoCompletionListItem> {
 
     private int maxSize = 10;
@@ -20,13 +20,13 @@
     }
 
+    public void addElement(String s) {
+        addElement(new AutoCompletionListItem(s));
+    }
+    
     /**
      * Adds or moves an element to the top of the history
      */
     @Override
-    public void addElement(Object o) {
-        if (o instanceof String) {
-            o = new AutoCompletionListItem((String) o);
-        }
-
+    public void addElement(AutoCompletionListItem o) {
         String newEntry = ((AutoCompletionListItem)o).getValue();
 
@@ -77,5 +77,4 @@
                 return (AutoCompletionListItem)getElementAt(position);
             }
-
         };
     }
Index: trunk/src/org/openstreetmap/josm/gui/widgets/HistoryComboBox.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/HistoryComboBox.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/HistoryComboBox.java	(revision 7015)
@@ -14,4 +14,7 @@
     public static final int DEFAULT_SEARCH_HISTORY_SIZE = 15;
 
+    /**
+     * Constructs a new {@code HistoryComboBox}.
+     */
     public HistoryComboBox() {
         int maxsize = Main.pref.getInteger("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE);
@@ -31,6 +34,5 @@
 
     public void addCurrentItemToHistory() {
-        String regex = (String)getEditor().getItem();
-        model.addElement(regex);
+        model.addElement((String)getEditor().getItem());
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java	(revision 7015)
@@ -15,5 +15,4 @@
 
 import javax.accessibility.Accessible;
-import javax.swing.ComboBoxEditor;
 import javax.swing.ComboBoxModel;
 import javax.swing.DefaultComboBoxModel;
@@ -26,14 +25,10 @@
  * Class overriding each {@link JComboBox} in JOSM to control consistently the number of displayed items at once.<br>
  * This is needed because of the default Java behaviour that may display the top-down list off the screen (see #7917).
+ * @param <E> the type of the elements of this combo box
  *
- * @since 5429
+ * @since 5429 (creation)
+ * @since 7015 (generics for Java 7)
  */
-public class JosmComboBox extends JComboBox {
-
-    /**
-     * The default prototype value used to compute the maximum number of elements to be displayed at once before
-     * displaying a scroll bar
-     */
-    public static final String DEFAULT_PROTOTYPE_DISPLAY_VALUE = "Prototype display value";
+public class JosmComboBox<E> extends JComboBox<E> {
 
     /**
@@ -46,5 +41,5 @@
      */
     public JosmComboBox() {
-        this(DEFAULT_PROTOTYPE_DISPLAY_VALUE);
+        init(null);
     }
 
@@ -63,6 +58,5 @@
      * @since 5450
      */
-    public JosmComboBox(Object prototypeDisplayValue) {
-        super();
+    public JosmComboBox(E prototypeDisplayValue) {
         init(prototypeDisplayValue);
     }
@@ -79,7 +73,7 @@
      * @see DefaultComboBoxModel
      */
-    public JosmComboBox(ComboBoxModel aModel) {
+    public JosmComboBox(ComboBoxModel<E> aModel) {
         super(aModel);
-        List<Object> list = new ArrayList<>(aModel.getSize());
+        List<E> list = new ArrayList<>(aModel.getSize());
         for (int i = 0; i<aModel.getSize(); i++) {
             list.add(aModel.getElementAt(i));
@@ -96,5 +90,5 @@
      * @see DefaultComboBoxModel
      */
-    public JosmComboBox(Object[] items) {
+    public JosmComboBox(E[] items) {
         super(items);
         init(findPrototypeDisplayValue(Arrays.asList(items)));
@@ -107,16 +101,16 @@
      * @since 5558
      */
-    protected final Object findPrototypeDisplayValue(Collection<?> possibleValues) {
-        Object result = null;
+    protected final E findPrototypeDisplayValue(Collection<E> possibleValues) {
+        E result = null;
         int maxHeight = -1;
         if (possibleValues != null) {
             // Remind old prototype to restore it later
-            Object oldPrototype = getPrototypeDisplayValue();
+            E oldPrototype = getPrototypeDisplayValue();
             // Get internal JList to directly call the renderer
-            JList list = getList();
+            JList<E> list = getList();
             try {
                 // Index to give to renderer
                 int i = 0;
-                for (Object value : possibleValues) {
+                for (E value : possibleValues) {
                     if (value != null) {
                         // With a "classic" renderer, we could call setPrototypeDisplayValue(value) + getPreferredSize()
@@ -144,5 +138,6 @@
     }
 
-    protected final JList getList() {
+    @SuppressWarnings("unchecked")
+    protected final JList<E> getList() {
         for (int i = 0; i < getUI().getAccessibleChildrenCount(this); i++) {
             Accessible child = getUI().getAccessibleChild(this, i);
@@ -154,5 +149,5 @@
     }
 
-    protected final void init(Object prototype) {
+    protected final void init(E prototype) {
         if (prototype != null) {
             setPrototypeDisplayValue(prototype);
@@ -163,5 +158,5 @@
             // If possible, adjust the maximum number of items with the real height of items
             // It is not granted this works on every platform (tested OK on Windows)
-            JList list = getList();
+            JList<E> list = getList();
             if (list != null) {
                 if (list.getPrototypeCellValue() != prototype) {
@@ -203,5 +198,4 @@
         private void enableMenu() {
             if (launcher == null) {
-                ComboBoxEditor editor = getEditor();
                 if (editor != null) {
                     Component editorComponent = editor.getEditorComponent();
@@ -224,6 +218,13 @@
         }
 
-        @Override public void mousePressed(MouseEvent e) { processEvent(e); }
-        @Override public void mouseReleased(MouseEvent e) { processEvent(e); }
+        @Override
+        public void mousePressed(MouseEvent e) {
+            processEvent(e);
+        }
+
+        @Override
+        public void mouseReleased(MouseEvent e) {
+            processEvent(e);
+        }
 
         private void processEvent(MouseEvent e) {
@@ -241,5 +242,5 @@
      * @since 5558
      */
-    public final void reinitialize(Collection<?> values) {
+    public final void reinitialize(Collection<E> values) {
         init(findPrototypeDisplayValue(values));
     }
Index: trunk/src/org/openstreetmap/josm/gui/widgets/OsmPrimitiveTypesComboBox.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/OsmPrimitiveTypesComboBox.java	(revision 7014)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/OsmPrimitiveTypesComboBox.java	(revision 7015)
@@ -10,5 +10,5 @@
  * @since 2923
  */
-public class OsmPrimitiveTypesComboBox extends JosmComboBox {
+public class OsmPrimitiveTypesComboBox extends JosmComboBox<Object> {
 
     /**
