- Timestamp:
- 2020-10-11T21:29:57+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java
r17153 r17166 8 8 import java.io.StringReader; 9 9 import java.text.Normalizer; 10 import java.time.DateTimeException; 10 11 import java.util.ArrayList; 11 12 import java.util.Arrays; … … 201 202 // if min timestamp is empty: use lowest possible date 202 203 minDate = DateUtils.fromString(rangeA1.isEmpty() ? "1980" : rangeA1).getTime(); 203 } catch (UncheckedParseException ex) {204 } catch (UncheckedParseException | DateTimeException ex) { 204 205 throw new SearchParseError(tr("Cannot parse timestamp ''{0}''", rangeA1), ex); 205 206 } … … 207 208 // if max timestamp is empty: use "now" 208 209 maxDate = rangeA2.isEmpty() ? System.currentTimeMillis() : DateUtils.fromString(rangeA2).getTime(); 209 } catch (UncheckedParseException ex) {210 } catch (UncheckedParseException | DateTimeException ex) { 210 211 throw new SearchParseError(tr("Cannot parse timestamp ''{0}''", rangeA2), ex); 211 212 } -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r16967 r17166 23 23 import java.io.File; 24 24 import java.io.IOException; 25 import java.time.DateTimeException; 25 26 import java.util.ArrayList; 26 27 import java.util.Arrays; … … 879 880 wpt.setTime(Integer.toUnsignedLong(n.getRawTimestamp())); 880 881 } 881 } catch (UncheckedParseException e) {882 } catch (UncheckedParseException | DateTimeException e) { 882 883 Logging.error(e); 883 884 } -
trunk/src/org/openstreetmap/josm/io/AbstractReader.java
r16080 r17166 8 8 import java.io.InputStreamReader; 9 9 import java.text.MessageFormat; 10 import java.time.DateTimeException; 10 11 import java.util.ArrayList; 11 12 import java.util.Collection; … … 45 46 import org.openstreetmap.josm.tools.CheckParameterUtil; 46 47 import org.openstreetmap.josm.tools.Logging; 48 import org.openstreetmap.josm.tools.UncheckedParseException; 47 49 import org.openstreetmap.josm.tools.Utils; 48 50 import org.openstreetmap.josm.tools.date.DateUtils; … … 425 427 426 428 protected final void parseTimestamp(PrimitiveData current, String time) { 427 if (time != null && !time.isEmpty()) { 429 if (time == null || time.isEmpty()) { 430 return; 431 } 432 try { 428 433 int timestamp = timestampCache.computeIfAbsent(time, t -> (int) (DateUtils.tsFromString(t) / 1000)); 429 434 current.setRawTimestamp(timestamp); 435 } catch (UncheckedParseException | DateTimeException e) { 436 Logging.error(e); 430 437 } 431 438 } -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r16643 r17166 7 7 import java.io.InputStream; 8 8 import java.io.Reader; 9 import java.time.DateTimeException; 9 10 import java.util.ArrayList; 10 11 import java.util.Collection; … … 477 478 try { 478 479 currentWayPoint.setTimeInMillis(DateUtils.tsFromString(accumulator.toString())); 479 } catch (UncheckedParseException e) {480 } catch (UncheckedParseException | DateTimeException e) { 480 481 Logging.error(e); 481 482 }
Note:
See TracChangeset
for help on using the changeset viewer.