Ignore:
Timestamp:
2016-03-18T00:41:42+01:00 (10 years ago)
Author:
Don-vip
Message:

fix #12639 - NPE in History Window for primitives with more than 100 versions

Location:
trunk/src/org/openstreetmap/josm/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java

    r8840 r10006  
    1616import java.util.Map.Entry;
    1717
     18import org.openstreetmap.josm.Main;
    1819import org.openstreetmap.josm.data.Bounds;
    1920import org.openstreetmap.josm.data.coor.LatLon;
     
    2324
    2425public class ChangesetQuery {
     26
     27    /**
     28     * Maximum number of changesets returned by the OSM API call "/changesets?"
     29     */
     30    public static int MAX_CHANGESETS_NUMBER = 100;
    2531
    2632    /**
     
    234240    public ChangesetQuery forChangesetIds(Collection<Long> changesetIds) {
    235241        CheckParameterUtil.ensureParameterNotNull(changesetIds, "changesetIds");
     242        if (changesetIds.size() > MAX_CHANGESETS_NUMBER) {
     243            Main.warn("Changeset query built with more than " + MAX_CHANGESETS_NUMBER + " changeset ids (" + changesetIds.size() + ")");
     244        }
    236245        this.changesetIds = changesetIds;
    237246        return this;
  • trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java

    r8540 r10006  
    7373            try (InputStream in = getInputStream(sb.toString(), monitor.createSubTaskMonitor(1, true))) {
    7474                if (in == null)
    75                     return null;
     75                    return Collections.emptyList();
    7676                monitor.indeterminateSubTask(tr("Downloading changesets ..."));
    7777                result = OsmChangesetParser.parse(in, monitor.createSubTaskMonitor(1, true));
Note: See TracChangeset for help on using the changeset viewer.