Ignore:
Timestamp:
2016-11-20T17:33:33+01:00 (4 years ago)
Author:
simon04
Message:

see #13376 - Use TimeUnit instead of combinations of 1000/60/60/24

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r10987 r11288  
    3737import java.util.concurrent.ExecutionException;
    3838import java.util.concurrent.FutureTask;
     39import java.util.concurrent.TimeUnit;
    3940import java.util.jar.JarFile;
    4041import java.util.stream.Collectors;
     
    384385            long last = Main.pref.getLong("pluginmanager.lastupdate", 0);
    385386            Integer maxTime = Main.pref.getInteger("pluginmanager.time-based-update.interval", DEFAULT_TIME_BASED_UPDATE_INTERVAL);
    386             long d = (tim - last) / (24 * 60 * 60 * 1000L);
     387            long d = TimeUnit.MILLISECONDS.toDays(tim - last);
    387388            if ((last <= 0) || (maxTime <= 0)) {
    388389                Main.pref.put("pluginmanager.lastupdate", Long.toString(tim));
Note: See TracChangeset for help on using the changeset viewer.