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