Changeset 10619 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2016-07-24T00:19:35+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
r10463 r10619 119 119 120 120 protected static void sort(List<ExtensionFileFilter> filters) { 121 Collections.sort( 122 filters, 123 new Comparator<ExtensionFileFilter>() { 124 private AllFormatsImporter all = new AllFormatsImporter(); 125 @Override 126 public int compare(ExtensionFileFilter o1, ExtensionFileFilter o2) { 127 if (o1.getDescription().equals(all.filter.getDescription())) return 1; 128 if (o2.getDescription().equals(all.filter.getDescription())) return -1; 129 return o1.getDescription().compareTo(o2.getDescription()); 130 } 121 filters.sort(new Comparator<ExtensionFileFilter>() { 122 private AllFormatsImporter all = new AllFormatsImporter(); 123 @Override 124 public int compare(ExtensionFileFilter o1, ExtensionFileFilter o2) { 125 if (o1.getDescription().equals(all.filter.getDescription())) return 1; 126 if (o2.getDescription().equals(all.filter.getDescription())) return -1; 127 return o1.getDescription().compareTo(o2.getDescription()); 131 128 } 129 } 132 130 ); 133 131 } -
trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java
r10467 r10619 130 130 List<Integer> segmentIndexes = new LinkedList<>(); 131 131 segmentIndexes.addAll(innerEntry.keySet()); 132 Collections.sort(segmentIndexes,Collections.reverseOrder());132 segmentIndexes.sort(Collections.reverseOrder()); 133 133 134 134 List<Node> wayNodes = w.getNodes(); … … 149 149 List<Node> nodesToAdd = new LinkedList<>(); 150 150 nodesToAdd.addAll(nodesInSegment); 151 Collections.sort(nodesToAdd,new NodeDistanceToRefNodeComparator(151 nodesToAdd.sort(new NodeDistanceToRefNodeComparator( 152 152 w.getNode(segmentIndex), w.getNode(segmentIndex+1), !joinWayToNode)); 153 153 wayNodes.addAll(segmentIndex + 1, nodesToAdd); -
trunk/src/org/openstreetmap/josm/actions/PurgeAction.java
r10601 r10619 13 13 import java.util.ArrayList; 14 14 import java.util.Collection; 15 import java.util.Collections;16 15 import java.util.HashSet; 17 16 import java.util.List; … … 244 243 ImageProvider.get("warning-small"), JLabel.LEFT), GBC.eol().fill(GBC.HORIZONTAL)); 245 244 246 Collections.sort(toPurgeAdditionally,(o1, o2) -> {245 toPurgeAdditionally.sort((o1, o2) -> { 247 246 int type = o2.getType().compareTo(o1.getType()); 248 247 if (type != 0) -
trunk/src/org/openstreetmap/josm/data/APIDataSet.java
r10608 r10619 4 4 import java.util.ArrayList; 5 5 import java.util.Collection; 6 import java.util.Collections;7 6 import java.util.HashMap; 8 7 import java.util.HashSet; … … 72 71 } 73 72 OsmPrimitiveComparator c = new OsmPrimitiveComparator(false, true); 74 Collections.sort(toDelete,c);75 Collections.sort(toAdd,c);76 Collections.sort(toUpdate,c);73 toDelete.sort(c); 74 toAdd.sort(c); 75 toUpdate.sort(c); 77 76 } 78 77 … … 332 331 } 333 332 List<Relation> ret = new ArrayList<>(relations); 334 Collections.sort( 335 ret, 336 (o1, o2) -> Integer.compare(uploadOrder.indexOf(o1), uploadOrder.indexOf(o2)) 337 ); 333 ret.sort((o1, o2) -> Integer.compare(uploadOrder.indexOf(o1), uploadOrder.indexOf(o2))); 338 334 return ret; 339 335 } -
trunk/src/org/openstreetmap/josm/data/osm/NoteData.java
r10608 r10619 102 102 public Collection<Note> getSortedNotes() { 103 103 final List<Note> list = new ArrayList<>(noteList); 104 Collections.sort(list,comparator);104 list.sort(comparator); 105 105 return list; 106 106 } -
trunk/src/org/openstreetmap/josm/data/osm/history/History.java
r10608 r10619 4 4 import java.text.MessageFormat; 5 5 import java.util.ArrayList; 6 import java.util.Collections;7 6 import java.util.Date; 8 7 import java.util.List; … … 69 68 public History sortAscending() { 70 69 List<HistoryOsmPrimitive> copy = new ArrayList<>(versions); 71 Collections.sort(copy,(o1, o2) -> o1.compareTo(o2));70 copy.sort((o1, o2) -> o1.compareTo(o2)); 72 71 return new History(id, type, copy); 73 72 } … … 79 78 public History sortDescending() { 80 79 List<HistoryOsmPrimitive> copy = new ArrayList<>(versions); 81 Collections.sort(copy,(o1, o2) -> o2.compareTo(o1));80 copy.sort((o1, o2) -> o2.compareTo(o1)); 82 81 return new History(id, type, copy); 83 82 } -
trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java
r10611 r10619 11 11 import java.util.ArrayList; 12 12 import java.util.Collection; 13 import java.util.Collections;14 13 import java.util.Comparator; 15 14 import java.util.Iterator; … … 150 149 // for each configured ImageryInfo, add a menu entry. 151 150 final List<ImageryInfo> savedLayers = new ArrayList<>(ImageryLayerInfo.instance.getLayers()); 152 Collections.sort(savedLayers,alphabeticImageryComparator);151 savedLayers.sort(alphabeticImageryComparator); 153 152 for (final ImageryInfo u : savedLayers) { 154 153 addDynamic(new AddImageryLayerAction(u)); … … 184 183 } 185 184 if (!inViewLayers.isEmpty()) { 186 Collections.sort(inViewLayers,alphabeticImageryComparator);185 inViewLayers.sort(alphabeticImageryComparator); 187 186 addDynamicSeparator(); 188 187 for (ImageryInfo i : inViewLayers) { -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java
r10611 r10619 5 5 import java.beans.PropertyChangeSupport; 6 6 import java.util.ArrayList; 7 import java.util.Collections;8 7 import java.util.HashMap; 9 8 import java.util.HashSet; … … 65 64 66 65 protected void sort() { 67 Collections.sort( 68 displayedKeys, 69 (key1, key2) -> { 70 if (decisions.get(key1).isDecided() && !decisions.get(key2).isDecided()) 71 return 1; 72 else if (!decisions.get(key1).isDecided() && decisions.get(key2).isDecided()) 73 return -1; 74 return key1.compareTo(key2); 75 } 66 displayedKeys.sort((key1, key2) -> { 67 if (decisions.get(key1).isDecided() && !decisions.get(key2).isDecided()) 68 return 1; 69 else if (!decisions.get(key1).isDecided() && decisions.get(key2).isDecided()) 70 return -1; 71 return key1.compareTo(key2); 72 } 76 73 ); 77 74 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/DeleteFromRelationConfirmationDialog.java
r10465 r10619 14 14 import java.util.ArrayList; 15 15 import java.util.Collection; 16 import java.util.Collections;17 16 import java.util.Comparator; 18 17 import java.util.HashSet; … … 202 201 203 202 protected void sort() { 204 Collections.sort( 205 data, 206 new Comparator<RelationToChildReference>() { 207 private NameFormatter nf = DefaultNameFormatter.getInstance(); 208 @Override 209 public int compare(RelationToChildReference o1, RelationToChildReference o2) { 210 int cmp = o1.getChild().getDisplayName(nf).compareTo(o2.getChild().getDisplayName(nf)); 211 if (cmp != 0) return cmp; 212 cmp = o1.getParent().getDisplayName(nf).compareTo(o2.getParent().getDisplayName(nf)); 213 if (cmp != 0) return cmp; 214 return Integer.compare(o1.getPosition(), o2.getPosition()); 215 } 203 data.sort(new Comparator<RelationToChildReference>() { 204 private NameFormatter nf = DefaultNameFormatter.getInstance(); 205 @Override 206 public int compare(RelationToChildReference o1, RelationToChildReference o2) { 207 int cmp = o1.getChild().getDisplayName(nf).compareTo(o2.getChild().getDisplayName(nf)); 208 if (cmp != 0) return cmp; 209 cmp = o1.getParent().getDisplayName(nf).compareTo(o2.getParent().getDisplayName(nf)); 210 if (cmp != 0) return cmp; 211 return Integer.compare(o1.getPosition(), o2.getPosition()); 216 212 } 213 } 217 214 ); 218 215 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
r10611 r10619 10 10 import java.util.ArrayList; 11 11 import java.util.Collection; 12 import java.util.Collections;13 12 import java.util.List; 14 13 import java.util.Locale; … … 107 106 protected static String buildDataText(OsmDataLayer layer, List<OsmPrimitive> primitives) { 108 107 InspectPrimitiveDataText dt = new InspectPrimitiveDataText(layer); 109 Collections.sort(primitives,new OsmPrimitiveComparator());108 primitives.sort(new OsmPrimitiveComparator()); 110 109 for (OsmPrimitive o : primitives) { 111 110 dt.addPrimitive(o); -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r10611 r10619 395 395 396 396 public void sort() { 397 Collections.sort( 398 relations, 399 DefaultNameFormatter.getInstance().getRelationComparator() 400 ); 397 relations.sort(DefaultNameFormatter.getInstance().getRelationComparator()); 401 398 } 402 399 -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r10611 r10619 657 657 */ 658 658 public synchronized void sort() { 659 if ( this.selection.size() <= Main.pref.getInteger("selection.no_sort_above", 100000)) {660 boolean quick = this.selection.size() > Main.pref.getInteger("selection.fast_sort_above", 10000);661 Collections.sort(this.selection,new OsmPrimitiveComparator(quick, false));659 if (selection.size() <= Main.pref.getInteger("selection.no_sort_above", 100000)) { 660 boolean quick = selection.size() > Main.pref.getInteger("selection.fast_sort_above", 10000); 661 selection.sort(new OsmPrimitiveComparator(quick, false)); 662 662 } 663 663 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerModel.java
r10611 r10619 6 6 import java.util.ArrayList; 7 7 import java.util.Collection; 8 import java.util.Collections;9 8 import java.util.HashSet; 10 9 import java.util.List; … … 151 150 152 151 protected void sort() { 153 Collections.sort( 154 this.data, 155 (o1, o2) -> { 156 if (o1.getId() < o2.getId()) return 1; 157 if (o1.getId() == o2.getId()) return 0; 158 return -1; 159 } 152 data.sort((o1, o2) -> { 153 if (o1.getId() < o2.getId()) return 1; 154 if (o1.getId() == o2.getId()) return 0; 155 return -1; 156 } 160 157 ); 161 158 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentTableModel.java
r10611 r10619 3 3 4 4 import java.util.ArrayList; 5 import java.util.Collections;6 5 import java.util.HashSet; 7 6 import java.util.Iterator; … … 80 79 81 80 protected void sort() { 82 Collections.sort( 83 data, 84 (c1, c2) -> { 85 if (c1.getModificationType().equals(c2.getModificationType())) { 86 long id1 = c1.getPrimitive().getId(); 87 long id2 = c2.getPrimitive().getId(); 81 data.sort((c1, c2) -> { 82 if (c1.getModificationType().equals(c2.getModificationType())) { 83 long id1 = c1.getPrimitive().getId(); 84 long id2 = c2.getPrimitive().getId(); 88 85 89 if (id1 == id2) 90 return 0; 91 else if (id1 < id2) 92 return -1; 93 return 1; 86 if (id1 == id2) 87 return 0; 88 else if (id1 < id2) 89 return -1; 90 return 1; 91 } 92 switch(c1.getModificationType()) { 93 case CREATED: return -1; 94 case UPDATED: 95 switch(c2.getModificationType()) { 96 case CREATED: return 1; 97 default: return -1; 94 98 } 95 switch(c1.getModificationType()) { 96 case CREATED: return -1; 97 case UPDATED: 98 switch(c2.getModificationType()) { 99 case CREATED: return 1; 100 default: return -1; 101 } 102 case DELETED: 103 return 1; 104 } 105 // should not happen 106 return 0; 99 case DELETED: 100 return 1; 107 101 } 102 // should not happen 103 return 0; 104 } 108 105 ); 109 106 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetListModel.java
r10611 r10619 4 4 import java.util.ArrayList; 5 5 import java.util.Collection; 6 import java.util.Collections;7 6 import java.util.HashSet; 8 7 import java.util.List; … … 140 139 141 140 protected void sort() { 142 Collections.sort( 143 data, 144 (cs1, cs2) -> { 145 if (cs1.getId() > cs2.getId()) return -1; 146 if (cs1.getId() == cs2.getId()) return 0; 147 return 1; 148 } 141 data.sort((cs1, cs2) -> { 142 if (cs1.getId() > cs2.getId()) return -1; 143 if (cs1.getId() == cs2.getId()) return 0; 144 return 1; 145 } 149 146 ); 150 147 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r10611 r10619 702 702 703 703 List<Relation> sortedRelations = new ArrayList<>(roles.keySet()); 704 Collections.sort(sortedRelations,(o1, o2) -> {704 sortedRelations.sort((o1, o2) -> { 705 705 int comp = Boolean.compare(o1.isDisabledAndHidden(), o2.isDisabledAndHidden()); 706 706 return comp != 0 ? comp : DefaultNameFormatter.getInstance().getRelationComparator().compare(o1, o2); -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r10611 r10619 415 415 AutoCompletionManager autocomplete = Main.getLayerManager().getEditLayer().data.getAutoCompletionManager(); 416 416 List<AutoCompletionListItem> keyList = autocomplete.getKeys(); 417 Collections.sort(keyList,defaultACItemComparator);417 keyList.sort(defaultACItemComparator); 418 418 419 419 keys = new AutoCompletingComboBox(key); … … 428 428 429 429 List<AutoCompletionListItem> valueList = autocomplete.getValues(getAutocompletionKeys(key)); 430 Collections.sort(valueList,usedValuesAwareComparator);430 valueList.sort(usedValuesAwareComparator); 431 431 432 432 final String selection = m.size() != 1 ? tr("<different>") : m.entrySet().iterator().next().getKey(); … … 612 612 613 613 List<AutoCompletionListItem> valueList = autocomplete.getValues(getAutocompletionKeys(key)); 614 Collections.sort(valueList,comparator);614 valueList.sort(comparator); 615 615 if (Main.isTraceEnabled()) { 616 616 Main.trace("Focus gained by {0}, e={1}", values, e); … … 687 687 } 688 688 689 Collections.sort(keyList,defaultACItemComparator);689 keyList.sort(defaultACItemComparator); 690 690 keys.setPossibleACItems(keyList); 691 691 keys.setEditable(true); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorter.java
r10611 r10619 4 4 import java.util.ArrayList; 5 5 import java.util.Collection; 6 import java.util.Collections;7 6 import java.util.HashMap; 8 7 import java.util.LinkedHashMap; … … 65 64 @Override 66 65 public List<RelationMember> sortMembers(List<RelationMember> list) { 67 Collections.sort(list,(a, b) -> {66 list.sort((a, b) -> { 68 67 final int houseNumber = AlphanumComparator.getInstance().compare( 69 68 a.getMember().get("addr:housenumber"), -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersModel.java
r10611 r10619 6 6 import java.io.File; 7 7 import java.util.ArrayList; 8 import java.util.Collections;9 8 import java.util.List; 10 9 … … 71 70 layerInfo.add(new SaveLayerInfo(layer)); 72 71 } 73 Collections.sort(layerInfo,(o1, o2) -> o1.compareTo(o2));72 layerInfo.sort((o1, o2) -> o1.compareTo(o2)); 74 73 fireTableDataChanged(); 75 74 } -
trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java
r10378 r10619 202 202 if (data == null) 203 203 return; 204 Collections.sort( 205 data, 206 new Comparator<OsmPrimitive>() { 207 private DefaultNameFormatter formatter = DefaultNameFormatter.getInstance(); 208 @Override 209 public int compare(OsmPrimitive o1, OsmPrimitive o2) { 210 int ret = OsmPrimitiveType.from(o1).compareTo(OsmPrimitiveType.from(o2)); 211 if (ret != 0) 212 return ret; 213 return o1.getDisplayName(formatter).compareTo(o1.getDisplayName(formatter)); 214 } 204 data.sort(new Comparator<OsmPrimitive>() { 205 private DefaultNameFormatter formatter = DefaultNameFormatter.getInstance(); 206 @Override 207 public int compare(OsmPrimitive o1, OsmPrimitive o2) { 208 int ret = OsmPrimitiveType.from(o1).compareTo(OsmPrimitiveType.from(o2)); 209 if (ret != 0) 210 return ret; 211 return o1.getDisplayName(formatter).compareTo(o1.getDisplayName(formatter)); 215 212 } 213 } 216 214 ); 217 215 } -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r10611 r10619 1447 1447 return; 1448 1448 List<Tile> allTiles = allTilesCreate(); 1449 Collections.sort(allTiles,getTileDistanceComparator());1449 allTiles.sort(getTileDistanceComparator()); 1450 1450 for (Tile t : allTiles) { 1451 1451 loadTile(t, force); -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r10611 r10619 646 646 */ 647 647 final List<Way> sortedWays = new ArrayList<>(ways); 648 Collections.sort(sortedWays,new OsmPrimitiveComparator(true, false)); // sort by OsmPrimitive#getUniqueId ascending648 sortedWays.sort(new OsmPrimitiveComparator(true, false)); // sort by OsmPrimitive#getUniqueId ascending 649 649 Collections.reverse(sortedWays); // sort by OsmPrimitive#getUniqueId descending 650 650 for (Way w : sortedWays) { -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r10611 r10619 1081 1081 } 1082 1082 1083 Collections.sort(dateImgLst,(o1, o2) -> o1.getExifTime().compareTo(o2.getExifTime()));1083 dateImgLst.sort((o1, o2) -> o1.getExifTime().compareTo(o2.getExifTime())); 1084 1084 1085 1085 return dateImgLst; -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
r10611 r10619 11 11 import java.util.Arrays; 12 12 import java.util.Collection; 13 import java.util.Collections;14 13 15 14 import javax.swing.AbstractAction; … … 278 277 /* we must have got at least one waypoint now */ 279 278 280 Collections.sort((ArrayList<WayPoint>) waypoints,(a, b) -> a.time <= b.time ? -1 : 1);279 ((ArrayList<WayPoint>) waypoints).sort((a, b) -> a.time <= b.time ? -1 : 1); 281 280 282 281 firstTime = -1.0; /* this time of the first waypoint, not first trackpoint */ -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r10611 r10619 19 19 import java.util.ArrayList; 20 20 import java.util.Collection; 21 import java.util.Collections;22 21 import java.util.List; 23 22 … … 234 233 if (from instanceof MarkerLayer) { 235 234 data.addAll(((MarkerLayer) from).data); 236 Collections.sort(data,(o1, o2) -> Double.compare(o1.time, o2.time));235 data.sort((o1, o2) -> Double.compare(o1.time, o2.time)); 237 236 } 238 237 } -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r10611 r10619 1223 1223 1224 1224 protected void sort() { 1225 Collections.sort(data, 1226 (o1, o2) -> { 1227 if (o1.isEmpty() && o2.isEmpty()) 1228 return 0; 1229 if (o1.isEmpty()) return 1; 1230 if (o2.isEmpty()) return -1; 1231 return o1.compareTo(o2); 1232 }); 1225 data.sort((o1, o2) -> { 1226 if (o1.isEmpty() && o2.isEmpty()) 1227 return 0; 1228 if (o1.isEmpty()) return 1; 1229 if (o2.isEmpty()) return -1; 1230 return o1.compareTo(o2); 1231 }); 1233 1232 } 1234 1233 -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
r10611 r10619 274 274 readPreferences(tmpPrefs); 275 275 // sorting after modification - first modified, then non-default, then default entries 276 Collections.sort(allData,customComparator);276 allData.sort(customComparator); 277 277 applyFilter(); 278 278 } … … 418 418 } 419 419 // allow user to review the changes in table 420 Collections.sort(allData,customComparator);420 allData.sort(customComparator); 421 421 applyFilter(); 422 422 } -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/CacheContentsPanel.java
r10611 r10619 7 7 import java.awt.event.ActionEvent; 8 8 import java.util.ArrayList; 9 import java.util.Collections;10 9 import java.util.List; 11 10 import java.util.Map; … … 105 104 sortedStats.add(new Pair<>(e.getKey(), e.getValue()[0])); 106 105 } 107 Collections.sort(sortedStats,(o1, o2) -> -1 * o1.b.compareTo(o2.b));106 sortedStats.sort((o1, o2) -> -1 * o1.b.compareTo(o2.b)); 108 107 String[][] ret = new String[sortedStats.size()][3]; 109 108 int index = 0; -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java
r10611 r10619 5 5 import java.util.ArrayList; 6 6 import java.util.Collection; 7 import java.util.Collections;8 7 import java.util.HashMap; 9 8 import java.util.HashSet; … … 147 146 */ 148 147 protected void sort() { 149 Collections.sort( 150 availablePlugins, 151 (o1, o2) -> { 152 String n1 = o1.getName() == null ? "" : o1.getName().toLowerCase(Locale.ENGLISH); 153 String n2 = o2.getName() == null ? "" : o2.getName().toLowerCase(Locale.ENGLISH); 154 return n1.compareTo(n2); 155 } 148 availablePlugins.sort((o1, o2) -> { 149 String n1 = o1.getName() == null ? "" : o1.getName().toLowerCase(Locale.ENGLISH); 150 String n2 = o2.getName() == null ? "" : o2.getName().toLowerCase(Locale.ENGLISH); 151 return n1.compareTo(n2); 152 } 156 153 ); 157 154 } -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java
r10378 r10619 59 59 this.listener = listener; 60 60 data = new ArrayList<>(Projections.getAllProjectionCodes()); 61 Collections.sort(data,new CodeComparator());61 data.sort(new CodeComparator()); 62 62 filteredData = new ArrayList<>(data); 63 63 build(); -
trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
r10611 r10619 8 8 import java.util.ArrayList; 9 9 import java.util.Collection; 10 import java.util.Collections;11 10 import java.util.EnumSet; 12 11 import java.util.HashMap; … … 562 561 */ 563 562 protected void sort() { 564 Collections.sort(tags,(self, other) -> self.getName().compareTo(other.getName()));563 tags.sort((self, other) -> self.getName().compareTo(other.getName())); 565 564 } 566 565 -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetMenu.java
r10131 r10619 11 11 import java.io.Serializable; 12 12 import java.util.ArrayList; 13 import java.util.Collections;14 13 import java.util.Comparator; 15 14 import java.util.List; … … 140 139 141 140 private static void handleMenuItem(JMenu menu, PresetTextComparator comp, List<JMenuItem> sortarray, int lastSeparator) { 142 Collections.sort(sortarray,comp);141 sortarray.sort(comp); 143 142 int pos = 0; 144 143 for (JMenuItem menuItem : sortarray) { -
trunk/src/org/openstreetmap/josm/io/OsmWriter.java
r10615 r10619 7 7 import java.util.ArrayList; 8 8 import java.util.Collection; 9 import java.util.Collections;10 9 import java.util.Comparator; 11 10 import java.util.List; … … 110 109 List<T> result = new ArrayList<>(primitives.size()); 111 110 result.addAll(primitives); 112 Collections.sort(result,byIdComparator);111 result.sort(byIdComparator); 113 112 return result; 114 113 } … … 269 268 } 270 269 List<Entry<String, String>> entries = new ArrayList<>(osm.getKeys().entrySet()); 271 Collections.sort(entries,byKeyComparator);270 entries.sort(byKeyComparator); 272 271 for (Entry<String, String> e : entries) { 273 272 out.println(" <tag k='"+ XmlWriter.encode(e.getKey()) + -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r10616 r10619 746 746 // lower the value of "stage" the earlier the plugin should be loaded. 747 747 // 748 Collections.sort( 749 toLoad, 750 (o1, o2) -> { 751 if (o1.stage < o2.stage) return -1; 752 if (o1.stage == o2.stage) return 0; 753 return 1; 754 } 748 toLoad.sort((o1, o2) -> { 749 if (o1.stage < o2.stage) return -1; 750 if (o1.stage == o2.stage) return 0; 751 return 1; 752 } 755 753 ); 756 754 if (toLoad.isEmpty())
Note:
See TracChangeset
for help on using the changeset viewer.