Ignore:
Timestamp:
2020-08-29T07:53:11+02:00 (4 years ago)
Author:
simon04
Message:

Java 8: use Comparator.comparing

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

Legend:

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

    r12540 r16953  
    5151
    5252    /** Sorts notes strictly by creation date */
    53     public static final Comparator<Note> DATE_COMPARATOR = (n1, n2) -> n1.createdAt.compareTo(n2.createdAt);
     53    public static final Comparator<Note> DATE_COMPARATOR = Comparator.comparing(n -> n.createdAt);
    5454
    5555    /** Sorts notes by user, then creation date */
  • trunk/src/org/openstreetmap/josm/data/notes/NoteComment.java

    r12540 r16953  
    4141
    4242    /** Sorts note comments strictly by creation date */
    43     public static final Comparator<NoteComment> DATE_COMPARATOR = (n1, n2) -> n1.commentTimestamp.compareTo(n2.commentTimestamp);
     43    public static final Comparator<NoteComment> DATE_COMPARATOR = Comparator.comparing(n -> n.commentTimestamp);
    4444
    4545    /**
Note: See TracChangeset for help on using the changeset viewer.