Changeset 13534 in josm


Ignore:
Timestamp:
2018-03-17T01:16:09+01:00 (7 years ago)
Author:
Don-vip
Message:

fix #16096 - allow only positive ids in DownloadPrimitivesWithReferrersTask constructor

File:
1 edited

Legend:

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

    r13486 r13534  
    88import java.awt.GridBagLayout;
    99import java.io.IOException;
     10import java.text.MessageFormat;
    1011import java.util.ArrayList;
    1112import java.util.HashSet;
     
    7677        this.full = full;
    7778        this.newLayer = newLayer;
     79        // Check we don't try to download new primitives
     80        for (PrimitiveId primitiveId : ids) {
     81            if (primitiveId.isNew()) {
     82                throw new IllegalArgumentException(MessageFormat.format(
     83                        "Cannot download new primitives (ID {0})", primitiveId.getUniqueId()));
     84            }
     85        }
    7886        // All downloaded primitives are put in a tmpLayer
    7987        tmpLayer = new OsmDataLayer(new DataSet(), newLayerName != null ? newLayerName : OsmDataLayer.createNewName(), null);
Note: See TracChangeset for help on using the changeset viewer.