Changeset 17181 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2020-10-12T22:43:40+02:00 (4 years ago)
Author:
simon04
Message:

fix #19918 - AutosaveTask: sort files by modify time (patch by gaben, modified)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/AutosaveTask.java

    r17093 r17181  
    1717import java.util.Arrays;
    1818import java.util.Collections;
     19import java.util.Comparator;
    1920import java.util.Date;
    2021import java.util.Deque;
     
    150151            File[] files = deletedLayersDir.listFiles();
    151152            if (files != null) {
    152                 // FIXME: sort by mtime
     153                try {
     154                    Arrays.sort(files, Comparator.comparingLong(File::lastModified));
     155                } catch (Exception e) {
     156                    Logging.error(e);
     157                }
    153158                deletedLayers.addAll(Arrays.asList(files));
    154159            }
Note: See TracChangeset for help on using the changeset viewer.