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

see #15229 - fix deprecations caused by [12840]

Location:
trunk/src/org/openstreetmap/josm/data/validation
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.