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

see #15229 - fix deprecations caused by [12840]

Location:
trunk/src/org/openstreetmap/josm/io
Files:
8 edited

Legend:

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