Ignore:
Timestamp:
2017-04-10T00:14:42+02:00 (3 years ago)
Author:
Don-vip
Message:

findbugs - EI_EXPOSE_REP2 + javadoc

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/notes/Note.java

    r11821 r11878  
    1111
    1212import org.openstreetmap.josm.data.coor.LatLon;
     13import org.openstreetmap.josm.tools.date.DateUtils;
    1314
    1415/**
     
    9899    /** @return Date that this note was submitted */
    99100    public Date getCreatedAt() {
    100         return cloneDate(createdAt);
     101        return DateUtils.cloneDate(createdAt);
    101102    }
    102103
     
    106107     */
    107108    public void setCreatedAt(Date createdAt) {
    108         this.createdAt = cloneDate(createdAt);
     109        this.createdAt = DateUtils.cloneDate(createdAt);
    109110    }
    110111
    111112    /** @return Date that this note was closed. Null if it is still open. */
    112113    public Date getClosedAt() {
    113         return cloneDate(closedAt);
     114        return DateUtils.cloneDate(closedAt);
    114115    }
    115116
     
    119120     */
    120121    public void setClosedAt(Date closedAt) {
    121         this.closedAt = cloneDate(closedAt);
     122        this.closedAt = DateUtils.cloneDate(closedAt);
    122123    }
    123124
     
    172173    public void updateWith(Note note) {
    173174        this.comments = note.comments;
    174         this.createdAt = cloneDate(note.createdAt);
     175        this.createdAt = DateUtils.cloneDate(note.createdAt);
    175176        this.id = note.id;
    176177        this.state = note.state;
     
    197198        return tr("Note") + ' ' + id + ": " + getFirstComment();
    198199    }
    199 
    200     /**
    201      * Null-safe date cloning method.
    202      * @param d date to clone, or null
    203      * @return cloned date, or null
    204      */
    205     static Date cloneDate(Date d) {
    206         return d != null ? (Date) d.clone() : null;
    207     }
    208200}
  • trunk/src/org/openstreetmap/josm/data/notes/NoteComment.java

    r11821 r11878  
    66
    77import org.openstreetmap.josm.data.osm.User;
     8import org.openstreetmap.josm.tools.date.DateUtils;
    89
    910/**
     
    5253        this.text = commentText;
    5354        this.user = user;
    54         this.commentTimestamp = Note.cloneDate(createDate);
     55        this.commentTimestamp = DateUtils.cloneDate(createDate);
    5556        this.action = action;
    5657        this.isNew = isNew;
     
    6970    /** @return The time at which this comment was created */
    7071    public Date getCommentTimestamp() {
    71         return Note.cloneDate(commentTimestamp);
     72        return DateUtils.cloneDate(commentTimestamp);
    7273    }
    7374
Note: See TracChangeset for help on using the changeset viewer.