Changeset 12617 in josm for trunk/src/org
- Timestamp:
- 2017-08-20T19:39:19+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java
r12435 r12617 23 23 import org.openstreetmap.josm.data.gpx.WayPoint; 24 24 import org.openstreetmap.josm.io.IllegalDataException; 25 import org.openstreetmap.josm.tools.JosmRuntimeException;26 25 import org.openstreetmap.josm.tools.date.DateUtils; 27 26 … … 135 134 private final SimpleDateFormat rmcTimeFmtStd = new SimpleDateFormat("ddMMyyHHmmss", Locale.ENGLISH); 136 135 137 private Date readTime(String p) {136 private Date readTime(String p) throws IllegalDataException { 138 137 Date d = Optional.ofNullable(rmcTimeFmt.parse(p, new ParsePosition(0))) 139 138 .orElseGet(() -> rmcTimeFmtStd.parse(p, new ParsePosition(0))); 140 139 if (d == null) 141 throw new JosmRuntimeException("Date is malformed");140 throw new IllegalDataException("Date is malformed: '" + p + "'"); 142 141 return d; 143 142 } … … 480 479 481 480 } catch (IllegalArgumentException | IndexOutOfBoundsException | IllegalDataException ex) { 482 // out of bounds and such 483 Main.debug(ex); 481 if (ps.malformed < 5) { 482 Main.warn(ex); 483 } else { 484 Main.debug(ex); 485 } 484 486 ps.malformed++; 485 487 ps.pWp = null;
Note:
See TracChangeset
for help on using the changeset viewer.