Ticket #3443: api05.patch

File api05.patch, 971 bytes (added by vsandre, 15 years ago)

setOsmId() accepts version=0

  • OsmPrimitive.java

     
    368368     * @param id the id. > 0 required
    369369     * @param version the version > 0 required
    370370     * @throws IllegalArgumentException thrown if id <= 0
    371      * @throws IllegalArgumentException thrown if version <= 0
     371     * @throws IllegalArgumentException thrown if version < 0
    372372     */
    373373    public void setOsmId(long id, int version) {
    374374        if (id <= 0)
    375375            throw new IllegalArgumentException(tr("ID > 0 expected. Got {0}.", id));
    376         if (version <= 0)
    377             throw new IllegalArgumentException(tr("Version > 0 expected. Got {0}.", version));
     376        if (version < 0)
     377            throw new IllegalArgumentException(tr("Version >= 0 expected. Got {0}.", version));
    378378        this.id = id;
    379379        this.version = version;
    380380        this.incomplete = false;