Changeset 17720 in josm for trunk/src/org


Ignore:
Timestamp:
2021-04-09T00:55:40+02:00 (4 years ago)
Author:
simon04
Message:

see #14176 - Migrate ChangesetDiscussionComment to Instant

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/ChangesetDiscussionComment.java

    r11878 r17720  
    22package org.openstreetmap.josm.data.osm;
    33
    4 import java.util.Date;
    5 
    6 import org.openstreetmap.josm.tools.date.DateUtils;
     4import java.time.Instant;
    75
    86/**
     
    1311
    1412    /** date this comment was posted at */
    15     private final Date date;
     13    private final Instant date;
    1614    /** the user who posted the comment */
    1715    private final User user;
     
    2422     * @param user the user who posted the comment
    2523     */
    26     public ChangesetDiscussionComment(Date date, User user) {
    27         this.date = DateUtils.cloneDate(date);
     24    public ChangesetDiscussionComment(Instant date, User user) {
     25        this.date = date;
    2826        this.user = user;
    2927    }
     
    4947     * @return date this comment was posted at
    5048     */
    51     public final Date getDate() {
    52         return DateUtils.cloneDate(date);
     49    public final Instant getDate() {
     50        return date;
    5351    }
    5452
  • trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java

    r17717 r17720  
    99import java.nio.charset.StandardCharsets;
    1010import java.text.MessageFormat;
    11 import java.util.Date;
     11import java.time.Instant;
    1212import java.util.LinkedList;
    1313import java.util.List;
     
    172172            // -- date
    173173            String value = atts.getValue("date");
    174             Date date = null;
    175             if (value != null) {
    176                 date = DateUtils.fromString(value);
    177             }
    178 
     174            Instant date = value != null ? DateUtils.parseInstant(value) : null;
    179175            comment = new ChangesetDiscussionComment(date, createUser(atts));
    180176        }
Note: See TracChangeset for help on using the changeset viewer.