Changeset 7321 in josm


Ignore:
Timestamp:
2014-07-21T01:51:53+02:00 (10 years ago)
Author:
Don-vip
Message:

fix #10287 - robustness to system time going backwards during josm startup

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/SplashScreen.java

    r7143 r7321  
    197197            long now = System.currentTimeMillis();
    198198            String prevMessageTitle = messages.getLast();
    199             if (!prevMessageTitle.isEmpty()) {
     199            // now should always be >= time but if can be inferior sometimes, see #10287
     200            if (!prevMessageTitle.isEmpty() && now >= time) {
    200201                messages.removeLast();
    201202                messages.add(tr("{0} ({1})", prevMessageTitle, Utils.getDurationString(now - time)));
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r7119 r7321  
    887887    public static String getDurationString(long elapsedTime) throws IllegalArgumentException {
    888888        if (elapsedTime < 0) {
    889             throw new IllegalArgumentException("elapsedTime must be > 0");
     889            throw new IllegalArgumentException("elapsedTime must be >= 0");
    890890        }
    891891        // Is it less than 1 second ?
Note: See TracChangeset for help on using the changeset viewer.