Changeset 571 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2008-02-29T20:34:11+01:00 (16 years ago)
Author:
tom_e
Message:

Restored time/setTime semantics accidentally broken in r553.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java

    r553 r571  
    3333         */
    3434        public void setTime () {
    35                 if (! attr.containsKey("time"))
     35                if (! attr.containsKey("time")) {
    3636                        time = 0.0;
     37                        return;
     38                }
    3739                SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); // ignore timezone
    3840                Date d = f.parse(attr.get("time").toString(), new ParsePosition(0));
    39                 if (d == null /* failed to parse */)
     41                if (d == null /* failed to parse */) {
    4042                        time = 0.0;
    41                 time = d.getTime() / 1000.0; /* ms => seconds */
     43                } else {
     44                        time = d.getTime() / 1000.0; /* ms => seconds */
     45                }
    4246        }
    4347
Note: See TracChangeset for help on using the changeset viewer.