Changeset 12909 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2017-09-30T14:40:47+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r12846 r12909 87 87 import org.openstreetmap.josm.tools.SubclassFilteredCollection; 88 88 import org.openstreetmap.josm.tools.Utils; 89 import org.openstreetmap.josm.tools.bugreport.BugReport; 89 90 90 91 /** … … 464 465 * 465 466 */ 466 privatestatic class SelectionListModel extends AbstractListModel<OsmPrimitive>467 static class SelectionListModel extends AbstractListModel<OsmPrimitive> 467 468 implements ActiveLayerChangeListener, SelectionChangedListener, DataSetListener { 468 469 … … 662 663 */ 663 664 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); 666 668 Comparator<OsmPrimitive> c = Config.getPref().getBoolean("selection.sort_relations_before_ways", true) 667 669 ? OsmPrimitiveComparator.orderingRelationsWaysNodes() 668 670 : 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 } 672 678 } 673 679 }
Note:
See TracChangeset
for help on using the changeset viewer.