Ignore:
Timestamp:
2014-04-26T17:39:23+02:00 (10 years ago)
Author:
Don-vip
Message:

see #8465 - use diamond operator where applicable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java

    r6987 r7005  
    201201     */
    202202    public static void exportPreferencesKeysToFile(String filename, boolean append, String... keys) {
    203         HashSet<String> keySet = new HashSet<String>();
     203        HashSet<String> keySet = new HashSet<>();
    204204        Collections.addAll(keySet, keys);
    205205        exportPreferencesKeysToFile(filename, append, keySet);
     
    215215     */
    216216    public static void exportPreferencesKeysByPatternToFile(String fileName, boolean append, String pattern) {
    217         List<String> keySet = new ArrayList<String>();
     217        List<String> keySet = new ArrayList<>();
    218218        Map<String, Setting> allSettings = Main.pref.getAllSettings();
    219219        for (String key: allSettings.keySet()) {
     
    317317
    318318    public static void pluginOperation(String install, String uninstall, String delete)  {
    319         final List<String> installList = new ArrayList<String>();
    320         final List<String> removeList = new ArrayList<String>();
    321         final List<String> deleteList = new ArrayList<String>();
     319        final List<String> installList = new ArrayList<>();
     320        final List<String> removeList = new ArrayList<>();
     321        final List<String> deleteList = new ArrayList<>();
    322322        Collections.addAll(installList, install.toLowerCase().split(";"));
    323323        Collections.addAll(removeList, uninstall.toLowerCase().split(";"));
     
    351351                    public void run() {
    352352                        List<PluginInformation> availablePlugins = task.getAvailablePlugins();
    353                         List<PluginInformation> toInstallPlugins = new ArrayList<PluginInformation>();
    354                         List<PluginInformation> toRemovePlugins = new ArrayList<PluginInformation>();
    355                         List<PluginInformation> toDeletePlugins = new ArrayList<PluginInformation>();
     353                        List<PluginInformation> toInstallPlugins = new ArrayList<>();
     354                        List<PluginInformation> toRemovePlugins = new ArrayList<>();
     355                        List<PluginInformation> toDeletePlugins = new ArrayList<>();
    356356                        for (PluginInformation pi: availablePlugins) {
    357357                            String name = pi.name.toLowerCase();
     
    364364                            Main.worker.submit(pluginDownloadTask);
    365365                        }
    366                         Collection<String> pls = new ArrayList<String>(Main.pref.getCollection("plugins"));
     366                        Collection<String> pls = new ArrayList<>(Main.pref.getCollection("plugins"));
    367367                        for (PluginInformation pi: toInstallPlugins) {
    368368                            if (!pls.contains(pi.name)) {
     
    415415
    416416        Preferences mainPrefs;
    417         Map<String,Element> tasksMap = new HashMap<String,Element>();
     417        Map<String,Element> tasksMap = new HashMap<>();
    418418
    419419        private boolean lastV; // last If condition result
     
    888888        }
    889889        if (existing != null)
    890             return new ArrayList<String>(existing.getValue());
     890            return new ArrayList<>(existing.getValue());
    891891        else
    892             return defaults.getValue() == null ? null : new ArrayList<String>(defaults.getValue());
     892            return defaults.getValue() == null ? null : new ArrayList<>(defaults.getValue());
    893893    }
    894894
     
    917917
    918918        if (existing != null)
    919             return new ArrayList<Map<String, String>>(existing.getValue());
     919            return new ArrayList<>(existing.getValue());
    920920        else
    921             return defaults.getValue() == null ? null : new ArrayList<Map<String, String>>(defaults.getValue());
     921            return defaults.getValue() == null ? null : new ArrayList<>(defaults.getValue());
    922922    }
    923923
     
    10031003        tmpPref.settingsMap.clear();
    10041004
    1005         Map<String, Setting> tmp = new HashMap<String, Setting>();
     1005        Map<String, Setting> tmp = new HashMap<>();
    10061006        for (Entry<String, String> e : stringMap.entrySet()) {
    10071007            tmp.put(e.getKey(), new StringSetting(e.getValue()));
     
    10331033     */
    10341034    public static void loadPrefsToJS(ScriptEngine engine, Preferences tmpPref, String whereToPutInJS, boolean includeDefaults) throws ScriptException {
    1035         Map<String, String> stringMap =  new TreeMap<String, String>();
    1036         Map<String, List<String>> listMap = new TreeMap<String, List<String>>();
    1037         Map<String, List<List<String>>> listlistMap = new TreeMap<String, List<List<String>>>();
    1038         Map<String, List<Map<String, String>>> listmapMap = new TreeMap<String, List<Map<String, String>>>();
     1035        Map<String, String> stringMap =  new TreeMap<>();
     1036        Map<String, List<String>> listMap = new TreeMap<>();
     1037        Map<String, List<List<String>>> listlistMap = new TreeMap<>();
     1038        Map<String, List<Map<String, String>>> listmapMap = new TreeMap<>();
    10391039
    10401040        if (includeDefaults) {
Note: See TracChangeset for help on using the changeset viewer.