Changeset 13018 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-10-18T11:37:34+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/APIDataSet.java
r12865 r13018 213 213 214 214 RelationUploadDependencyGraph graph = new RelationUploadDependencyGraph(relationsToAdd, true); 215 newToAdd.addAll(graph.computeUploadOrder( ));215 newToAdd.addAll(graph.computeUploadOrder(false)); 216 216 toAdd = newToAdd; 217 217 218 218 List<OsmPrimitive> newToDelete = new LinkedList<>(); 219 219 graph = new RelationUploadDependencyGraph(Utils.filteredCollection(toDelete, Relation.class), false); 220 newToDelete.addAll(graph.computeUploadOrder( ));220 newToDelete.addAll(graph.computeUploadOrder(true)); 221 221 newToDelete.addAll(Utils.filteredCollection(toDelete, Way.class)); 222 222 newToDelete.addAll(Utils.filteredCollection(toDelete, Node.class)); … … 305 305 } 306 306 307 public List<Relation> computeUploadOrder( ) throws CyclicUploadDependencyException {307 public List<Relation> computeUploadOrder(boolean reverse) throws CyclicUploadDependencyException { 308 308 visited = new HashSet<>(); 309 309 uploadOrder = new LinkedList<>(); … … 313 313 } 314 314 List<Relation> ret = new ArrayList<>(relations); 315 ret.sort(Comparator.comparingInt(uploadOrder::indexOf)); 315 Comparator<? super Relation> cmpr = Comparator.comparingInt(uploadOrder::indexOf); 316 if (reverse) { 317 cmpr = cmpr.reversed(); 318 } 319 ret.sort(cmpr); 316 320 return ret; 317 321 }
Note:
See TracChangeset
for help on using the changeset viewer.