Changeset 2696 in josm


Ignore:
Timestamp:
2009-12-28T14:22:30+01:00 (10 years ago)
Author:
Gubaer
Message:

see #4208: temporary fix

File:
1 edited

Legend:

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

    r2675 r2696  
    486486        this.id = generateUniqueId();
    487487        this.version = 0;
     488        this.changesetId = 0; // reset changeset id on a new object
    488489        this.setIncomplete(false);
    489490    }
     
    10031004        setKeys(other.getKeys());
    10041005        id = other.id;
     1006        if (id <=0) {
     1007            // reset version and changeset id
     1008            version = 0;
     1009            changesetId = 0;
     1010        }
    10051011        timestamp = other.timestamp;
    1006         version = other.version;
     1012        if (id > 0) {
     1013            version = other.version;
     1014        }
    10071015        setIncomplete(other.isIncomplete());
    10081016        flags = other.flags;
    10091017        user= other.user;
    1010         setChangesetId(other.changesetId);
     1018        if (id > 0 && other.changesetId > 0) {
     1019            // #4208: sometimes we cloned from other with id < 0 *and*
     1020            // an assigned changeset id. Don't know why yet. For primitives
     1021            // with id < 0 we don't propagate the changeset id any more.
     1022            //
     1023            setChangesetId(other.changesetId);
     1024        }
    10111025        clearCached();
    10121026    }
     
    10301044        if (! other.isNew() && other.getId() != id)
    10311045            throw new DataIntegrityProblemException(tr("Can''t merge primitives with different ids. This id is {0}, the other is {1}", id, other.getId()));
     1046
    10321047        setKeys(other.getKeys());
    10331048        timestamp = other.timestamp;
     
    10361051        flags = other.flags;
    10371052        user= other.user;
    1038         setChangesetId(other.changesetId);
     1053        changesetId = other.changesetId;
    10391054    }
    10401055
Note: See TracChangeset for help on using the changeset viewer.