Changeset 19098 in josm
- Timestamp:
- 2024-06-09T09:47:14+02:00 (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/HistoryLoadTask.java
r19063 r19098 10 10 import java.util.ArrayList; 11 11 import java.util.Collection; 12 import java.util.Iterator; 12 13 import java.util.LinkedHashSet; 13 14 import java.util.List; … … 16 17 17 18 import org.openstreetmap.josm.data.osm.Changeset; 19 import org.openstreetmap.josm.data.osm.ChangesetCache; 18 20 import org.openstreetmap.josm.data.osm.OsmPrimitive; 19 21 import org.openstreetmap.josm.data.osm.PrimitiveId; … … 230 232 OsmServerChangesetReader changesetReader = new OsmServerChangesetReader(); 231 233 List<Long> changesetIds = new ArrayList<>(ds.getChangesetIds()); 234 Iterator<Long> iter = changesetIds.iterator(); 235 while (iter.hasNext()) { 236 long id = iter.next(); 237 Changeset cs = ChangesetCache.getInstance().get((int) id); 238 if (cs != null && !cs.isOpen()) { 239 ds.putChangeset(cs); 240 iter.remove(); 241 } 242 } 232 243 233 244 // query changesets 100 by 100 (OSM API limit) 234 245 int n = ChangesetQuery.MAX_CHANGESETS_NUMBER; 235 246 for (int i = 0; i < changesetIds.size(); i += n) { 247 List<Changeset> downloadedCS = new ArrayList<>(changesetIds.size()); 236 248 for (Changeset c : changesetReader.queryChangesets( 237 249 new ChangesetQuery().forChangesetIds(changesetIds.subList(i, Math.min(i + n, changesetIds.size()))), 238 250 progressMonitor.createSubTaskMonitor(1, false))) { 239 251 ds.putChangeset(c); 252 downloadedCS.add(c); 240 253 } 254 ChangesetCache.getInstance().update(downloadedCS); 241 255 } 242 256 }
Note:
See TracChangeset
for help on using the changeset viewer.