Index: trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java	(revision 939)
+++ trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java	(revision 941)
@@ -307,5 +307,5 @@
 				}
 			}
-			if(earliest != null && latest != null){
+			if (earliest != null && latest != null) {
 				DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT);
 				info.append(tr("Timespan: ") + df.format(new Date((long)(earliest.time * 1000))) + " - "
@@ -362,5 +362,5 @@
 		 ********** STEP 1 - GET CONFIG VALUES **************************
 		 ****************************************************************/
-		Long startTime = System.currentTimeMillis();
+		// Long startTime = System.currentTimeMillis();
 		Color neutralColor = Main.pref.getColor(marktr("gps point"), "layer "+name, Color.GRAY);
 		boolean forceLines = Main.pref.getBoolean("draw.rawgps.lines.force");                     // also draw lines between points belonging to different segments
@@ -397,18 +397,18 @@
 		 ****************************************************************/
 		if (!computeCacheInSync) { // don't compute if the cache is good
-		WayPoint oldWp = null;
-		for (GpxTrack trk : data.tracks) {
+			WayPoint oldWp = null;
+			for (GpxTrack trk : data.tracks) {
 				if (!forceLines) { // don't draw lines between segments, unless forced to
 					oldWp = null;
-			}
-			for (Collection<WayPoint> segment : trk.trackSegs) {
-				for (WayPoint trkPnt : segment) {
+				}
+				for (Collection<WayPoint> segment : trk.trackSegs) {
+					for (WayPoint trkPnt : segment) {
 						if (Double.isNaN(trkPnt.latlon.lat()) || Double.isNaN(trkPnt.latlon.lon())) {
-						continue;
+							continue;
 						}
 						if (oldWp != null) {
-						double dist = trkPnt.latlon.greatCircleDistance(oldWp.latlon);
-						double dtime = trkPnt.time - oldWp.time;
-						double vel = dist/dtime;
+							double dist = trkPnt.latlon.greatCircleDistance(oldWp.latlon);
+							double dtime = trkPnt.time - oldWp.time;
+							double vel = dist/dtime;
 
 							if (!colored) {
@@ -424,5 +424,5 @@
 							} else {
 								trkPnt.drawLine = false;
-						}
+							}
 						} else { // make sure we reset outdated data
 							trkPnt.speedLineColor = colors[255];
Index: trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 939)
+++ trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 941)
@@ -371,14 +371,22 @@
 				}
 				WayPoint wpt = new WayPoint(n.coor);
-				if(n.timestamp != null)
+				if (n.timestamp != null)
+				{
 					wpt.attr.put("time", n.timestamp);
+					wpt.setTime();
+				}
 				trkseg.add(wpt);
 			}
 		}
+		
+		// what is this loop meant to do? it creates waypoints but never 
+		// records them?
 		for (Node n : data.nodes) {
 			if (n.incomplete || n.deleted || doneNodes.contains(n)) continue;
 			WayPoint wpt = new WayPoint(n.coor);
-			if(n.timestamp != null)
+			if (n.timestamp != null) {
 				wpt.attr.put("time", n.timestamp);
+				wpt.setTime();
+			}
 			if (n.keys != null && n.keys.containsKey("name")) {
 				wpt.attr.put("name", n.keys.get("name"));
