Changeset 2415 in josm


Ignore:
Timestamp:
2009-11-08T22:27:55+01:00 (15 years ago)
Author:
jttt
Message:

Fixed #3870 Exception during upload

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r2410 r2415  
    385385        if (version <= 0)
    386386            throw new IllegalArgumentException(tr("Version > 0 expected. Got {0}.", version));
    387         if (dataSet != null && id != this.id)
    388             throw new DataIntegrityProblemException("Id cannot be changed after primitive was added to the dataset");
     387        if (dataSet != null && id != this.id) {
     388            DataSet datasetCopy = dataSet;
     389            // Reindex primitive
     390            datasetCopy.removePrimitive(this);
     391            this.id = id;
     392            datasetCopy.addPrimitive(this);
     393        }
    389394        this.id = id;
    390395        this.version = version;
Note: See TracChangeset for help on using the changeset viewer.