Changeset 12841 in josm


Ignore:
Timestamp:
2017-09-13T16:30:27+02:00 (6 days ago)
Author:
bastiK
Message:

see #15229 - fix deprecations caused by [12840]

Location:
trunk/src/org/openstreetmap/josm
Files:
117 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java

    r12726 r12841  
    398398        }
    399399
    400         for (String linearTag : Main.pref.getCollection("multipoly.lineartagstokeep", DEFAULT_LINEAR_TAGS)) {
     400        for (String linearTag : Main.pref.getList("multipoly.lineartagstokeep", DEFAULT_LINEAR_TAGS)) {
    401401            values.remove(linearTag);
    402402        }
  • trunk/src/org/openstreetmap/josm/actions/DialogsToggleAction.java

    r12643 r12841  
    4343    public void actionPerformed(ActionEvent e) {
    4444        toggleSelectedState(e);
    45         Main.pref.put("draw.dialogspanel", isSelected());
     45        Main.pref.putBoolean("draw.dialogspanel", isSelected());
    4646        notifySelectedState();
    4747        setMode();
     
    6161            // Toolbars listen to preference changes, use it here
    6262            if (!Main.pref.getBoolean("toolbar.always-visible", true) && (!selected || toolbarPreviouslyVisible)) {
    63                 Main.pref.put("toolbar.visible", selected);
     63                Main.pref.putBoolean("toolbar.visible", selected);
    6464            }
    6565            if (!Main.pref.getBoolean("sidetoolbar.always-visible", true) && (!selected || sideToolbarPreviouslyVisible)) {
    66                 Main.pref.put("sidetoolbar.visible", selected);
     66                Main.pref.putBoolean("sidetoolbar.visible", selected);
    6767            }
    6868            map.mapView.rememberLastPositionOnScreen();
  • trunk/src/org/openstreetmap/josm/actions/FullscreenToggleAction.java

    r12637 r12841  
    5353    public void actionPerformed(ActionEvent e) {
    5454        toggleSelectedState(e);
    55         Main.pref.put("draw.fullscreen", isSelected());
     55        Main.pref.putBoolean("draw.fullscreen", isSelected());
    5656        notifySelectedState();
    5757        setMode();
  • trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java

    r12689 r12841  
    114114            return candidates.get(0);
    115115
    116         switch (Main.pref.getInteger("merge-nodes.mode", 0)) {
     116        switch (Main.pref.getInt("merge-nodes.mode", 0)) {
    117117        case 0:
    118118            return candidates.get(size - 1);
  • trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java

    r12671 r12841  
    330330
    331331            if (recordHistory) {
    332                 Collection<String> oldFileHistory = Main.pref.getCollection("file-open.history");
     332                Collection<String> oldFileHistory = Main.pref.getList("file-open.history");
    333333                fileHistory.addAll(oldFileHistory);
    334334                // remove the files which failed to load from the list
    335335                fileHistory.removeAll(failedAll);
    336                 int maxsize = Math.max(0, Main.pref.getInteger("file-open.history.max-size", 15));
     336                int maxsize = Math.max(0, Main.pref.getInt("file-open.history.max-size", 15));
    337337                Main.pref.putCollectionBounded("file-open.history", maxsize, fileHistory);
    338338            }
  • trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java

    r12675 r12841  
    104104     */
    105105    protected void restoreUploadAddressHistory(HistoryComboBox cbHistory) {
    106         List<String> cmtHistory = new LinkedList<>(Main.pref.getCollection(getClass().getName() + ".uploadAddressHistory",
     106        List<String> cmtHistory = new LinkedList<>(Main.pref.getList(getClass().getName() + ".uploadAddressHistory",
    107107                new LinkedList<String>()));
    108108        // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
     
    118118    protected void remindUploadAddressHistory(HistoryComboBox cbHistory) {
    119119        cbHistory.addCurrentItemToHistory();
    120         Main.pref.putCollection(getClass().getName() + ".uploadAddressHistory", cbHistory.getHistory());
     120        Main.pref.putList(getClass().getName() + ".uploadAddressHistory", cbHistory.getHistory());
    121121    }
    122122
  • trunk/src/org/openstreetmap/josm/actions/PurgeAction.java

    r12718 r12841  
    9999
    100100            clearUndoRedo = cbClearUndoRedo.isSelected();
    101             Main.pref.put("purge.clear_undo_redo", clearUndoRedo);
     101            Main.pref.putBoolean("purge.clear_undo_redo", clearUndoRedo);
    102102        }
    103103
  • trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java

    r11343 r12841  
    8181        String nameText = name.getText();
    8282        if (filerename.isEnabled()) {
    83             Main.pref.put("layer.rename-file", filerename.isSelected());
     83            Main.pref.putBoolean("layer.rename-file", filerename.isSelected());
    8484            if (filerename.isSelected()) {
    8585                String newname = nameText;
  • trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java

    r12671 r12841  
    229229        }
    230230
    231         int maxsize = Math.max(0, Main.pref.getInteger("file-open.history.max-size", 15));
    232         Collection<String> oldHistory = Main.pref.getCollection("file-open.history");
     231        int maxsize = Math.max(0, Main.pref.getInt("file-open.history.max-size", 15));
     232        Collection<String> oldHistory = Main.pref.getList("file-open.history");
    233233        List<String> history = new LinkedList<>(oldHistory);
    234234        history.remove(filepath);
  • trunk/src/org/openstreetmap/josm/actions/SearchNotesDownloadAction.java

    r12620 r12841  
    4141    public void actionPerformed(ActionEvent e) {
    4242        HistoryComboBox searchTermBox = new HistoryComboBox();
    43         List<String> searchHistory = new LinkedList<>(Main.pref.getCollection(HISTORY_KEY, new LinkedList<String>()));
     43        List<String> searchHistory = new LinkedList<>(Main.pref.getList(HISTORY_KEY, new LinkedList<String>()));
    4444        Collections.reverse(searchHistory);
    4545        searchTermBox.setPossibleItems(searchHistory);
     
    7070
    7171        searchTermBox.addCurrentItemToHistory();
    72         Main.pref.putCollection(HISTORY_KEY, searchTermBox.getHistory());
     72        Main.pref.putList(HISTORY_KEY, searchTermBox.getHistory());
    7373
    7474        performSearch(searchTerm);
     
    9191        }
    9292
    93         int noteLimit = Main.pref.getInteger("osm.notes.downloadLimit", 1000);
    94         int closedLimit = Main.pref.getInteger("osm.notes.daysClosed", 7);
     93        int noteLimit = Main.pref.getInt("osm.notes.downloadLimit", 1000);
     94        int closedLimit = Main.pref.getInt("osm.notes.daysClosed", 7);
    9595
    9696        StringBuilder sb = new StringBuilder(128);
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawSnapHelper.java

    r12630 r12841  
    237237
    238238    private void computeSnapAngles() {
    239         snapAngles = Main.pref.getCollection(DRAW_ANGLESNAP_ANGLES,
     239        snapAngles = Main.pref.getList(DRAW_ANGLESNAP_ANGLES,
    240240                Arrays.asList("0", "30", "45", "60", "90", "120", "135", "150", "180"))
    241241                .stream()
     
    259259     */
    260260    public void saveAngles(String... angles) {
    261         Main.pref.putCollection(DRAW_ANGLESNAP_ANGLES, Arrays.asList(angles));
     261        Main.pref.putList(DRAW_ANGLESNAP_ANGLES, Arrays.asList(angles));
    262262    }
    263263
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r12726 r12841  
    307307    @Override
    308308    protected void readPreferences() {
    309         initialMoveDelay = Main.pref.getInteger("edit.initial-move-delay", 200);
    310         initialMoveThreshold = Main.pref.getInteger("extrude.initial-move-threshold", 1);
     309        initialMoveDelay = Main.pref.getInt("edit.initial-move-delay", 200);
     310        initialMoveThreshold = Main.pref.getInt("extrude.initial-move-threshold", 1);
    311311        mainColor = new ColorProperty(marktr("Extrude: main line"), Color.RED).get();
    312312        helperColor = new ColorProperty(marktr("Extrude: helper line"), Color.ORANGE).get();
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r12785 r12841  
    202202        mv.addMouseListener(this);
    203203        mv.addMouseMotionListener(this);
    204         mv.setVirtualNodesEnabled(Main.pref.getInteger("mappaint.node.virtual-size", 8) != 0);
     204        mv.setVirtualNodesEnabled(Main.pref.getInt("mappaint.node.virtual-size", 8) != 0);
    205205        drawTargetHighlight = Main.pref.getBoolean("draw.target-highlight", true);
    206         initialMoveDelay = Main.pref.getInteger("edit.initial-move-delay", 200);
    207         initialMoveThreshold = Main.pref.getInteger("edit.initial-move-threshold", 5);
     206        initialMoveDelay = Main.pref.getInt("edit.initial-move-delay", 200);
     207        initialMoveThreshold = Main.pref.getInt("edit.initial-move-threshold", 5);
    208208        repeatedKeySwitchLassoOption = Main.pref.getBoolean("mappaint.select.toggle-lasso-on-repeated-S", true);
    209209        cycleManager.init();
     
    828828            }
    829829        }
    830         int max = Main.pref.getInteger("warn.move.maxelements", 20), limit = max;
     830        int max = Main.pref.getInt("warn.move.maxelements", 20), limit = max;
    831831        for (OsmPrimitive osm : getLayerManager().getEditDataSet().getSelected()) {
    832832            if (osm instanceof Way) {
     
    11751175
    11761176        private void init() {
    1177             nodeVirtualSize = Main.pref.getInteger("mappaint.node.virtual-size", 8);
    1178             int virtualSnapDistSq = Main.pref.getInteger("mappaint.node.virtual-snap-distance", 8);
     1177            nodeVirtualSize = Main.pref.getInt("mappaint.node.virtual-size", 8);
     1178            int virtualSnapDistSq = Main.pref.getInt("mappaint.node.virtual-snap-distance", 8);
    11791179            virtualSnapDistSq2 = virtualSnapDistSq*virtualSnapDistSq;
    1180             virtualSpace = Main.pref.getInteger("mappaint.node.virtual-space", 70);
     1180            virtualSpace = Main.pref.getInt("mappaint.node.virtual-space", 70);
    11811181        }
    11821182
  • trunk/src/org/openstreetmap/josm/actions/relation/EditRelationAction.java

    r12636 r12841  
    7070    public void actionPerformed(ActionEvent e) {
    7171        if (!isEnabled() || relations.isEmpty()) return;
    72         if (relations.size() > Main.pref.getInteger("warn.open.maxrelations", 5) &&
     72        if (relations.size() > Main.pref.getInt("warn.open.maxrelations", 5) &&
    7373            /* I18N english text for value 1 makes no real sense, never called for values <= maxrel (usually 5) */
    7474            JOptionPane.OK_OPTION != JOptionPane.showConfirmDialog(Main.parent,
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r12839 r12841  
    112112        });
    113113
    114         for (String s: Main.pref.getCollection("search.history", Collections.<String>emptyList())) {
     114        for (String s: Main.pref.getList("search.history", Collections.<String>emptyList())) {
    115115            SearchSetting ss = SearchSetting.readFromString(s);
    116116            if (ss != null) {
     
    140140            searchHistory.addFirst(new SearchSetting(s));
    141141        }
    142         int maxsize = Main.pref.getInteger("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE);
     142        int maxsize = Main.pref.getInt("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE);
    143143        while (searchHistory.size() > maxsize) {
    144144            searchHistory.removeLast();
     
    148148            savedHistory.add(item.writeToString());
    149149        }
    150         Main.pref.putCollection("search.history", savedHistory);
     150        Main.pref.putList("search.history", new ArrayList<>(savedHistory));
    151151    }
    152152
  • trunk/src/org/openstreetmap/josm/command/SplitWayCommand.java

    r12828 r12841  
    273273
    274274        Collection<Command> commandList = new ArrayList<>(newWays.size());
    275         Collection<String> nowarnroles = Main.pref.getCollection("way.split.roles.nowarn",
     275        Collection<String> nowarnroles = Main.pref.getList("way.split.roles.nowarn",
    276276                Arrays.asList("outer", "inner", "forward", "backward", "north", "south", "east", "west"));
    277277
  • trunk/src/org/openstreetmap/josm/data/PreferencesUtils.java

    r12826 r12841  
    9999            } else if (entry.getValue() instanceof ListSetting) {
    100100                ListSetting lSetting = (ListSetting) entry.getValue();
    101                 Collection<String> newItems = getCollection(mainpref, key, true);
     101                List<String> newItems = getList(mainpref, key, true);
    102102                if (newItems == null) continue;
    103103                for (String item : lSetting.getValue()) {
     
    107107                    }
    108108                }
    109                 mainpref.putCollection(key, newItems);
     109                mainpref.putList(key, newItems);
    110110            } else if (entry.getValue() instanceof ListListSetting) {
    111111                ListListSetting llSetting = (ListListSetting) entry.getValue();
    112                 Collection<Collection<String>> newLists = getArray(mainpref, key, true);
     112                List<List<String>> newLists = getListOfLists(mainpref, key, true);
    113113                if (newLists == null) continue;
    114114
    115                 for (Collection<String> list : llSetting.getValue()) {
     115                for (List<String> list : llSetting.getValue()) {
    116116                    // add nonexisting list (equals comparison for lists is used implicitly)
    117117                    if (!newLists.contains(list)) {
     
    119119                    }
    120120                }
    121                 mainpref.putArray(key, newLists);
     121                mainpref.putListOfLists(key, newLists);
    122122            } else if (entry.getValue() instanceof MapListSetting) {
    123123                MapListSetting mlSetting = (MapListSetting) entry.getValue();
     
    133133                    }
    134134                }
    135                 mainpref.putListOfStructs(entry.getKey(), newMaps);
     135                mainpref.putListOfMaps(entry.getKey(), newMaps);
    136136            }
    137137        }
     
    155155            } else if (entry.getValue() instanceof ListSetting) {
    156156                ListSetting lSetting = (ListSetting) entry.getValue();
    157                 Collection<String> newItems = getCollection(mainpref, key, true);
     157                List<String> newItems = getList(mainpref, key, true);
    158158                if (newItems == null) continue;
    159159
     
    163163                    newItems.remove(item);
    164164                }
    165                 mainpref.putCollection(entry.getKey(), newItems);
     165                mainpref.putList(entry.getKey(), newItems);
    166166            } else if (entry.getValue() instanceof ListListSetting) {
    167167                ListListSetting llSetting = (ListListSetting) entry.getValue();
    168                 Collection<Collection<String>> newLists = getArray(mainpref, key, true);
     168                List<List<String>> newLists = getListOfLists(mainpref, key, true);
    169169                if (newLists == null) continue;
    170170
    171171                // if items are found in one of lists, remove that list!
    172                 Iterator<Collection<String>> listIterator = newLists.iterator();
     172                Iterator<List<String>> listIterator = newLists.iterator();
    173173                while (listIterator.hasNext()) {
    174174                    Collection<String> list = listIterator.next();
     
    182182                }
    183183
    184                 mainpref.putArray(key, newLists);
     184                mainpref.putListOfLists(key, newLists);
    185185            } else if (entry.getValue() instanceof MapListSetting) {
    186186                MapListSetting mlSetting = (MapListSetting) entry.getValue();
     
    199199                    }
    200200                }
    201                 mainpref.putListOfStructs(entry.getKey(), newMaps);
     201                mainpref.putListOfMaps(entry.getKey(), newMaps);
    202202            }
    203203        }
     
    223223    }
    224224
    225     private static Collection<String> getCollection(Preferences mainpref, String key, boolean warnUnknownDefault) {
     225    private static List<String> getList(Preferences mainpref, String key, boolean warnUnknownDefault) {
    226226        ListSetting existing = Utils.cast(mainpref.settingsMap.get(key), ListSetting.class);
    227227        ListSetting defaults = Utils.cast(mainpref.defaultsMap.get(key), ListSetting.class);
     
    236236    }
    237237
    238     private static Collection<Collection<String>> getArray(Preferences mainpref, String key, boolean warnUnknownDefault) {
     238    private static List<List<String>> getListOfLists(Preferences mainpref, String key, boolean warnUnknownDefault) {
    239239        ListListSetting existing = Utils.cast(mainpref.settingsMap.get(key), ListListSetting.class);
    240240        ListListSetting defaults = Utils.cast(mainpref.defaultsMap.get(key), ListListSetting.class);
  • trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java

    r12718 r12841  
    7474        // Currently you have to undo the commands one by one. If
    7575        // this changes, a higher default value may be reasonable.
    76         if (commands.size() > Main.pref.getInteger("undo.max", 1000)) {
     76        if (commands.size() > Main.pref.getInt("undo.max", 1000)) {
    7777            commands.removeFirst();
    7878        }
  • trunk/src/org/openstreetmap/josm/data/imagery/CachedTileLoaderFactory.java

    r12620 r12841  
    7272
    7373        return getLoader(listener, cache,
    74                 (int) TimeUnit.SECONDS.toMillis(Main.pref.getInteger("socket.timeout.connect", 15)),
    75                 (int) TimeUnit.SECONDS.toMillis(Main.pref.getInteger("socket.timeout.read", 30)),
     74                (int) TimeUnit.SECONDS.toMillis(Main.pref.getInt("socket.timeout.connect", 15)),
     75                (int) TimeUnit.SECONDS.toMillis(Main.pref.getInt("socket.timeout.read", 30)),
    7676                headers);
    7777    }
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java

    r12620 r12841  
    817817    public void clearId() {
    818818        if (this.id != null) {
    819             Collection<String> newAddedIds = new TreeSet<>(Main.pref.getCollection("imagery.layers.addedIds"));
     819            Collection<String> newAddedIds = new TreeSet<>(Main.pref.getList("imagery.layers.addedIds"));
    820820            newAddedIds.add(this.id);
    821             Main.pref.putCollection("imagery.layers.addedIds", newAddedIds);
     821            Main.pref.putList("imagery.layers.addedIds", new ArrayList<>(newAddedIds));
    822822        }
    823823        setId(null);
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java

    r12635 r12841  
    5757     */
    5858    public static Collection<String> getImageryLayersSites() {
    59         return Main.pref.getCollection("imagery.layers.sites", Arrays.asList(DEFAULT_LAYER_SITES));
     59        return Main.pref.getList("imagery.layers.sites", Arrays.asList(DEFAULT_LAYER_SITES));
    6060    }
    6161
     
    236236        // add new default entries to the user selection
    237237        boolean changed = false;
    238         Collection<String> knownDefaults = new TreeSet<>(Main.pref.getCollection("imagery.layers.default"));
     238        Collection<String> knownDefaults = new TreeSet<>(Main.pref.getList("imagery.layers.default"));
    239239        Collection<String> newKnownDefaults = new TreeSet<>();
    240240        for (ImageryInfo def : defaultLayers) {
     
    279279            newKnownDefaults.addAll(knownDefaults);
    280280        }
    281         Main.pref.putCollection("imagery.layers.default", newKnownDefaults);
     281        Main.pref.putList("imagery.layers.default", new ArrayList<>(newKnownDefaults));
    282282
    283283        // automatically update user entries with same id as a default entry
  • trunk/src/org/openstreetmap/josm/data/oauth/OAuthAccessTokenHolder.java

    r12686 r12841  
    177177        CheckParameterUtil.ensureParameterNotNull(preferences, "preferences");
    178178        CheckParameterUtil.ensureParameterNotNull(cm, "cm");
    179         preferences.put("oauth.access-token.save-to-preferences", saveToPreferences);
     179        preferences.putBoolean("oauth.access-token.save-to-preferences", saveToPreferences);
    180180        try {
    181181            if (!saveToPreferences) {
  • trunk/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java

    r12735 r12841  
    105105        if (namingTagsForRelations == null) {
    106106            namingTagsForRelations = new ArrayList<>(
    107                     Main.pref.getCollection("relation.nameOrder", Arrays.asList(DEFAULT_NAMING_TAGS_FOR_RELATIONS))
     107                    Main.pref.getList("relation.nameOrder", Arrays.asList(DEFAULT_NAMING_TAGS_FOR_RELATIONS))
    108108                    );
    109109        }
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r12816 r12841  
    650650            l.addAll(getDiscardableKeys());
    651651            l.addAll(getWorkInProgressKeys());
    652             uninteresting = new HashSet<>(Main.pref.getCollection("tags.uninteresting", l));
     652            uninteresting = new HashSet<>(Main.pref.getList("tags.uninteresting", l));
    653653        }
    654654        return uninteresting;
     
    662662    public static Collection<String> getDiscardableKeys() {
    663663        if (discardable == null) {
    664             discardable = new HashSet<>(Main.pref.getCollection("tags.discardable",
     664            discardable = new HashSet<>(Main.pref.getList("tags.discardable",
    665665                    Arrays.asList(
    666666                            "created_by",
     
    720720    public static Collection<String> getWorkInProgressKeys() {
    721721        if (workinprogress == null) {
    722             workinprogress = new HashSet<>(Main.pref.getCollection("tags.workinprogress",
     722            workinprogress = new HashSet<>(Main.pref.getList("tags.workinprogress",
    723723                    Arrays.asList("note", "fixme", "FIXME")));
    724724        }
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java

    r12620 r12841  
    182182     */
    183183    protected void getSettings(boolean virtual) {
    184         this.virtualNodeSize = virtual ? Main.pref.getInteger("mappaint.node.virtual-size", 8) / 2 : 0;
    185         this.virtualNodeSpace = Main.pref.getInteger("mappaint.node.virtual-space", 70);
    186         this.segmentNumberSpace = Main.pref.getInteger("mappaint.segmentnumber.space", 40);
     184        this.virtualNodeSize = virtual ? Main.pref.getInt("mappaint.node.virtual-size", 8) / 2 : 0;
     185        this.virtualNodeSpace = Main.pref.getInt("mappaint.node.virtual-space", 70);
     186        this.segmentNumberSpace = Main.pref.getInt("mappaint.segmentnumber.space", 40);
    187187        getColors();
    188188    }
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/ComputeStyleListWorker.java

    r12813 r12841  
    6060        this.output = output;
    6161        this.directExecutionTaskSize = directExecutionTaskSize;
    62         this.drawArea = circum <= Main.pref.getInteger("mappaint.fillareas", 10_000_000);
     62        this.drawArea = circum <= Main.pref.getInt("mappaint.fillareas", 10_000_000);
    6363        this.drawMultipolygon = drawArea && Main.pref.getBoolean("mappaint.multipolygon", true);
    6464        this.drawRestriction = Main.pref.getBoolean("mappaint.restriction", true);
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintSettings.java

    r11100 r12841  
    7676        showOnewayArrow = Main.pref.getBoolean("draw.oneway", true);
    7777        useRealWidth = Main.pref.getBoolean("mappaint.useRealWidth", false);
    78         defaultSegmentWidth = Main.pref.getInteger("mappaint.segment.default-width", 2);
     78        defaultSegmentWidth = Main.pref.getInt("mappaint.segment.default-width", 2);
    7979
    8080        selectedColor = PaintColors.SELECTED.get();
     
    9595        showHeadArrowOnly = Main.pref.getBoolean("draw.segment.head_only", false);
    9696
    97         showNamesDistance = Main.pref.getInteger("mappaint.shownames", 10_000_000);
    98         useStrokesDistance = Main.pref.getInteger("mappaint.strokes", 10_000_000);
    99         showIconsDistance = Main.pref.getInteger("mappaint.showicons", 10_000_000);
    100 
    101         selectedNodeSize = Main.pref.getInteger("mappaint.node.selected-size", 5);
    102         unselectedNodeSize = Main.pref.getInteger("mappaint.node.unselected-size", 3);
    103         connectionNodeSize = Main.pref.getInteger("mappaint.node.connection-size", 5);
    104         taggedNodeSize = Main.pref.getInteger("mappaint.node.tagged-size", 3);
     97        showNamesDistance = Main.pref.getInt("mappaint.shownames", 10_000_000);
     98        useStrokesDistance = Main.pref.getInt("mappaint.strokes", 10_000_000);
     99        showIconsDistance = Main.pref.getInt("mappaint.showicons", 10_000_000);
     100
     101        selectedNodeSize = Main.pref.getInt("mappaint.node.selected-size", 5);
     102        unselectedNodeSize = Main.pref.getInt("mappaint.node.unselected-size", 3);
     103        connectionNodeSize = Main.pref.getInt("mappaint.node.connection-size", 5);
     104        taggedNodeSize = Main.pref.getInt("mappaint.node.tagged-size", 3);
    105105        fillSelectedNode = Main.pref.getBoolean("mappaint.node.fill-selected", true);
    106106        fillUnselectedNode = Main.pref.getBoolean("mappaint.node.fill-unselected", false);
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java

    r12620 r12841  
    9898            if (Main.pref == null) return;
    9999            Collection<String> literals;
    100             literals = Main.pref.getCollection(PREF_KEY_OUTER_ROLES);
     100            literals = Main.pref.getList(PREF_KEY_OUTER_ROLES);
    101101            if (literals != null && !literals.isEmpty()) {
    102102                setNormalized(literals, outerExactRoles);
    103103            }
    104             literals = Main.pref.getCollection(PREF_KEY_OUTER_ROLE_PREFIXES);
     104            literals = Main.pref.getList(PREF_KEY_OUTER_ROLE_PREFIXES);
    105105            if (literals != null && !literals.isEmpty()) {
    106106                setNormalized(literals, outerRolePrefixes);
    107107            }
    108             literals = Main.pref.getCollection(PREF_KEY_INNER_ROLES);
     108            literals = Main.pref.getList(PREF_KEY_INNER_ROLES);
    109109            if (literals != null && !literals.isEmpty()) {
    110110                setNormalized(literals, innerExactRoles);
    111111            }
    112             literals = Main.pref.getCollection(PREF_KEY_INNER_ROLE_PREFIXES);
     112            literals = Main.pref.getList(PREF_KEY_INNER_ROLE_PREFIXES);
    113113            if (literals != null && !literals.isEmpty()) {
    114114                setNormalized(literals, innerRolePrefixes);
  • trunk/src/org/openstreetmap/josm/data/preferences/sources/MapPaintPrefHelper.java

    r12825 r12841  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.util.ArrayList;
    67import java.util.Arrays;
    78import java.util.Collection;
     
    5253        boolean changed = false;
    5354
    54         Collection<String> knownDefaults = new TreeSet<>(Main.pref.getCollection("mappaint.style.known-defaults"));
     55        Collection<String> knownDefaults = new TreeSet<>(Main.pref.getList("mappaint.style.known-defaults"));
    5556
    5657        Collection<ExtendedSourceEntry> defaults = getDefault();
     
    7071            knownDefaults.add(def.url);
    7172        }
    72         Main.pref.putCollection("mappaint.style.known-defaults", knownDefaults);
     73        Main.pref.putList("mappaint.style.known-defaults", new ArrayList<>(knownDefaults));
    7374
    7475        // XML style is not bundled anymore
  • trunk/src/org/openstreetmap/josm/data/preferences/sources/SourcePrefHelper.java

    r12825 r12841  
    5858    public List<SourceEntry> get() {
    5959
    60         Collection<Map<String, String>> src = Main.pref.getListOfStructs(pref, (Collection<Map<String, String>>) null);
     60        List<Map<String, String>> src = Main.pref.getListOfMaps(pref, null);
    6161        if (src == null)
    6262            return new ArrayList<>(getDefault());
     
    7878     */
    7979    public boolean put(Collection<? extends SourceEntry> entries) {
    80         Collection<Map<String, String>> setting = serializeList(entries);
    81         boolean unset = Main.pref.getListOfStructs(pref, (Collection<Map<String, String>>) null) == null;
     80        List<Map<String, String>> setting = serializeList(entries);
     81        boolean unset = Main.pref.getListOfMaps(pref, null) == null;
    8282        if (unset) {
    8383            Collection<Map<String, String>> def = serializeList(getDefault());
     
    8585                return false;
    8686        }
    87         return Main.pref.putListOfStructs(pref, setting);
     87        return Main.pref.putListOfMaps(pref, setting);
    8888    }
    8989
    90     private Collection<Map<String, String>> serializeList(Collection<? extends SourceEntry> entries) {
    91         Collection<Map<String, String>> setting = new ArrayList<>(entries.size());
     90    private List<Map<String, String>> serializeList(Collection<? extends SourceEntry> entries) {
     91        List<Map<String, String>> setting = new ArrayList<>(entries.size());
    9292        for (SourceEntry e : entries) {
    9393            setting.add(serialize(e));
  • trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java

    r12667 r12841  
    282282
    283283    private static void applyPrefs(Map<String, Test> tests, boolean beforeUpload) {
    284         for (String testName : Main.pref.getCollection(beforeUpload
     284        for (String testName : Main.pref.getList(beforeUpload
    285285        ? ValidatorPrefHelper.PREF_SKIP_TESTS_BEFORE_UPLOAD : ValidatorPrefHelper.PREF_SKIP_TESTS)) {
    286286            Test test = tests.get(testName);
  • trunk/src/org/openstreetmap/josm/data/validation/tests/LongSegment.java

    r12050 r12841  
    112112    public void startTest(ProgressMonitor monitor) {
    113113        super.startTest(monitor);
    114         maxlength = Main.pref.getInteger("validator.maximum.segment.length", 15_000);
     114        maxlength = Main.pref.getInt("validator.maximum.segment.length", 15_000);
    115115        reported = new HashSet<>();
    116116        visitedWays = new HashSet<>();
  • trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java

    r11913 r12841  
    2323import org.openstreetmap.josm.data.osm.Way;
    2424import org.openstreetmap.josm.data.osm.WaySegment;
    25 import org.openstreetmap.josm.data.preferences.CollectionProperty;
     25import org.openstreetmap.josm.data.preferences.ListProperty;
    2626import org.openstreetmap.josm.data.validation.Severity;
    2727import org.openstreetmap.josm.data.validation.Test;
     
    5050    protected static final int DUPLICATE_WAY_SEGMENT = 121;
    5151
    52     protected static final CollectionProperty IGNORED_KEYS = new CollectionProperty(
     52    protected static final ListProperty IGNORED_KEYS = new ListProperty(
    5353            "overlapping-ways.ignored-keys", Arrays.asList("barrier", "building", "historic:building", "man_made"));
    5454
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r12649 r12841  
    1313import java.util.Collection;
    1414import java.util.HashMap;
    15 import java.util.HashSet;
    1615import java.util.List;
    1716import java.util.Locale;
     
    159158    protected EditableList sourcesList;
    160159
    161     private static final Set<String> DEFAULT_SOURCES = new HashSet<>(Arrays.asList(/*DATA_FILE, */IGNORE_FILE, SPELL_FILE));
     160    private static final List<String> DEFAULT_SOURCES = Arrays.asList(/*DATA_FILE, */IGNORE_FILE, SPELL_FILE);
    162161
    163162    /**
     
    191190
    192191        StringBuilder errorSources = new StringBuilder();
    193         for (String source : Main.pref.getCollection(PREF_SOURCES, DEFAULT_SOURCES)) {
     192        for (String source : Main.pref.getList(PREF_SOURCES, DEFAULT_SOURCES)) {
    194193            try (
    195194                CachedFile cf = new CachedFile(source);
     
    293292            }
    294293            // TODO directionKeys are no longer in OsmPrimitive (search pattern is used instead)
    295             for (String a : Main.pref.getCollection(ValidatorPrefHelper.PREFIX + ".knownkeys",
     294            for (String a : Main.pref.getList(ValidatorPrefHelper.PREFIX + ".knownkeys",
    296295                    Arrays.asList("is_in", "int_ref", "fixme", "population"))) {
    297296                additionalPresetsValueData.putVoid(a);
     
    636635        testPanel.add(prefCheckComplexBeforeUpload, a);
    637636
    638         final Collection<String> sources = Main.pref.getCollection(PREF_SOURCES, DEFAULT_SOURCES);
     637        final Collection<String> sources = Main.pref.getList(PREF_SOURCES, DEFAULT_SOURCES);
    639638        sourcesList = new EditableList(tr("TagChecker source"));
    640639        sourcesList.setItems(sources);
     
    682681                || prefCheckFixmesBeforeUpload.isSelected() || prefCheckComplexBeforeUpload.isSelected();
    683682
    684         Main.pref.put(PREF_CHECK_VALUES, prefCheckValues.isSelected());
    685         Main.pref.put(PREF_CHECK_COMPLEX, prefCheckComplex.isSelected());
    686         Main.pref.put(PREF_CHECK_KEYS, prefCheckKeys.isSelected());
    687         Main.pref.put(PREF_CHECK_FIXMES, prefCheckFixmes.isSelected());
    688         Main.pref.put(PREF_CHECK_VALUES_BEFORE_UPLOAD, prefCheckValuesBeforeUpload.isSelected());
    689         Main.pref.put(PREF_CHECK_COMPLEX_BEFORE_UPLOAD, prefCheckComplexBeforeUpload.isSelected());
    690         Main.pref.put(PREF_CHECK_KEYS_BEFORE_UPLOAD, prefCheckKeysBeforeUpload.isSelected());
    691         Main.pref.put(PREF_CHECK_FIXMES_BEFORE_UPLOAD, prefCheckFixmesBeforeUpload.isSelected());
    692         return Main.pref.putCollection(PREF_SOURCES, sourcesList.getItems());
     683        Main.pref.putBoolean(PREF_CHECK_VALUES, prefCheckValues.isSelected());
     684        Main.pref.putBoolean(PREF_CHECK_COMPLEX, prefCheckComplex.isSelected());
     685        Main.pref.putBoolean(PREF_CHECK_KEYS, prefCheckKeys.isSelected());
     686        Main.pref.putBoolean(PREF_CHECK_FIXMES, prefCheckFixmes.isSelected());
     687        Main.pref.putBoolean(PREF_CHECK_VALUES_BEFORE_UPLOAD, prefCheckValuesBeforeUpload.isSelected());
     688        Main.pref.putBoolean(PREF_CHECK_COMPLEX_BEFORE_UPLOAD, prefCheckComplexBeforeUpload.isSelected());
     689        Main.pref.putBoolean(PREF_CHECK_KEYS_BEFORE_UPLOAD, prefCheckKeysBeforeUpload.isSelected());
     690        Main.pref.putBoolean(PREF_CHECK_FIXMES_BEFORE_UPLOAD, prefCheckFixmesBeforeUpload.isSelected());
     691        return Main.pref.putList(PREF_SOURCES, sourcesList.getItems());
    693692    }
    694693
  • trunk/src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java

    r11921 r12841  
    6060                immediateChoices.get(prefKey),
    6161                sessionChoices.get(prefKey),
    62                 !Main.pref.getBoolean("message." + prefKey, true) ? Main.pref.getInteger("message." + prefKey + ".value", -1) : -1
     62                !Main.pref.getBoolean("message." + prefKey, true) ? Main.pref.getInt("message." + prefKey + ".value", -1) : -1
    6363        );
    6464    }
     
    239239                    break;
    240240                case PERMANENT:
    241                     Main.pref.put("message." + prefKey, false);
    242                     Main.pref.putInteger("message." + prefKey + ".value", value);
     241                    Main.pref.putBoolean("message." + prefKey, false);
     242                    Main.pref.putInt("message." + prefKey + ".value", value);
    243243                    break;
    244244            }
  • trunk/src/org/openstreetmap/josm/gui/GettingStarted.java

    r12620 r12841  
    9595            String motd = new WikiReader().readLang("StartupPage");
    9696            // Save this to prefs in case JOSM is updated so MOTD can be refreshed
    97             Main.pref.putInteger("cache.motd.html.version", myVersion);
     97            Main.pref.putInt("cache.motd.html.version", myVersion);
    9898            Main.pref.put("cache.motd.html.java", myJava);
    9999            Main.pref.put("cache.motd.html.lang", myLang);
     
    115115            // 2. Cannot be written (e.g. while developing). Obviously we don't want to update
    116116            // everytime because of something we can't read.
    117             return (Main.pref.getInteger("cache.motd.html.version", -999) == myVersion)
     117            return (Main.pref.getInt("cache.motd.html.version", -999) == myVersion)
    118118            && Main.pref.get("cache.motd.html.java").equals(myJava)
    119119            && Main.pref.get("cache.motd.html.lang").equals(myLang);
  • trunk/src/org/openstreetmap/josm/gui/IconToggleButton.java

    r11553 r12841  
    120120            Main.pref.put(getPreferenceKey(), null);
    121121        } else {
    122             Main.pref.put(getPreferenceKey(), b);
     122            Main.pref.putBoolean(getPreferenceKey(), b);
    123123        }
    124124    }
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r12828 r12841  
    12521252                if (wasv6 && !hasv6) {
    12531253                    Logging.info(tr("Detected no useable IPv6 network, prefering IPv4 over IPv6 after next restart."));
    1254                     Main.pref.put("validated.ipv6", hasv6); // be sure it is stored before the restart!
     1254                    Main.pref.putBoolean("validated.ipv6", hasv6); // be sure it is stored before the restart!
    12551255                    try {
    12561256                        RestartAction.restartJOSM();
     
    12591259                    }
    12601260                }
    1261                 Main.pref.put("validated.ipv6", hasv6);
     1261                Main.pref.putBoolean("validated.ipv6", hasv6);
    12621262            }, "IPv6-checker").start();
    12631263        }
  • trunk/src/org/openstreetmap/josm/gui/MainFrame.java

    r12678 r12841  
    110110            geometry.remember("gui.geometry");
    111111        }
    112         Main.pref.put("gui.maximized", (windowState & JFrame.MAXIMIZED_BOTH) != 0);
     112        Main.pref.putBoolean("gui.maximized", (windowState & JFrame.MAXIMIZED_BOTH) != 0);
    113113    }
    114114
  • trunk/src/org/openstreetmap/josm/gui/MapFrame.java

    r12636 r12841  
    583583            public void actionPerformed(ActionEvent e) {
    584584                boolean sel = ((JCheckBoxMenuItem) e.getSource()).getState();
    585                 Main.pref.put("sidetoolbar.always-visible", sel);
     585                Main.pref.putBoolean("sidetoolbar.always-visible", sel);
    586586            }
    587587        });
     
    625625                @Override
    626626                public void actionPerformed(ActionEvent e) {
    627                     Main.pref.put("sidetoolbar.visible", false);
     627                    Main.pref.putBoolean("sidetoolbar.visible", false);
    628628                }
    629629            });
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r12735 r12841  
    775775            public void actionPerformed(ActionEvent e) {
    776776                boolean sel = ((JCheckBoxMenuItem) e.getSource()).getState();
    777                 Main.pref.put("statusbar.always-visible", sel);
     777                Main.pref.putBoolean("statusbar.always-visible", sel);
    778778            }
    779779        });
     
    10791079        // Compute total length of selected way(s) until an arbitrary limit set to 250 ways
    10801080        // in order to prevent performance issue if a large number of ways are selected (old behaviour kept in that case, see #8403)
    1081         int maxWays = Math.max(1, Main.pref.getInteger("selection.max-ways-for-statusline", 250));
     1081        int maxWays = Math.max(1, Main.pref.getInt("selection.max-ways-for-statusline", 250));
    10821082        if (!ways.isEmpty() && ways.size() <= maxWays) {
    10831083            dist = 0.0;
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r12778 r12841  
    871871        if ((now.getTime() - zoomTimestamp.getTime()) > (Main.pref.getDouble("zoom.undo.delay", 1.0) * 1000)) {
    872872            zoomUndoBuffer.push(new ZoomData(center, scale));
    873             if (zoomUndoBuffer.size() > Main.pref.getInteger("zoom.undo.max", 50)) {
     873            if (zoomUndoBuffer.size() > Main.pref.getInt("zoom.undo.max", 50)) {
    874874                zoomUndoBuffer.remove(0);
    875875            }
     
    11441144
    11451145        if (ds != null) {
    1146             double snapDistanceSq = Main.pref.getInteger("mappaint.segment.snap-distance", 10);
     1146            double snapDistanceSq = Main.pref.getInt("mappaint.segment.snap-distance", 10);
    11471147            snapDistanceSq *= snapDistanceSq;
    11481148
    1149             for (Way w : ds.searchWays(getBBox(p, Main.pref.getInteger("mappaint.segment.snap-distance", 10)))) {
     1149            for (Way w : ds.searchWays(getBBox(p, Main.pref.getInt("mappaint.segment.snap-distance", 10)))) {
    11501150                if (!predicate.test(w)) {
    11511151                    continue;
  • trunk/src/org/openstreetmap/josm/gui/Notification.java

    r11100 r12841  
    4343     * E.g. "Please select at least one node".
    4444     */
    45     public static final int TIME_SHORT = Main.pref.getInteger("notification-time-short-ms", 3000);
     45    public static final int TIME_SHORT = Main.pref.getInt("notification-time-short-ms", 3000);
    4646
    4747    /**
    4848     * Short message of one or two lines (5 s).
    4949     */
    50     public static final int TIME_DEFAULT = Main.pref.getInteger("notification-time-default-ms", 5000);
     50    public static final int TIME_DEFAULT = Main.pref.getInt("notification-time-default-ms", 5000);
    5151
    5252    /**
    5353     * Somewhat longer message (10 s).
    5454     */
    55     public static final int TIME_LONG = Main.pref.getInteger("notification-time-long-ms", 10_000);
     55    public static final int TIME_LONG = Main.pref.getInt("notification-time-long-ms", 10_000);
    5656
    5757    /**
     
    5959     * (Make sure is still sensible to show as a notification)
    6060     */
    61     public static final int TIME_VERY_LONG = Main.pref.getInteger("notification-time-very_long-ms", 20_000);
     61    public static final int TIME_VERY_LONG = Main.pref.getInt("notification-time-very_long-ms", 20_000);
    6262
    6363    private Component content;
  • trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java

    r12675 r12841  
    8282                int w = getWidth();
    8383                if (w > 200) {
    84                     Main.pref.putInteger("progressdialog.size", w);
     84                    Main.pref.putInt("progressdialog.size", w);
    8585                }
    8686            }
     
    9898        setDropTarget(null); // Workaround to JDK bug 7027598/7100524/7169912 (#8613)
    9999        pack();
    100         setSize(Main.pref.getInteger("progressdialog.size", 600), getSize().height);
     100        setSize(Main.pref.getInt("progressdialog.size", 600), getSize().height);
    101101    }
    102102
  • trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java

    r12620 r12841  
    162162            setFileCacheEnabled(Main.pref.getBoolean("slippy_map_chooser.file_cache", true));
    163163        }
    164         setMaxTilesInMemory(Main.pref.getInteger("slippy_map_chooser.max_tiles", 1000));
     164        setMaxTilesInMemory(Main.pref.getInt("slippy_map_chooser.max_tiles", 1000));
    165165
    166166        List<TileSource> tileSources = getAllTileSources();
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolver.java

    r11772 r12841  
    7878     */
    7979    public void rememberPreferences() {
    80         Main.pref.put(getClass().getName() + ".showTagsWithConflictsOnly", cbShowTagsWithConflictsOnly.isSelected());
    81         Main.pref.put(getClass().getName() + ".showTagsWithMultiValuesOnly", cbShowTagsWithMultiValuesOnly.isSelected());
     80        Main.pref.putBoolean(getClass().getName() + ".showTagsWithConflictsOnly", cbShowTagsWithConflictsOnly.isSelected());
     81        Main.pref.putBoolean(getClass().getName() + ".showTagsWithMultiValuesOnly", cbShowTagsWithMultiValuesOnly.isSelected());
    8282    }
    8383
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java

    r12636 r12841  
    275275        @Override
    276276        public void itemStateChanged(ItemEvent e) {
    277             Main.pref.put("changeset-dialog.for-selected-objects-only", cbInSelectionOnly.isSelected());
     277            Main.pref.putBoolean("changeset-dialog.for-selected-objects-only", cbInSelectionOnly.isSelected());
    278278            pnlList.removeAll();
    279279            if (cbInSelectionOnly.isSelected()) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/OsmIdSelectionDialog.java

    r12301 r12841  
    180180    protected void restorePrimitivesHistory(HistoryComboBox cbHistory) {
    181181        List<String> cmtHistory = new LinkedList<>(
    182                 Main.pref.getCollection(getClass().getName() + ".primitivesHistory", new LinkedList<String>()));
     182                Main.pref.getList(getClass().getName() + ".primitivesHistory", new LinkedList<String>()));
    183183        // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    184184        Collections.reverse(cmtHistory);
     
    193193    protected void remindPrimitivesHistory(HistoryComboBox cbHistory) {
    194194        cbHistory.addCurrentItemToHistory();
    195         Main.pref.putCollection(getClass().getName() + ".primitivesHistory", cbHistory.getHistory());
     195        Main.pref.putList(getClass().getName() + ".primitivesHistory", cbHistory.getHistory());
    196196    }
    197197
     
    208208    public void setupDialog() {
    209209        setContent(panel, false);
    210         cbType.setSelectedIndex(Main.pref.getInteger("downloadprimitive.lasttype", 0));
     210        cbType.setSelectedIndex(Main.pref.getInt("downloadprimitive.lasttype", 0));
    211211        tfId.setType(cbType.getType());
    212212        if (Main.pref.getBoolean("downloadprimitive.autopaste", true)) {
     
    221221        String buf = ClipboardUtils.getClipboardStringContent();
    222222        if (buf == null || buf.isEmpty()) return;
    223         if (buf.length() > Main.pref.getInteger("downloadprimitive.max-autopaste-length", 2000)) return;
     223        if (buf.length() > Main.pref.getInt("downloadprimitive.max-autopaste-length", 2000)) return;
    224224        final List<SimplePrimitiveId> ids = SimplePrimitiveId.fuzzyParse(buf);
    225225        if (!ids.isEmpty()) {
     
    244244    @Override public void windowClosed(WindowEvent e) {
    245245        if (e != null && e.getComponent() == this && getValue() == getContinueButtonIndex()) {
    246             Main.pref.putInteger("downloadprimitive.lasttype", cbType.getSelectedIndex());
     246            Main.pref.putInt("downloadprimitive.lasttype", cbType.getSelectedIndex());
    247247
    248248            if (!tfId.readIds()) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r12663 r12841  
    524524                }
    525525            }
    526             int maxsize = Main.pref.getInteger("select.history-size", SELECTION_HISTORY_SIZE);
     526            int maxsize = Main.pref.getInt("select.history-size", SELECTION_HISTORY_SIZE);
    527527            while (history.size() > maxsize) {
    528528                history.removeLast();
     
    662662         */
    663663        public synchronized void sort() {
    664             if (selection.size() <= Main.pref.getInteger("selection.no_sort_above", 100_000)) {
    665                 boolean quick = selection.size() > Main.pref.getInteger("selection.fast_sort_above", 10_000);
     664            if (selection.size() <= Main.pref.getInt("selection.no_sort_above", 100_000)) {
     665                boolean quick = selection.size() > Main.pref.getInt("selection.fast_sort_above", 10_000);
    666666                Comparator<OsmPrimitive> c = Main.pref.getBoolean("selection.sort_relations_before_ways", true)
    667667                        ? OsmPrimitiveComparator.orderingRelationsWaysNodes()
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    r12678 r12841  
    773773    protected void setIsShowing(boolean val) {
    774774        isShowing = val;
    775         Main.pref.put(preferencePrefix+".visible", val);
     775        Main.pref.putBoolean(preferencePrefix+".visible", val);
    776776        stateChanged();
    777777    }
     
    782782        }
    783783        isDocked = val;
    784         Main.pref.put(preferencePrefix+".docked", val);
     784        Main.pref.putBoolean(preferencePrefix+".docked", val);
    785785        stateChanged();
    786786    }
     
    788788    protected void setIsCollapsed(boolean val) {
    789789        isCollapsed = val;
    790         Main.pref.put(preferencePrefix+".minimized", val);
     790        Main.pref.putBoolean(preferencePrefix+".minimized", val);
    791791        stateChanged();
    792792    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java

    r11326 r12841  
    209209     */
    210210    public void rememberSettings() {
    211         Main.pref.put("changeset-query.advanced.user-restrictions", cbUserRestriction.isSelected());
    212         Main.pref.put("changeset-query.advanced.open-restrictions", cbOpenAndCloseRestrictions.isSelected());
    213         Main.pref.put("changeset-query.advanced.time-restrictions", cbTimeRestrictions.isSelected());
    214         Main.pref.put("changeset-query.advanced.bbox-restrictions", cbBoundingBoxRestriction.isSelected());
     211        Main.pref.putBoolean("changeset-query.advanced.user-restrictions", cbUserRestriction.isSelected());
     212        Main.pref.putBoolean("changeset-query.advanced.open-restrictions", cbOpenAndCloseRestrictions.isSelected());
     213        Main.pref.putBoolean("changeset-query.advanced.time-restrictions", cbTimeRestrictions.isSelected());
     214        Main.pref.putBoolean("changeset-query.advanced.bbox-restrictions", cbBoundingBoxRestriction.isSelected());
    215215
    216216        pnlUserRestriction.rememberSettings();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanel.java

    r12743 r12841  
    191191            Main.pref.put("changeset-query.basic.query", q.toString());
    192192        }
    193         Main.pref.put("changeset-query.basic.my-changesets-only", cbMyChangesetsOnly.isSelected());
     193        Main.pref.putBoolean("changeset-query.basic.my-changesets-only", cbMyChangesetsOnly.isSelected());
    194194    }
    195195
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/RecentTagCollection.java

    r12659 r12841  
    1212import org.openstreetmap.josm.data.osm.search.SearchSetting;
    1313import org.openstreetmap.josm.data.osm.search.SearchCompiler;
    14 import org.openstreetmap.josm.data.preferences.CollectionProperty;
     14import org.openstreetmap.josm.data.preferences.ListProperty;
    1515
    1616/**
     
    4444    }
    4545
    46     public void loadFromPreference(CollectionProperty property) {
     46    public void loadFromPreference(ListProperty property) {
    4747        recentTags.clear();
    4848        Iterator<String> it = property.get().iterator();
     
    5454    }
    5555
    56     public void saveToPreference(CollectionProperty property) {
     56    public void saveToPreference(ListProperty property) {
    5757        List<String> c = new ArrayList<>(recentTags.size() * 2);
    5858        for (Tag t : recentTags.keySet()) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    r12758 r12841  
    7373import org.openstreetmap.josm.data.osm.search.SearchSetting;
    7474import org.openstreetmap.josm.data.preferences.BooleanProperty;
    75 import org.openstreetmap.josm.data.preferences.CollectionProperty;
     75import org.openstreetmap.josm.data.preferences.ListProperty;
    7676import org.openstreetmap.josm.data.preferences.EnumProperty;
    7777import org.openstreetmap.josm.data.preferences.IntegerProperty;
     
    128128            DEFAULT_LRU_TAGS_NUMBER);
    129129    /** The preference storage of recent tags */
    130     public static final CollectionProperty PROPERTY_RECENT_TAGS = new CollectionProperty("properties.recent-tags",
     130    public static final ListProperty PROPERTY_RECENT_TAGS = new ListProperty("properties.recent-tags",
    131131            Collections.<String>emptyList());
    132132    public static final StringProperty PROPERTY_TAGS_TO_IGNORE = new StringProperty("properties.recent-tags.ignore",
  • trunk/src/org/openstreetmap/josm/gui/download/BookmarkList.java

    r12743 r12841  
    300300     */
    301301    public final void save() {
    302         List<Collection<String>> coll = new LinkedList<>();
     302        List<List<String>> coll = new LinkedList<>();
    303303        for (Object o : ((DefaultListModel<Bookmark>) getModel()).toArray()) {
    304304            if (o instanceof HomeLocationBookmark || o instanceof ChangesetBookmark) {
     
    315315            coll.add(Arrays.asList(array));
    316316        }
    317         Main.pref.putArray("bookmarks", coll);
     317        Main.pref.putListOfLists("bookmarks", coll);
    318318    }
    319319
  • trunk/src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java

    r12279 r12841  
    103103        super.windowClosed(e);
    104104        if (e != null && e.getComponent() == this && getValue() == 1) {
    105             Main.pref.put("downloadprimitive.referrers", referrers.isSelected());
    106             Main.pref.put("downloadprimitive.full", fullRel.isSelected());
    107             Main.pref.put("download.newlayer", newLayer.isSelected());
     105            Main.pref.putBoolean("downloadprimitive.referrers", referrers.isSelected());
     106            Main.pref.putBoolean("downloadprimitive.full", fullRel.isSelected());
     107            Main.pref.putBoolean("download.newlayer", newLayer.isSelected());
    108108        }
    109109    }
  • trunk/src/org/openstreetmap/josm/gui/download/OverpassQueryList.java

    r12620 r12841  
    244244     */
    245245    private void savePreferences() {
    246         Collection<Map<String, String>> toSave = new ArrayList<>(this.items.size());
     246        List<Map<String, String>> toSave = new ArrayList<>(this.items.size());
    247247        for (SelectorItem item : this.items.values()) {
    248248            Map<String, String> it = new HashMap<>();
     
    254254        }
    255255
    256         Main.pref.putListOfStructs(PREFERENCE_ITEMS, toSave);
     256        Main.pref.putListOfMaps(PREFERENCE_ITEMS, toSave);
    257257    }
    258258
     
    263263    private static Map<String, SelectorItem> restorePreferences() {
    264264        Collection<Map<String, String>> toRetrieve =
    265                 Main.pref.getListOfStructs(PREFERENCE_ITEMS, Collections.emptyList());
     265                Main.pref.getListOfMaps(PREFERENCE_ITEMS, Collections.emptyList());
    266266        Map<String, SelectorItem> result = new HashMap<>();
    267267
  • trunk/src/org/openstreetmap/josm/gui/download/OverpassQueryWizardDialog.java

    r12655 r12841  
    2020
    2121import org.openstreetmap.josm.Main;
    22 import org.openstreetmap.josm.data.preferences.CollectionProperty;
     22import org.openstreetmap.josm.data.preferences.ListProperty;
    2323import org.openstreetmap.josm.gui.ExtendedDialog;
    2424import org.openstreetmap.josm.gui.util.GuiHelper;
     
    4747    private static final String SPAN_START = "<span>";
    4848    private static final String SPAN_END = "</span>";
    49     private static final CollectionProperty OVERPASS_WIZARD_HISTORY =
    50             new CollectionProperty("download.overpass.wizard", new ArrayList<String>());
     49    private static final ListProperty OVERPASS_WIZARD_HISTORY =
     50            new ListProperty("download.overpass.wizard", new ArrayList<String>());
    5151    private final transient OverpassTurboQueryWizard overpassQueryBuilder;
    5252
  • trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java

    r12634 r12841  
    115115        cbSearchExpression = new HistoryComboBox();
    116116        cbSearchExpression.setToolTipText(tr("Enter a place name to search for"));
    117         List<String> cmtHistory = new LinkedList<>(Main.pref.getCollection(HISTORY_KEY, new LinkedList<String>()));
     117        List<String> cmtHistory = new LinkedList<>(Main.pref.getList(HISTORY_KEY, new LinkedList<String>()));
    118118        Collections.reverse(cmtHistory);
    119119        cbSearchExpression.setPossibleItems(cmtHistory);
     
    189189                return;
    190190            cbSearchExpression.addCurrentItemToHistory();
    191             Main.pref.putCollection(HISTORY_KEY, cbSearchExpression.getHistory());
     191            Main.pref.putList(HISTORY_KEY, cbSearchExpression.getHistory());
    192192            NameQueryTask task = new NameQueryTask(cbSearchExpression.getText());
    193193            MainApplication.worker.submit(task);
  • trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java

    r11646 r12841  
    341341        Object val = tbl.getColumnModel().getColumn(col).getHeaderValue();
    342342        Component comp = tcr.getTableCellRendererComponent(tbl, val, false, false, -1, col);
    343         maxwidth = Math.max(comp.getPreferredSize().width + Main.pref.getInteger("table.header-inset", 0), maxwidth);
     343        maxwidth = Math.max(comp.getPreferredSize().width + Main.pref.getInt("table.header-inset", 0), maxwidth);
    344344
    345345        int spacing = tbl.getIntercellSpacing().width;
  • trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java

    r12719 r12841  
    7878        hcbUploadComment.setToolTipText(tr("Enter an upload comment"));
    7979        hcbUploadComment.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH);
    80         List<String> cmtHistory = new LinkedList<>(Main.pref.getCollection(HISTORY_KEY, new LinkedList<String>()));
     80        List<String> cmtHistory = new LinkedList<>(Main.pref.getList(HISTORY_KEY, new LinkedList<String>()));
    8181        Collections.reverse(cmtHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    8282        hcbUploadComment.setPossibleItems(cmtHistory);
     
    100100        hcbUploadSource.setToolTipText(tr("Enter a source"));
    101101        hcbUploadSource.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH);
    102         List<String> sourceHistory = new LinkedList<>(Main.pref.getCollection(SOURCE_HISTORY_KEY, getDefaultSources()));
     102        List<String> sourceHistory = new LinkedList<>(Main.pref.getList(SOURCE_HISTORY_KEY, getDefaultSources()));
    103103        Collections.reverse(sourceHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    104104        hcbUploadSource.setPossibleItems(sourceHistory);
     
    166166        // store the history of comments
    167167        hcbUploadComment.addCurrentItemToHistory();
    168         Main.pref.putCollection(HISTORY_KEY, hcbUploadComment.getHistory());
    169         Main.pref.putInteger(HISTORY_LAST_USED_KEY, (int) (TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())));
     168        Main.pref.putList(HISTORY_KEY, hcbUploadComment.getHistory());
     169        Main.pref.putInt(HISTORY_LAST_USED_KEY, (int) (TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())));
    170170        // store the history of sources
    171171        hcbUploadSource.addCurrentItemToHistory();
    172         Main.pref.putCollection(SOURCE_HISTORY_KEY, hcbUploadSource.getHistory());
     172        Main.pref.putList(SOURCE_HISTORY_KEY, hcbUploadSource.getHistory());
    173173    }
    174174
  • trunk/src/org/openstreetmap/josm/gui/io/ChangesetManagementPanel.java

    r12634 r12841  
    256256            case ItemEvent.SELECTED:
    257257                firePropertyChange(CLOSE_CHANGESET_AFTER_UPLOAD, false, true);
    258                 Main.pref.put("upload.changeset.close", true);
     258                Main.pref.putBoolean("upload.changeset.close", true);
    259259                break;
    260260            case ItemEvent.DESELECTED:
    261261                firePropertyChange(CLOSE_CHANGESET_AFTER_UPLOAD, true, false);
    262                 Main.pref.put("upload.changeset.close", false);
     262                Main.pref.putBoolean("upload.changeset.close", false);
    263263                break;
    264264            default: // Do nothing
  • trunk/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java

    r12826 r12841  
    400400                        MainApplication.worker.submit(pluginDownloadTask);
    401401                    }
    402                     Collection<String> pls = new ArrayList<>(Main.pref.getCollection("plugins"));
     402                    List<String> pls = new ArrayList<>(Main.pref.getList("plugins"));
    403403                    for (PluginInformation pi2: toInstallPlugins) {
    404404                        if (!pls.contains(pi2.name)) {
     
    413413                        new File(Main.pref.getPluginsDirectory(), pi4.name+".jar").deleteOnExit();
    414414                    }
    415                     Main.pref.putCollection("plugins", pls);
     415                    Main.pref.putList("plugins", pls);
    416416                });
    417417            }
  • trunk/src/org/openstreetmap/josm/gui/io/RecentlyOpenedFilesMenu.java

    r12634 r12841  
    5858    private void rebuild() {
    5959        removeAll();
    60         Collection<String> fileHistory = Main.pref.getCollection("file-open.history");
     60        Collection<String> fileHistory = Main.pref.getList("file-open.history");
    6161
    6262        for (final String file : fileHistory) {
     
    101101        @Override
    102102        public void actionPerformed(ActionEvent e) {
    103             Main.pref.putCollection("file-open.history", null);
     103            Main.pref.putList("file-open.history", null);
    104104        }
    105105    }
  • trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java

    r12799 r12841  
    653653
    654654    private static String getLastChangesetTagFromHistory(String historyKey, List<String> def) {
    655         Collection<String> history = Main.pref.getCollection(historyKey, def);
    656         int age = (int) (System.currentTimeMillis() / 1000 - Main.pref.getInteger(BasicUploadSettingsPanel.HISTORY_LAST_USED_KEY, 0));
     655        Collection<String> history = Main.pref.getList(historyKey, def);
     656        int age = (int) (System.currentTimeMillis() / 1000 - Main.pref.getInt(BasicUploadSettingsPanel.HISTORY_LAST_USED_KEY, 0));
    657657        if (history != null && age < Main.pref.getLong(BasicUploadSettingsPanel.HISTORY_MAX_AGE_KEY, TimeUnit.HOURS.toMillis(4))
    658658                && !history.isEmpty()) {
  • trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java

    r12687 r12841  
    323323        UploadStrategy strategy = UploadStrategy.getFromPreferences();
    324324        rbStrategy.get(strategy).setSelected(true);
    325         int chunkSize = Main.pref.getInteger("osm-server.upload-strategy.chunk-size", 1);
     325        int chunkSize = Main.pref.getInt("osm-server.upload-strategy.chunk-size", 1);
    326326        tfChunkSize.setText(Integer.toString(chunkSize));
    327327        updateNumRequestsLabels();
     
    337337        try {
    338338            chunkSize = Integer.parseInt(tfChunkSize.getText().trim());
    339             Main.pref.putInteger("osm-server.upload-strategy.chunk-size", chunkSize);
     339            Main.pref.putInt("osm-server.upload-strategy.chunk-size", chunkSize);
    340340        } catch (NumberFormatException e) {
    341341            // don't save invalid value to preferences
  • trunk/src/org/openstreetmap/josm/gui/io/importexport/GpxExporter.java

    r12671 r12841  
    162162        setCanceled(false);
    163163
    164         Main.pref.put("lastAddAuthor", author.isSelected());
     164        Main.pref.putBoolean("lastAddAuthor", author.isSelected());
    165165        if (!authorName.getText().isEmpty()) {
    166166            Main.pref.put("lastAuthorName", authorName.getText());
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r12671 r12841  
    174174                Main.pref.put("geoimage.timezone", timezone.formatTimezone());
    175175                Main.pref.put("geoimage.delta", delta.formatOffset());
    176                 Main.pref.put("geoimage.showThumbs", yLayer.useThumbs);
     176                Main.pref.putBoolean("geoimage.showThumbs", yLayer.useThumbs);
    177177
    178178                yLayer.useThumbs = cbShowThumbs.isSelected();
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerAction.java

    r12636 r12841  
    119119            for (Marker marker : layer.data) {
    120120                final Node node = new Node(marker.getCoor());
    121                 final Collection<String> mapping = Main.pref.getCollection("gpx.to-osm-mapping", Arrays.asList(
     121                final Collection<String> mapping = Main.pref.getList("gpx.to-osm-mapping", Arrays.asList(
    122122                        GpxConstants.GPX_NAME, "name",
    123123                        GpxConstants.GPX_DESC, "description",
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DateFilterPanel.java

    r12377 r12841  
    105105        Main.pref.putLong(prefDateMin, dateFrom.getDate().getTime());
    106106        Main.pref.putLong(prefDateMax, dateTo.getDate().getTime());
    107         Main.pref.put(prefDate0, noTimestampCb.isSelected());
     107        Main.pref.putBoolean(prefDate0, noTimestampCb.isSelected());
    108108    }
    109109
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongPanel.java

    r10611 r12841  
    8585            add(new JLabel(tr("Download near:")), GBC.eol());
    8686            downloadNear = new JList<>(new String[]{tr("track only"), tr("waypoints only"), tr("track and waypoints")});
    87             downloadNear.setSelectedIndex(Main.pref.getInteger(prefNear, 0));
     87            downloadNear.setSelectedIndex(Main.pref.getInt(prefNear, 0));
    8888            add(downloadNear, GBC.eol());
    8989        } else {
     
    138138     */
    139139    protected final void rememberSettings() {
    140         Main.pref.put(prefOsm, isDownloadOsmData());
    141         Main.pref.put(prefGps, isDownloadGpxData());
     140        Main.pref.putBoolean(prefOsm, isDownloadOsmData());
     141        Main.pref.putBoolean(prefGps, isDownloadGpxData());
    142142        Main.pref.putDouble(prefDist, getDistance());
    143143        Main.pref.putDouble(prefArea, getArea());
    144144        if (prefNear != null) {
    145             Main.pref.putInteger(prefNear, getNear());
     145            Main.pref.putInt(prefNear, getNear());
    146146        }
    147147    }
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java

    r12725 r12841  
    183183
    184184    private void setupColors() {
    185         hdopAlpha = Main.pref.getInteger("hdop.color.alpha", -1);
     185        hdopAlpha = Main.pref.getInt("hdop.color.alpha", -1);
    186186        velocityScale = ColorScale.createHSBScale(256);
    187187        /** Colors (without custom alpha channel, if given) for HDOP painting. **/
     
    320320        colorModeDynamic = Main.pref.getBoolean("draw.rawgps.colors.dynamic", spec, false);
    321321        /* good HDOP's are between 1 and 3, very bad HDOP's go into 3 digit values */
    322         hdoprange = Main.pref.getInteger("hdop.range", 7);
    323         minTrackDurationForTimeColoring = Main.pref.getInteger("draw.rawgps.date-coloring-min-dt", 60);
    324         largePointAlpha = Main.pref.getInteger("draw.rawgps.large.alpha", -1) & 0xFF;
     322        hdoprange = Main.pref.getInt("hdop.range", 7);
     323        minTrackDurationForTimeColoring = Main.pref.getInt("draw.rawgps.date-coloring-min-dt", 60);
     324        largePointAlpha = Main.pref.getInt("draw.rawgps.large.alpha", -1) & 0xFF;
    325325
    326326        // get heatmap parameters
  • trunk/src/org/openstreetmap/josm/gui/layer/imagery/ReprojectionTile.java

    r12669 r12841  
    159159
    160160        ImageWarp.PointTransform transform;
    161         int stride = Main.pref.getInteger("imagery.warp.projection-interpolation.stride", 7);
     161        int stride = Main.pref.getInt("imagery.warp.projection-interpolation.stride", 7);
    162162        if (stride > 0) {
    163163            transform = new ImageWarp.GridTransform(pointTransform, stride);
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java

    r12725 r12841  
    6464        enabled = Main.pref.getBoolean("marker.traceaudio", true);
    6565        if (!enabled) return;
    66         dropTolerance = Main.pref.getInteger("marker.playHeadDropTolerance", 50);
     66        dropTolerance = Main.pref.getInt("marker.playHeadDropTolerance", 50);
    6767        if (MainApplication.isDisplayingMapView()) {
    6868            MapFrame map = MainApplication.getMap();
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r12825 r12841  
    256256        }
    257257
    258         Collection<String> prefIconDirs = Main.pref.getCollection("mappaint.icon.sources");
     258        Collection<String> prefIconDirs = Main.pref.getList("mappaint.icon.sources");
    259259        for (String fileset : prefIconDirs) {
    260260            String[] a;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSetting.java

    r12831 r12841  
    7979                Main.pref.put(prefKey, null);
    8080            } else {
    81                 Main.pref.put(prefKey, b);
     81                Main.pref.putBoolean(prefKey, b);
    8282            }
    8383        }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java

    r12722 r12841  
    9090            );
    9191
    92             fillImage.alpha = Utils.clamp(Main.pref.getInteger("mappaint.fill-image-alpha", 255), 0, 255);
     92            fillImage.alpha = Utils.clamp(Main.pref.getInt("mappaint.fill-image-alpha", 255), 0, 255);
    9393            Integer pAlpha = Utils.colorFloat2int(c.get(FILL_OPACITY, null, float.class));
    9494            if (pAlpha != null) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LabelCompositionStrategy.java

    r11615 r12841  
    238238            } else {
    239239                this.nameTags = new ArrayList<>(
    240                         Main.pref.getCollection("mappaint.nameOrder", Arrays.asList(DEFAULT_NAME_TAGS))
     240                        Main.pref.getList("mappaint.nameOrder", Arrays.asList(DEFAULT_NAME_TAGS))
    241241                );
    242242                this.nameComplementTags = new ArrayList<>(
    243                         Main.pref.getCollection("mappaint.nameComplementOrder", Arrays.asList(DEFAULT_NAME_COMPLEMENT_TAGS))
     243                        Main.pref.getList("mappaint.nameComplementOrder", Arrays.asList(DEFAULT_NAME_COMPLEMENT_TAGS))
    244244                );
    245245            }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java

    r12756 r12841  
    196196        mapImage.offsetY = Math.round(offsetYF);
    197197
    198         mapImage.alpha = Utils.clamp(Main.pref.getInteger("mappaint.icon-image-alpha", 255), 0, 255);
     198        mapImage.alpha = Utils.clamp(Main.pref.getInt("mappaint.icon-image-alpha", 255), 0, 255);
    199199        Integer pAlpha = Utils.colorFloat2int(c.get(keys[ICON_OPACITY_IDX], null, float.class));
    200200        if (pAlpha != null) {
     
    357357            // However, it would be better, if the settings could be changed at runtime.
    358358            int size = max(
    359                     Main.pref.getInteger("mappaint.node.selected-size", 5),
    360                     Main.pref.getInteger("mappaint.node.unselected-size", 3),
    361                     Main.pref.getInteger("mappaint.node.connection-size", 5),
    362                     Main.pref.getInteger("mappaint.node.tagged-size", 3)
     359                    Main.pref.getInt("mappaint.node.selected-size", 5),
     360                    Main.pref.getInt("mappaint.node.unselected-size", 3),
     361                    Main.pref.getInt("mappaint.node.connection-size", 5),
     362                    Main.pref.getInt("mappaint.node.tagged-size", 3)
    363363            );
    364364            return new SimpleBoxProvider(new Rectangle(-size/2, -size/2, size, size));
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java

    r12539 r12841  
    148148                s = defaultFontSize;
    149149                if (s == null) {
    150                     defaultFontSize = s = (float) Main.pref.getInteger("mappaint.fontsize", 8);
     150                    defaultFontSize = s = (float) Main.pref.getInt("mappaint.fontsize", 8);
    151151                }
    152152            }
  • trunk/src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java

    r10268 r12841  
    281281    public void rememberPreferences(Preferences pref) {
    282282        CheckParameterUtil.ensureParameterNotNull(pref, "pref");
    283         pref.put("oauth.settings.use-default", cbUseDefaults.isSelected());
     283        pref.putBoolean("oauth.settings.use-default", cbUseDefaults.isSelected());
    284284        if (cbUseDefaults.isSelected()) {
    285285            new OAuthParameters(null, null, null, null, null, null, null).rememberPreferences(pref);
  • trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java

    r12825 r12841  
    423423
    424424            if (!iconPaths.isEmpty()) {
    425                 if (Main.pref.putCollection(iconPref, iconPaths)) {
     425                if (Main.pref.putList(iconPref, iconPaths)) {
    426426                    changed = true;
    427427                }
    428             } else if (Main.pref.putCollection(iconPref, null)) {
     428            } else if (Main.pref.putList(iconPref, null)) {
    429429                changed = true;
    430430            }
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r12643 r12841  
    496496            @Override
    497497            public void actionPerformed(ActionEvent e) {
    498                 Collection<String> t = new LinkedList<>(getToolString());
     498                List<String> t = new LinkedList<>(getToolString());
    499499                ActionParser parser = new ActionParser(null);
    500500                // get text definition of current action
     
    502502                // remove the button from toolbar preferences
    503503                t.remove(res);
    504                 Main.pref.putCollection("toolbar", t);
     504                Main.pref.putList("toolbar", t);
    505505                MainApplication.getToolbar().refreshToolbarControl();
    506506            }
     
    532532            public void actionPerformed(ActionEvent e) {
    533533                boolean sel = ((JCheckBoxMenuItem) e.getSource()).getState();
    534                 Main.pref.put("toolbar.always-visible", sel);
    535                 Main.pref.put("menu.always-visible", sel);
     534                Main.pref.putBoolean("toolbar.always-visible", sel);
     535                Main.pref.putBoolean("menu.always-visible", sel);
    536536            }
    537537        });
     
    971971        @Override
    972972        public boolean ok() {
    973             Collection<String> t = new LinkedList<>();
     973            List<String> t = new LinkedList<>();
    974974            ActionParser parser = new ActionParser(null);
    975975            for (int i = 0; i < selected.size(); ++i) {
     
    987987                t = Collections.singletonList(EMPTY_TOOLBAR_MARKER);
    988988            }
    989             Main.pref.putCollection("toolbar", t);
     989            Main.pref.putList("toolbar", t);
    990990            MainApplication.getToolbar().refreshToolbarControl();
    991991            return false;
     
    10741074    public static Collection<String> getToolString() {
    10751075
    1076         Collection<String> toolStr = Main.pref.getCollection("toolbar", Arrays.asList(deftoolbar));
     1076        Collection<String> toolStr = Main.pref.getList("toolbar", Arrays.asList(deftoolbar));
    10771077        if (toolStr == null || toolStr.isEmpty()) {
    10781078            toolStr = Arrays.asList(deftoolbar);
     
    12141214            }
    12151215        }
    1216         Main.pref.putCollection("toolbar", t);
     1216        Main.pref.putList("toolbar", t);
    12171217        MainApplication.getToolbar().refreshToolbarControl();
    12181218    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/audio/AudioPreference.java

    r9778 r12841  
    133133    @Override
    134134    public boolean ok() {
    135         Main.pref.put("audio.menuinvisible", !audioMenuVisible.isSelected());
    136         Main.pref.put("marker.traceaudio", markerAudioTraceVisible.isSelected());
    137         Main.pref.put("marker.buttonlabels", markerButtonLabels.isSelected());
    138         Main.pref.put("marker.audiofromexplicitwaypoints", audioMarkersFromExplicitWaypoints.isSelected());
    139         Main.pref.put("marker.audiofromuntimedwaypoints", audioMarkersFromUntimedWaypoints.isSelected());
    140         Main.pref.put("marker.audiofromnamedtrackpoints", audioMarkersFromNamedTrackpoints.isSelected());
    141         Main.pref.put("marker.audiofromwavtimestamps", audioMarkersFromWavTimestamps.isSelected());
    142         Main.pref.put("marker.audiofromstart", audioMarkersFromStart.isSelected());
     135        Main.pref.putBoolean("audio.menuinvisible", !audioMenuVisible.isSelected());
     136        Main.pref.putBoolean("marker.traceaudio", markerAudioTraceVisible.isSelected());
     137        Main.pref.putBoolean("marker.buttonlabels", markerButtonLabels.isSelected());
     138        Main.pref.putBoolean("marker.audiofromexplicitwaypoints", audioMarkersFromExplicitWaypoints.isSelected());
     139        Main.pref.putBoolean("marker.audiofromuntimedwaypoints", audioMarkersFromUntimedWaypoints.isSelected());
     140        Main.pref.putBoolean("marker.audiofromnamedtrackpoints", audioMarkersFromNamedTrackpoints.isSelected());
     141        Main.pref.putBoolean("marker.audiofromwavtimestamps", audioMarkersFromWavTimestamps.isSelected());
     142        Main.pref.putBoolean("marker.audiofromstart", audioMarkersFromStart.isSelected());
    143143        Main.pref.put("audio.forwardbackamount", audioForwardBackAmount.getText());
    144144        Main.pref.put("audio.fastfwdmultiplier", audioFastForwardMultiplier.getText());
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java

    r12400 r12841  
    109109        // virtual nodes
    110110        virtualNodes.setToolTipText(tr("Draw virtual nodes in select mode for easy way modification."));
    111         virtualNodes.setSelected(Main.pref.getInteger("mappaint.node.virtual-size", 8) != 0);
     111        virtualNodes.setSelected(Main.pref.getInt("mappaint.node.virtual-size", 8) != 0);
    112112
    113113        // background layers in inactive color
     
    195195    public boolean ok() {
    196196        boolean restart = gpxPanel.savePreferences();
    197         Main.pref.put("draw.data.area_outline_only", outlineOnly.isSelected());
    198         Main.pref.put("draw.segment.direction", directionHint.isSelected());
    199         Main.pref.put("draw.segment.head_only", headArrow.isSelected());
    200         Main.pref.put("draw.oneway", onewayArrow.isSelected());
    201         Main.pref.put("draw.segment.order_number", segmentOrderNumber.isSelected());
    202         Main.pref.put("draw.segment.order_number.on_selected", segmentOrderNumberOnSelectedWay.isSelected());
    203         Main.pref.put("draw.data.downloaded_area", sourceBounds.isSelected());
    204         Main.pref.put("draw.data.inactive_color", inactive.isSelected());
    205         Main.pref.put("mappaint.use-antialiasing", useAntialiasing.isSelected());
    206         Main.pref.put("mappaint.wireframe.use-antialiasing", useWireframeAntialiasing.isSelected());
    207         Main.pref.put("draw.target-highlight", useHighlighting.isSelected());
    208         Main.pref.put("draw.helper-line", drawHelperLine.isSelected());
    209         Main.pref.put("display.discardable-keys", discardableKeys.isSelected());
     197        Main.pref.putBoolean("draw.data.area_outline_only", outlineOnly.isSelected());
     198        Main.pref.putBoolean("draw.segment.direction", directionHint.isSelected());
     199        Main.pref.putBoolean("draw.segment.head_only", headArrow.isSelected());
     200        Main.pref.putBoolean("draw.oneway", onewayArrow.isSelected());
     201        Main.pref.putBoolean("draw.segment.order_number", segmentOrderNumber.isSelected());
     202        Main.pref.putBoolean("draw.segment.order_number.on_selected", segmentOrderNumberOnSelectedWay.isSelected());
     203        Main.pref.putBoolean("draw.data.downloaded_area", sourceBounds.isSelected());
     204        Main.pref.putBoolean("draw.data.inactive_color", inactive.isSelected());
     205        Main.pref.putBoolean("mappaint.use-antialiasing", useAntialiasing.isSelected());
     206        Main.pref.putBoolean("mappaint.wireframe.use-antialiasing", useWireframeAntialiasing.isSelected());
     207        Main.pref.putBoolean("draw.target-highlight", useHighlighting.isSelected());
     208        Main.pref.putBoolean("draw.helper-line", drawHelperLine.isSelected());
     209        Main.pref.putBoolean("display.discardable-keys", discardableKeys.isSelected());
    210210        AutoFilterManager.PROP_AUTO_FILTER_ENABLED.put(autoFilters.isSelected());
    211211        AutoFilterManager.PROP_AUTO_FILTER_RULE.put(((AutoFilterRule) autoFilterRules.getSelectedItem()).getKey());
    212         int vn = Main.pref.getInteger("mappaint.node.virtual-size", 8);
     212        int vn = Main.pref.getInt("mappaint.node.virtual-size", 8);
    213213        if (virtualNodes.isSelected()) {
    214214            if (vn < 1) {
     
    218218            vn = 0;
    219219        }
    220         Main.pref.putInteger("mappaint.node.virtual-size", vn);
     220        Main.pref.putInt("mappaint.node.virtual-size", vn);
    221221        return restart;
    222222    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java

    r12620 r12841  
    454454            layerNameDot = "";
    455455        }
    456         Main.pref.put("marker.makeautomarkers"+layerNameDot, makeAutoMarkers.isSelected());
     456        Main.pref.putBoolean("marker.makeautomarkers"+layerNameDot, makeAutoMarkers.isSelected());
    457457        if (drawRawGpsLinesGlobal.isSelected()) {
    458458            Main.pref.put("draw.rawgps.lines" + layerNameDot, null);
     
    466466        } else {
    467467            if (layerName == null || !locLayer) {
    468                 Main.pref.put("draw.rawgps.lines" + layerNameDot, drawRawGpsLinesAll.isSelected());
     468                Main.pref.putBoolean("draw.rawgps.lines" + layerNameDot, drawRawGpsLinesAll.isSelected());
    469469                Main.pref.put("draw.rawgps.max-line-length" + layerNameDot, drawRawGpsMaxLineLength.getText());
    470470            }
    471471            if (layerName == null || locLayer) {
    472                 Main.pref.put("draw.rawgps.lines.local" + layerNameDot, drawRawGpsLinesAll.isSelected() || drawRawGpsLinesLocal.isSelected());
     472                Main.pref.putBoolean("draw.rawgps.lines.local" + layerNameDot, drawRawGpsLinesAll.isSelected() || drawRawGpsLinesLocal.isSelected());
    473473                Main.pref.put("draw.rawgps.max-line-length.local" + layerNameDot, drawRawGpsMaxLineLengthLocal.getText());
    474474            }
    475             Main.pref.put("draw.rawgps.lines.force"+layerNameDot, forceRawGpsLines.isSelected());
    476             Main.pref.put("draw.rawgps.direction"+layerNameDot, drawGpsArrows.isSelected());
    477             Main.pref.put("draw.rawgps.alternatedirection"+layerNameDot, drawGpsArrowsFast.isSelected());
     475            Main.pref.putBoolean("draw.rawgps.lines.force"+layerNameDot, forceRawGpsLines.isSelected());
     476            Main.pref.putBoolean("draw.rawgps.direction"+layerNameDot, drawGpsArrows.isSelected());
     477            Main.pref.putBoolean("draw.rawgps.alternatedirection"+layerNameDot, drawGpsArrowsFast.isSelected());
    478478            Main.pref.put("draw.rawgps.min-arrow-distance"+layerNameDot, drawGpsArrowsMinDist.getText());
    479479        }
    480480
    481         Main.pref.put("draw.rawgps.hdopcircle"+layerNameDot, hdopCircleGpsPoints.isSelected());
    482         Main.pref.put("draw.rawgps.large"+layerNameDot, largeGpsPoints.isSelected());
     481        Main.pref.putBoolean("draw.rawgps.hdopcircle"+layerNameDot, hdopCircleGpsPoints.isSelected());
     482        Main.pref.putBoolean("draw.rawgps.large"+layerNameDot, largeGpsPoints.isSelected());
    483483        Main.pref.put("draw.rawgps.linewidth"+layerNameDot, drawLineWidth.getText());
    484         Main.pref.put("draw.rawgps.lines.alpha-blend"+layerNameDot, drawLineWithAlpha.isSelected());
    485 
    486         Main.pref.put("mappaint.gpx.use-antialiasing", useGpsAntialiasing.isSelected());
     484        Main.pref.putBoolean("draw.rawgps.lines.alpha-blend"+layerNameDot, drawLineWithAlpha.isSelected());
     485
     486        Main.pref.putBoolean("mappaint.gpx.use-antialiasing", useGpsAntialiasing.isSelected());
    487487
    488488        TemplateEntryProperty.forMarker(layerName).put(waypointLabelPattern.getText());
     
    495495            return false;
    496496        } else if (colorTypeVelocity.isSelected()) {
    497             Main.pref.putInteger("draw.rawgps.colors"+layerNameDot, 1);
     497            Main.pref.putInt("draw.rawgps.colors"+layerNameDot, 1);
    498498        } else if (colorTypeDilution.isSelected()) {
    499             Main.pref.putInteger("draw.rawgps.colors"+layerNameDot, 2);
     499            Main.pref.putInt("draw.rawgps.colors"+layerNameDot, 2);
    500500        } else if (colorTypeDirection.isSelected()) {
    501             Main.pref.putInteger("draw.rawgps.colors"+layerNameDot, 3);
     501            Main.pref.putInt("draw.rawgps.colors"+layerNameDot, 3);
    502502        } else if (colorTypeTime.isSelected()) {
    503             Main.pref.putInteger("draw.rawgps.colors"+layerNameDot, 4);
     503            Main.pref.putInt("draw.rawgps.colors"+layerNameDot, 4);
    504504        } else if (colorTypeHeatMap.isSelected()) {
    505             Main.pref.putInteger("draw.rawgps.colors"+layerNameDot, 5);
     505            Main.pref.putInt("draw.rawgps.colors"+layerNameDot, 5);
    506506        } else {
    507             Main.pref.putInteger("draw.rawgps.colors"+layerNameDot, 0);
    508         }
    509         Main.pref.put("draw.rawgps.colors.dynamic"+layerNameDot, colorDynamic.isSelected());
     507            Main.pref.putInt("draw.rawgps.colors"+layerNameDot, 0);
     508        }
     509        Main.pref.putBoolean("draw.rawgps.colors.dynamic"+layerNameDot, colorDynamic.isSelected());
    510510        int ccti = colorTypeVelocityTune.getSelectedIndex();
    511         Main.pref.putInteger("draw.rawgps.colorTracksTune"+layerNameDot, ccti == 2 ? 10 : (ccti == 1 ? 20 : 45));
    512         Main.pref.putInteger("draw.rawgps.heatmap.colormap"+layerNameDot, colorTypeHeatMapTune.getSelectedIndex());
    513         Main.pref.put("draw.rawgps.heatmap.use-points"+layerNameDot, colorTypeHeatMapPoints.isSelected());
    514         Main.pref.putInteger("draw.rawgps.heatmap.gain"+layerNameDot, colorTypeHeatMapGain.getValue());
    515         Main.pref.putInteger("draw.rawgps.heatmap.lower-limit"+layerNameDot, colorTypeHeatMapLowerLimit.getValue());
     511        Main.pref.putInt("draw.rawgps.colorTracksTune"+layerNameDot, ccti == 2 ? 10 : (ccti == 1 ? 20 : 45));
     512        Main.pref.putInt("draw.rawgps.heatmap.colormap"+layerNameDot, colorTypeHeatMapTune.getSelectedIndex());
     513        Main.pref.putBoolean("draw.rawgps.heatmap.use-points"+layerNameDot, colorTypeHeatMapPoints.isSelected());
     514        Main.pref.putInt("draw.rawgps.heatmap.gain"+layerNameDot, colorTypeHeatMapGain.getValue());
     515        Main.pref.putInt("draw.rawgps.heatmap.lower-limit"+layerNameDot, colorTypeHeatMapLowerLimit.getValue());
    516516
    517517        return false;
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java

    r12620 r12841  
    202202    public boolean ok() {
    203203        boolean mod = false;
    204         Main.pref.put("draw.splashscreen", showSplashScreen.isSelected());
    205         Main.pref.put("osm-primitives.showid", showID.isSelected());
    206         Main.pref.put("osm-primitives.localize-name", showLocalizedName.isSelected());
     204        Main.pref.putBoolean("draw.splashscreen", showSplashScreen.isSelected());
     205        Main.pref.putBoolean("osm-primitives.showid", showID.isSelected());
     206        Main.pref.putBoolean("osm-primitives.localize-name", showLocalizedName.isSelected());
    207207        MapFrame.MODELESS.put(modeless.isSelected());
    208         Main.pref.put(ToggleDialog.PROP_DYNAMIC_BUTTONS.getKey(), dynamicButtons.isSelected());
    209         Main.pref.put(DateUtils.PROP_ISO_DATES.getKey(), isoDates.isSelected());
    210         Main.pref.put(FileChooserManager.PROP_USE_NATIVE_FILE_DIALOG.getKey(), nativeFileChoosers.isSelected());
     208        Main.pref.putBoolean(ToggleDialog.PROP_DYNAMIC_BUTTONS.getKey(), dynamicButtons.isSelected());
     209        Main.pref.putBoolean(DateUtils.PROP_ISO_DATES.getKey(), isoDates.isSelected());
     210        Main.pref.putBoolean(FileChooserManager.PROP_USE_NATIVE_FILE_DIALOG.getKey(), nativeFileChoosers.isSelected());
    211211        MapMover.PROP_ZOOM_REVERSE_WHEEL.put(zoomReverseWheel.isSelected());
    212212        NavigatableComponent.PROP_ZOOM_INTERMEDIATE_STEPS.put(zoomIntermediateSteps.isSelected());
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java

    r12649 r12841  
    105105        @Override
    106106        public Collection<String> getInitialIconPathsList() {
    107             return Main.pref.getCollection(ICONPREF, null);
     107            return Main.pref.getList(ICONPREF, null);
    108108        }
    109109
     
    170170    @Override
    171171    public boolean ok() {
    172         boolean reload = Main.pref.put("mappaint.icon.enable-defaults", enableIconDefault.isSelected());
     172        boolean reload = Main.pref.putBoolean("mappaint.icon.enable-defaults", enableIconDefault.isSelected());
    173173        reload |= sources.finish();
    174174        if (reload) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java

    r12649 r12841  
    206206        @Override
    207207        public Collection<String> getInitialIconPathsList() {
    208             return Main.pref.getCollection(ICONPREF, null);
     208            return Main.pref.getList(ICONPREF, null);
    209209        }
    210210
     
    246246    @Override
    247247    public boolean ok() {
    248         boolean restart = Main.pref.put("taggingpreset.sortmenu", sortMenu.getSelectedObjects() != null);
     248        boolean restart = Main.pref.putBoolean("taggingpreset.sortmenu", sortMenu.getSelectedObjects() != null);
    249249        restart |= sources.finish();
    250250
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java

    r12634 r12841  
    302302            List<String> l = new LinkedList<>(model.getSelectedPluginNames());
    303303            Collections.sort(l);
    304             Main.pref.putCollection("plugins", l);
     304            Main.pref.putList("plugins", l);
    305305            if (!model.getNewlyDeactivatedPlugins().isEmpty())
    306306                return true;
     
    359359                        model.updateAvailablePlugins(task.getAvailablePlugins());
    360360                        pnlPluginPreferences.refreshView();
    361                         Main.pref.putInteger("pluginmanager.version", Version.getInstance().getVersion()); // fix #7030
     361                        Main.pref.putInt("pluginmanager.version", Version.getInstance().getVersion()); // fix #7030
    362362                    });
    363363                }
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java

    r12620 r12841  
    4040    public PluginPreferencesModel() {
    4141        currentActivePlugins = new HashSet<>();
    42         currentActivePlugins.addAll(Main.pref.getCollection("plugins", currentActivePlugins));
     42        currentActivePlugins.addAll(Main.pref.getList("plugins"));
    4343    }
    4444
     
    8080        filterDisplayedPlugins(filterExpression);
    8181        Set<String> activePlugins = new HashSet<>();
    82         activePlugins.addAll(Main.pref.getCollection("plugins", activePlugins));
     82        activePlugins.addAll(Main.pref.getList("plugins"));
    8383        for (PluginInformation pi: availablePlugins) {
    8484            if (selectedPluginsMap.get(pi) == null && activePlugins.contains(pi.name)) {
     
    230230     */
    231231    public void initFromPreferences() {
    232         Collection<String> enabledPlugins = Main.pref.getCollection("plugins", null);
     232        Collection<String> enabledPlugins = Main.pref.getList("plugins", null);
    233233        if (enabledPlugins == null) {
    234234            this.selectedPluginsMap.clear();
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java

    r12620 r12841  
    196196        }
    197197        if (days == 0) {
    198             days = Main.pref.getInteger("pluginmanager.time-based-update.interval", PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL);
     198            days = Main.pref.getInt("pluginmanager.time-based-update.interval", PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL);
    199199        }
    200200        tfUpdateInterval.setText(Integer.toString(days));
     
    235235            days = PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL;
    236236        }
    237         Main.pref.putInteger("pluginmanager.time-based-update.interval", days);
     237        Main.pref.putInt("pluginmanager.time-based-update.interval", days);
    238238    }
    239239
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java

    r12620 r12841  
    7272                }
    7373            });
    74             Collection<String> samples = Arrays.asList(
     74            List<String> samples = Arrays.asList(
    7575                    "+proj=lonlat +ellps=WGS84 +datum=WGS84 +bounds=-180,-90,180,90",
    7676                    "+proj=tmerc +lat_0=0 +lon_0=9 +k_0=1 +x_0=3500000 +y_0=0 +ellps=bessel +nadgrids=BETA2007.gsb");
    77             List<String> inputHistory = new LinkedList<>(Main.pref.getCollection("projection.custom.value.history", samples));
     77            List<String> inputHistory = new LinkedList<>(Main.pref.getList("projection.custom.value.history", samples));
    7878            Collections.reverse(inputHistory);
    7979            cbInput.setPossibleItems(inputHistory);
     
    149149        public void rememberHistory() {
    150150            cbInput.addCurrentItemToHistory();
    151             Main.pref.putCollection("projection.custom.value.history", cbInput.getHistory());
     151            Main.pref.putList("projection.custom.value.history", cbInput.getHistory());
    152152        }
    153153    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java

    r12786 r12841  
    2828import org.openstreetmap.josm.data.coor.conversion.CoordinateFormatManager;
    2929import org.openstreetmap.josm.data.coor.conversion.ICoordinateFormat;
    30 import org.openstreetmap.josm.data.preferences.CollectionProperty;
     30import org.openstreetmap.josm.data.preferences.ListProperty;
    3131import org.openstreetmap.josm.data.preferences.StringProperty;
    3232import org.openstreetmap.josm.data.projection.CustomProjection;
     
    291291    private static final StringProperty PROP_PROJECTION_DEFAULT = new StringProperty("projection.default", mercator.getId());
    292292    private static final StringProperty PROP_COORDINATES = new StringProperty("coordinates", null);
    293     private static final CollectionProperty PROP_SUB_PROJECTION_DEFAULT = new CollectionProperty("projection.default.sub", null);
     293    private static final ListProperty PROP_SUB_PROJECTION_DEFAULT = new ListProperty("projection.default.sub", null);
    294294    private static final String[] unitsValues = ALL_SYSTEMS.keySet().toArray(new String[ALL_SYSTEMS.size()]);
    295295    private static final String[] unitsValuesTr = new String[unitsValues.length];
     
    482482        }
    483483        id = pc.getId();
    484         Main.pref.putCollection("projection.sub."+id, pref);
     484        Main.pref.putList("projection.sub."+id, pref == null ? null : new ArrayList<>(pref));
    485485        if (makeDefault) {
    486486            PROP_PROJECTION_DEFAULT.put(id);
    487             PROP_SUB_PROJECTION_DEFAULT.put(pref);
     487            PROP_SUB_PROJECTION_DEFAULT.put(pref == null ? null : new ArrayList<>(pref));
    488488        } else {
    489489            projectionChoice = id;
     
    560560     */
    561561    public static Collection<String> getSubprojectionPreference(String pcId) {
    562         return Main.pref.getCollection("projection.sub."+pcId, null);
     562        return Main.pref.getList("projection.sub."+pcId, null);
    563563    }
    564564
  • trunk/src/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreference.java

    r12707 r12841  
    196196        if (enabled) {
    197197            for (Entry<PermissionPrefWithDefault, JCheckBox> p : prefs.entrySet()) {
    198                 Main.pref.put(p.getKey().pref, p.getValue().isSelected());
    199             }
    200             Main.pref.put(RequestHandler.loadInNewLayerKey, loadInNewLayer.isSelected());
    201             Main.pref.put(RequestHandler.globalConfirmationKey, alwaysAskUserConfirm.isSelected());
     198                Main.pref.putBoolean(p.getKey().pref, p.getValue().isSelected());
     199            }
     200            Main.pref.putBoolean(RequestHandler.loadInNewLayerKey, loadInNewLayer.isSelected());
     201            Main.pref.putBoolean(RequestHandler.globalConfirmationKey, alwaysAskUserConfirm.isSelected());
    202202        }
    203203        if (changed) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java

    r12634 r12841  
    2828
    2929import org.openstreetmap.josm.Main;
    30 import org.openstreetmap.josm.data.preferences.CollectionProperty;
     30import org.openstreetmap.josm.data.preferences.ListProperty;
    3131import org.openstreetmap.josm.gui.MainApplication;
    3232import org.openstreetmap.josm.gui.help.HelpUtil;
     
    5858    /** indicates whether to use the default OSM URL or not */
    5959    private JCheckBox cbUseDefaultServerUrl;
    60     private final transient CollectionProperty SERVER_URL_HISTORY = new CollectionProperty("osm-server.url-history", Arrays.asList(
     60    private final transient ListProperty SERVER_URL_HISTORY = new ListProperty("osm-server.url-history", Arrays.asList(
    6161            "http://api06.dev.openstreetmap.org/api", "http://master.apis.dev.openstreetmap.org/api"));
    6262
  • trunk/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreference.java

    r12649 r12841  
    9797    @Override
    9898    public boolean ok() {
    99         Collection<String> tests = new LinkedList<>();
    100         Collection<String> testsBeforeUpload = new LinkedList<>();
     99        List<String> tests = new LinkedList<>();
     100        List<String> testsBeforeUpload = new LinkedList<>();
    101101
    102102        for (Test test : allTests) {
     
    116116        OsmValidator.initializeTests(testsToInitialize);
    117117
    118         Main.pref.putCollection(ValidatorPrefHelper.PREF_SKIP_TESTS, tests);
    119         Main.pref.putCollection(ValidatorPrefHelper.PREF_SKIP_TESTS_BEFORE_UPLOAD, testsBeforeUpload);
     118        Main.pref.putList(ValidatorPrefHelper.PREF_SKIP_TESTS, tests);
     119        Main.pref.putList(ValidatorPrefHelper.PREF_SKIP_TESTS_BEFORE_UPLOAD, testsBeforeUpload);
    120120        ValidatorPrefHelper.PREF_USE_IGNORE.put(prefUseIgnore.isSelected());
    121121        ValidatorPrefHelper.PREF_OTHER.put(prefOther.isSelected());
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java

    r12691 r12841  
    210210        }
    211211        File arch = TaggingPresetReader.getZipIcons();
    212         final Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null);
     212        final Collection<String> s = Main.pref.getList("taggingpreset.icon.sources", null);
    213213        ImageProvider imgProv = new ImageProvider(iconName);
    214214        imgProv.setDirs(s);
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java

    r12835 r12841  
    127127
    128128    protected static ImageIcon loadImageIcon(String iconName, File zipIcons, Integer maxSize) {
    129         final Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null);
     129        final Collection<String> s = Main.pref.getList("taggingpreset.icon.sources", null);
    130130        ImageProvider imgProv = new ImageProvider(iconName).setDirs(s).setId("presets").setArchive(zipIcons).setOptional(true);
    131131        if (maxSize != null) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java

    r12643 r12841  
    9191            }
    9292            for (JMenu submenu : submenus.values()) {
    93                 if (submenu.getItemCount() >= Main.pref.getInteger("taggingpreset.min-elements-for-scroller", 15)) {
     93                if (submenu.getItemCount() >= Main.pref.getInt("taggingpreset.min-elements-for-scroller", 15)) {
    9494                    MenuScroller.setScrollerFor(submenu);
    9595                }
  • trunk/src/org/openstreetmap/josm/gui/widgets/HistoryComboBox.java

    r12304 r12841  
    2424     */
    2525    public HistoryComboBox() {
    26         int maxsize = Main.pref.getInteger("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE);
     26        int maxsize = Main.pref.getInt("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE);
    2727        model = new ComboBoxHistory(maxsize);
    2828        setModel(model);
  • trunk/src/org/openstreetmap/josm/io/CacheCustomContent.java

    r12620 r12841  
    9191            return false;
    9292        }
    93         return Main.pref.getInteger("cache." + ident, 0) + updateInterval < TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())
     93        return Main.pref.getInt("cache." + ident, 0) + updateInterval < TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())
    9494                || !isCacheValid();
    9595    }
     
    141141        this.data = updateData();
    142142        saveToDisk();
    143         Main.pref.putInteger("cache." + ident, (int) (TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())));
     143        Main.pref.putInt("cache." + ident, (int) (TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())));
    144144        return data;
    145145    }
  • trunk/src/org/openstreetmap/josm/io/CachedFile.java

    r12620 r12841  
    381381            if (!"file".equals(url.getProtocol())) {
    382382                String prefKey = getPrefKey(url, destDir);
    383                 List<String> localPath = new ArrayList<>(Main.pref.getCollection(prefKey));
     383                List<String> localPath = new ArrayList<>(Main.pref.getList(prefKey));
    384384                if (localPath.size() == 2) {
    385385                    File lfile = new File(localPath.get(1));
     
    388388                    }
    389389                }
    390                 Main.pref.putCollection(prefKey, null);
     390                Main.pref.putList(prefKey, null);
    391391            }
    392392        } catch (MalformedURLException e) {
     
    419419        Long ifModifiedSince = null;
    420420        File localFile = null;
    421         List<String> localPathEntry = new ArrayList<>(Main.pref.getCollection(prefKey));
     421        List<String> localPathEntry = new ArrayList<>(Main.pref.getList(prefKey));
    422422        boolean offline = false;
    423423        try {
     
    476476                if (localFile == null)
    477477                    throw new AssertionError();
    478                 Main.pref.putCollection(prefKey,
     478                Main.pref.putList(prefKey,
    479479                        Arrays.asList(Long.toString(System.currentTimeMillis()), localPathEntry.get(1)));
    480480                return localFile;
     
    488488            localFile = new File(destDir, localPath);
    489489            if (Main.platform.rename(destDirFile, localFile)) {
    490                 Main.pref.putCollection(prefKey,
     490                Main.pref.putList(prefKey,
    491491                        Arrays.asList(Long.toString(System.currentTimeMillis()), localFile.toString()));
    492492            } else {
  • trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java

    r12805 r12841  
    161161        }
    162162        proxyExceptions = new HashSet<>(
    163             Main.pref.getCollection(PROXY_EXCEPTIONS,
     163            Main.pref.getList(PROXY_EXCEPTIONS,
    164164                    Arrays.asList("localhost", IPV4_LOOPBACK, IPV6_LOOPBACK))
    165165        );
  • trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

    r12816 r12841  
    321321        // Build a list of fetchers that will  download smaller sets containing only MAX_IDS_PER_REQUEST (200) primitives each.
    322322        // we will run up to MAX_DOWNLOAD_THREADS concurrent fetchers.
    323         int threadsNumber = Main.pref.getInteger("osm.download.threads", OsmApi.MAX_DOWNLOAD_THREADS);
     323        int threadsNumber = Main.pref.getInt("osm.download.threads", OsmApi.MAX_DOWNLOAD_THREADS);
    324324        threadsNumber = Utils.clamp(threadsNumber, 1, OsmApi.MAX_DOWNLOAD_THREADS);
    325325        final ExecutorService exec = Executors.newFixedThreadPool(
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r12805 r12841  
    593593     */
    594594    protected int getMaxRetries() {
    595         int ret = Main.pref.getInteger("osm-server.max-num-retries", DEFAULT_MAX_NUM_RETRIES);
     595        int ret = Main.pref.getInt("osm-server.max-num-retries", DEFAULT_MAX_NUM_RETRIES);
    596596        return Math.max(ret, 0);
    597597    }
  • trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java

    r12816 r12841  
    3333import org.openstreetmap.josm.data.osm.PrimitiveId;
    3434import org.openstreetmap.josm.data.preferences.BooleanProperty;
    35 import org.openstreetmap.josm.data.preferences.CollectionProperty;
     35import org.openstreetmap.josm.data.preferences.ListProperty;
    3636import org.openstreetmap.josm.data.preferences.StringProperty;
    3737import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     
    5959     * @since 12816
    6060     */
    61     public static final CollectionProperty OVERPASS_SERVER_HISTORY = new CollectionProperty("download.overpass.servers",
     61    public static final ListProperty OVERPASS_SERVER_HISTORY = new ListProperty("download.overpass.servers",
    6262            Arrays.asList("https://overpass-api.de/api/", "http://overpass.osm.rambler.ru/cgi/"));
    6363    /**
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java

    r12620 r12841  
    3333    public static void restartRemoteControlHttpServer() {
    3434        stopRemoteControlHttpServer();
    35         int port = Main.pref.getInteger("remote.control.port", 8111);
     35        int port = Main.pref.getInt("remote.control.port", 8111);
    3636        try {
    3737            instance4 = new RemoteControlHttpServer(port, false);
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java

    r12620 r12841  
    312312        stopRemoteControlHttpsServer();
    313313        if (RemoteControl.PROP_REMOTECONTROL_HTTPS_ENABLED.get()) {
    314             int port = Main.pref.getInteger("remote.control.https.port", HTTPS_PORT);
     314            int port = Main.pref.getInt("remote.control.https.port", HTTPS_PORT);
    315315            try {
    316316                instance4 = new RemoteControlHttpsServer(port, false);
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r12639 r12841  
    422422        String togglePreferenceKey = null;
    423423        int v = Version.getInstance().getVersion();
    424         if (Main.pref.getInteger("pluginmanager.version", 0) < v) {
     424        if (Main.pref.getInt("pluginmanager.version", 0) < v) {
    425425            message =
    426426                "<html>"
     
    434434            long tim = System.currentTimeMillis();
    435435            long last = Main.pref.getLong("pluginmanager.lastupdate", 0);
    436             Integer maxTime = Main.pref.getInteger("pluginmanager.time-based-update.interval", DEFAULT_TIME_BASED_UPDATE_INTERVAL);
     436            Integer maxTime = Main.pref.getInt("pluginmanager.time-based-update.interval", DEFAULT_TIME_BASED_UPDATE_INTERVAL);
    437437            long d = TimeUnit.MILLISECONDS.toDays(tim - last);
    438438            if ((last <= 0) || (maxTime <= 0)) {
     
    607607                    if (!task.getDownloadedPlugins().isEmpty()) {
    608608                        // update plugin list in preferences
    609                         Set<String> plugins = new HashSet<>(Main.pref.getCollection("plugins"));
     609                        Set<String> plugins = new HashSet<>(Main.pref.getList("plugins"));
    610610                        for (PluginInformation plugin : task.getDownloadedPlugins()) {
    611611                            plugins.add(plugin.name);
    612612                        }
    613                         Main.pref.putCollection("plugins", plugins);
     613                        Main.pref.putList("plugins", new ArrayList<>(plugins));
    614614                        // restart
    615615                        try {
     
    969969        try {
    970970            monitor.beginTask(tr("Determining plugins to load..."));
    971             Set<String> plugins = new HashSet<>(Main.pref.getCollection("plugins", new LinkedList<String>()));
     971            Set<String> plugins = new HashSet<>(Main.pref.getList("plugins", new LinkedList<String>()));
    972972            Logging.debug("Plugins list initialized to {0}", plugins);
    973973            String systemProp = System.getProperty("josm.plugins");
     
    11571157        if (pluginsWanted == null) {
    11581158            // if all plugins updated, remember the update because it was successful
    1159             Main.pref.putInteger("pluginmanager.version", Version.getInstance().getVersion());
     1159            Main.pref.putInt("pluginmanager.version", Version.getInstance().getVersion());
    11601160            Main.pref.put("pluginmanager.lastupdate", Long.toString(System.currentTimeMillis()));
    11611161        }
     
    14501450            return null;
    14511451
    1452         Set<String> plugins = new HashSet<>(
    1453                 Main.pref.getCollection("plugins", Collections.<String>emptySet())
    1454         );
     1452        Set<String> plugins = new HashSet<>(Main.pref.getList("plugins"));
    14551453        final PluginInformation pluginInfo = plugin.getPluginInformation();
    14561454        if (!plugins.contains(pluginInfo.name))
     
    14671465            // deactivate the plugin
    14681466            plugins.remove(plugin.getPluginInformation().name);
    1469             Main.pref.putCollection("plugins", plugins);
     1467            Main.pref.putList("plugins", new ArrayList<>(plugins));
    14701468            GuiHelper.runInEDTAndWait(() -> JOptionPane.showMessageDialog(
    14711469                    Main.parent,
     
    14861484     */
    14871485    public static Collection<String> getBugReportInformation() {
    1488         final Collection<String> pl = new TreeSet<>(Main.pref.getCollection("plugins", new LinkedList<>()));
     1486        final Collection<String> pl = new TreeSet<>(Main.pref.getList("plugins", new LinkedList<>()));
    14891487        for (final PluginProxy pp : pluginList) {
    14901488            PluginInformation pi = pp.getPluginInformation();
  • trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java

    r12794 r12841  
    143143    protected String downloadPluginList(String site, final ProgressMonitor monitor) {
    144144        /* replace %<x> with empty string or x=plugins (separated with comma) */
    145         String pl = Utils.join(",", Main.pref.getCollection("plugins"));
     145        String pl = Utils.join(",", Main.pref.getList("plugins"));
    146146        String printsite = site.replaceAll("%<(.*)>", "");
    147147        if (pl != null && !pl.isEmpty()) {
  • trunk/src/org/openstreetmap/josm/tools/HttpClient.java

    r12711 r12841  
    4545    private URL url;
    4646    private final String requestMethod;
    47     private int connectTimeout = (int) TimeUnit.SECONDS.toMillis(Main.pref.getInteger("socket.timeout.connect", 15));
    48     private int readTimeout = (int) TimeUnit.SECONDS.toMillis(Main.pref.getInteger("socket.timeout.read", 30));
     47    private int connectTimeout = (int) TimeUnit.SECONDS.toMillis(Main.pref.getInt("socket.timeout.connect", 15));
     48    private int readTimeout = (int) TimeUnit.SECONDS.toMillis(Main.pref.getInt("socket.timeout.read", 30));
    4949    private byte[] requestBody;
    5050    private long ifModifiedSince;
    5151    private final Map<String, String> headers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
    52     private int maxRedirects = Main.pref.getInteger("socket.maxredirects", 5);
     52    private int maxRedirects = Main.pref.getInt("socket.maxredirects", 5);
    5353    private boolean useCache;
    5454    private String reasonForRequest;
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r12808 r12841  
    122122    public enum ImageSizes {
    123123        /** SMALL_ICON value of an Action */
    124         SMALLICON(Main.pref.getInteger("iconsize.smallicon", 16)),
     124        SMALLICON(Main.pref.getInt("iconsize.smallicon", 16)),
    125125        /** LARGE_ICON_KEY value of an Action */
    126         LARGEICON(Main.pref.getInteger("iconsize.largeicon", 24)),
     126        LARGEICON(Main.pref.getInt("iconsize.largeicon", 24)),
    127127        /** map icon */
    128         MAP(Main.pref.getInteger("iconsize.map", 16)),
     128        MAP(Main.pref.getInt("iconsize.map", 16)),
    129129        /** map icon maximum size */
    130         MAPMAX(Main.pref.getInteger("iconsize.mapmax", 48)),
     130        MAPMAX(Main.pref.getInt("iconsize.mapmax", 48)),
    131131        /** cursor icon size */
    132         CURSOR(Main.pref.getInteger("iconsize.cursor", 32)),
     132        CURSOR(Main.pref.getInt("iconsize.cursor", 32)),
    133133        /** cursor overlay icon size */
    134134        CURSOROVERLAY(CURSOR),
     
    142142         * @since 8323
    143143         */
    144         LAYER(Main.pref.getInteger("iconsize.layer", 16)),
     144        LAYER(Main.pref.getInt("iconsize.layer", 16)),
    145145        /** Toolbar button icon size
    146146         * @since 9253
     
    150150         * @since 9253
    151151         */
    152         SIDEBUTTON(Main.pref.getInteger("iconsize.sidebutton", 20)),
     152        SIDEBUTTON(Main.pref.getInt("iconsize.sidebutton", 20)),
    153153        /** Settings tab icon size
    154154         * @since 9253
    155155         */
    156         SETTINGS_TAB(Main.pref.getInteger("iconsize.settingstab", 48)),
     156        SETTINGS_TAB(Main.pref.getInt("iconsize.settingstab", 48)),
    157157        /**
    158158         * The default image size
    159159         * @since 9705
    160160         */
    161         DEFAULT(Main.pref.getInteger("iconsize.default", 24)),
     161        DEFAULT(Main.pref.getInt("iconsize.default", 24)),
    162162        /**
    163163         * Splash dialog logo size
     
    10131013     */
    10141014    private static ImageResource getIfAvailableWiki(String name, ImageType type) {
    1015         final Collection<String> defaultBaseUrls = Arrays.asList(
     1015        final List<String> defaultBaseUrls = Arrays.asList(
    10161016                "https://wiki.openstreetmap.org/w/images/",
    10171017                "https://upload.wikimedia.org/wikipedia/commons/",
    10181018                "https://wiki.openstreetmap.org/wiki/File:"
    10191019                );
    1020         final Collection<String> baseUrls = Main.pref.getCollection("image-provider.wiki.urls", defaultBaseUrls);
     1020        final Collection<String> baseUrls = Main.pref.getList("image-provider.wiki.urls", defaultBaseUrls);
    10211021
    10221022        final String fn = name.substring(name.lastIndexOf('/') + 1);
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java

    r12830 r12841  
    5151    @Override
    5252    public void openUrl(String url) throws IOException {
    53         for (String program : Main.pref.getCollection("browser.unix",
     53        for (String program : Main.pref.getList("browser.unix",
    5454                Arrays.asList("xdg-open", "#DESKTOP#", "$BROWSER", "gnome-open", "kfmclient openURL", "firefox"))) {
    5555            try {
  • trunk/src/org/openstreetmap/josm/tools/Shortcut.java

    r12748 r12841  
    170170    // create a shortcut object from an string as saved in the preferences
    171171    private Shortcut(String prefString) {
    172         List<String> s = new ArrayList<>(Main.pref.getCollection(prefString));
     172        List<String> s = new ArrayList<>(Main.pref.getList(prefString));
    173173        this.shortText = prefString.substring(15);
    174174        this.longText = s.get(0);
     
    182182
    183183    private void saveDefault() {
    184         Main.pref.getCollection("shortcut.entry."+shortText, Arrays.asList(longText,
     184        Main.pref.getList("shortcut.entry."+shortText, Arrays.asList(longText,
    185185            String.valueOf(requestedKey), String.valueOf(requestedGroup), String.valueOf(requestedKey),
    186186            String.valueOf(getGroupModifier(requestedGroup)), String.valueOf(true), String.valueOf(false)));
     
    190190    private boolean save() {
    191191        if (isAutomatic() || isReset() || !isAssignedUser()) {
    192             return Main.pref.putCollection("shortcut.entry."+shortText, null);
     192            return Main.pref.putList("shortcut.entry."+shortText, null);
    193193        } else {
    194             return Main.pref.putCollection("shortcut.entry."+shortText, Arrays.asList(longText,
     194            return Main.pref.putList("shortcut.entry."+shortText, Arrays.asList(longText,
    195195                String.valueOf(requestedKey), String.valueOf(requestedGroup), String.valueOf(assignedKey),
    196196                String.valueOf(assignedModifier), String.valueOf(assignedDefault), String.valueOf(assignedUser)));
  • trunk/src/org/openstreetmap/josm/tools/TextTagParser.java

    r12683 r12841  
    2020
    2121    // properties need JOSM restart to apply, modified rarely enough
    22     private static final int MAX_KEY_LENGTH = Main.pref.getInteger("tags.paste.max-key-length", 50);
    23     private static final int MAX_KEY_COUNT = Main.pref.getInteger("tags.paste.max-key-count", 30);
     22    private static final int MAX_KEY_LENGTH = Main.pref.getInt("tags.paste.max-key-length", 50);
     23    private static final int MAX_KEY_COUNT = Main.pref.getInt("tags.paste.max-key-count", 30);
    2424    private static final String KEY_PATTERN = Main.pref.get("tags.paste.tag-pattern", "[0-9a-zA-Z:_]*");
    2525    private static final int MAX_VALUE_LENGTH = 255;
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r12830 r12841  
    12461246     */
    12471247    public static ForkJoinPool newForkJoinPool(String pref, final String nameFormat, final int threadPriority) {
    1248         int noThreads = Main.pref.getInteger(pref, Runtime.getRuntime().availableProcessors());
     1248        int noThreads = Main.pref.getInt(pref, Runtime.getRuntime().availableProcessors());
    12491249        return new ForkJoinPool(noThreads, new ForkJoinPool.ForkJoinWorkerThreadFactory() {
    12501250            final AtomicLong count = new AtomicLong(0);
Note: See TracChangeset for help on using the changeset viewer.