Ignore:
Timestamp:
2017-09-30T14:40:47+02:00 (2 years ago)
Author:
Don-vip
Message:

see #15361 - add more debug info + update licence information

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r12846 r12909  
    8787import org.openstreetmap.josm.tools.SubclassFilteredCollection;
    8888import org.openstreetmap.josm.tools.Utils;
     89import org.openstreetmap.josm.tools.bugreport.BugReport;
    8990
    9091/**
     
    464465     *
    465466     */
    466     private static class SelectionListModel extends AbstractListModel<OsmPrimitive>
     467    static class SelectionListModel extends AbstractListModel<OsmPrimitive>
    467468    implements ActiveLayerChangeListener, SelectionChangedListener, DataSetListener {
    468469
     
    662663         */
    663664        public synchronized void sort() {
    664             if (selection.size() <= Config.getPref().getInt("selection.no_sort_above", 100_000)) {
    665                 boolean quick = selection.size() > Config.getPref().getInt("selection.fast_sort_above", 10_000);
     665            int size = selection.size();
     666            if (size > 1 && size <= Config.getPref().getInt("selection.no_sort_above", 100_000)) {
     667                boolean quick = size > Config.getPref().getInt("selection.fast_sort_above", 10_000);
    666668                Comparator<OsmPrimitive> c = Config.getPref().getBoolean("selection.sort_relations_before_ways", true)
    667669                        ? OsmPrimitiveComparator.orderingRelationsWaysNodes()
    668670                        : OsmPrimitiveComparator.orderingWaysRelationsNodes();
    669                 selection.sort(c.thenComparing(quick
    670                         ? OsmPrimitiveComparator.comparingUniqueId()
    671                         : OsmPrimitiveComparator.comparingNames()));
     671                try {
     672                    selection.sort(c.thenComparing(quick
     673                            ? OsmPrimitiveComparator.comparingUniqueId()
     674                            : OsmPrimitiveComparator.comparingNames()));
     675                } catch (IllegalArgumentException e) {
     676                    throw BugReport.intercept(e).put("size", size).put("quick", quick).put("selection", selection);
     677                }
    672678            }
    673679        }
Note: See TracChangeset for help on using the changeset viewer.