- Timestamp:
- 2009-02-08T11:58:57+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/NmeaReader.java
r1169 r1381 136 136 private final static SimpleDateFormat RMCTIMEFMT = 137 137 new SimpleDateFormat("ddMMyyHHmmss.SSS"); 138 private final static SimpleDateFormat RMCTIMEFMTSTD = 139 new SimpleDateFormat("ddMMyyHHmmss"); 140 141 private Date readTime(String p) 142 { 143 Date d = RMCTIMEFMT.parse(p, new ParsePosition(0)); 144 if (d == null) 145 d = RMCTIMEFMTSTD.parse(p, new ParsePosition(0)); 146 if (d == null) throw(null); // malformed 147 return d; 148 } 138 149 139 150 // functons for reading the error stats … … 258 269 // time 259 270 accu = e[GPGGA.TIME.position]; 260 Date d = RMCTIMEFMT.parse(currentDate+accu, new ParsePosition(0)); 261 if (d == null) throw(null); // malformed 271 Date d = readTime(currentDate+accu); 262 272 263 273 if((ps.p_Time==null) || (currentwp==null) || !ps.p_Time.equals(accu)) { … … 376 386 String time = e[GPRMC.TIME.position]; 377 387 378 Date d = RMCTIMEFMT.parse(currentDate+time, new ParsePosition(0)); 379 if (d == null) throw(null); 388 Date d = readTime(currentDate+time); 380 389 381 390 if((ps.p_Time==null) || (currentwp==null) || !ps.p_Time.equals(time)) { … … 426 435 } catch(Exception x) { 427 436 // out of bounds and such 428 //System.out.println("Malformed line: "+s.toString().trim()); 437 // System.out.println("Malformed line: "+s.toString().trim()); 429 438 ps.malformed++; 430 439 ps.p_Wp=null;
Note:
See TracChangeset
for help on using the changeset viewer.