Ignore:
Timestamp:
2011-11-26T15:34:06+01:00 (13 years ago)
Author:
upliner
Message:

'Update reverter for 4602'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reverter/src/reverter/corehacks/OsmChangesetContentParser.java

    r23273 r27159  
    1616import org.openstreetmap.josm.data.coor.LatLon;
    1717import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
     18import org.openstreetmap.josm.data.osm.User;
    1819import org.openstreetmap.josm.data.osm.history.HistoryNode;
    1920import org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive;
     
    148149            long changesetId = getMandatoryAttributeLong(atts,"changeset");
    149150            boolean visible= getMandatoryAttributeBoolean(atts, "visible");
    150             long uid = getAttributeLong(atts, "uid",-1);
    151             String user = getAttributeString(atts, "user", tr("<anonymous>"));
    152151            String v = getMandatoryAttributeString(atts, "timestamp");
    153152            Date timestamp = DateUtils.fromString(v);
    154153            HistoryOsmPrimitive primitive = null;
     154            // Hack: reverter doesn't need user information, so always use User.getAnonymous()
     155            // TODO: Update OsmChangesetContentParser from the core or update core OsmChangesetContentParser to make it usable with reverter
    155156            if (type.equals(OsmPrimitiveType.NODE)) {
    156157                double lat = getMandatoryAttributeDouble(atts, "lat");
    157158                double lon = getMandatoryAttributeDouble(atts, "lon");
    158159                primitive = new HistoryNode(
    159                         id,version,visible,user,uid,changesetId,timestamp, new LatLon(lat,lon)
     160                        id,version,visible,User.getAnonymous(),changesetId,timestamp, new LatLon(lat,lon)
    160161                );
    161162
    162163            } else if (type.equals(OsmPrimitiveType.WAY)) {
    163164                primitive = new HistoryWay(
    164                         id,version,visible,user,uid,changesetId,timestamp
     165                        id,version,visible,User.getAnonymous(),changesetId,timestamp
    165166                );
    166167            }if (type.equals(OsmPrimitiveType.RELATION)) {
    167168                primitive = new HistoryRelation(
    168                         id,version,visible,user,uid,changesetId,timestamp
     169                        id,version,visible,User.getAnonymous(),changesetId,timestamp
    169170                );
    170171            }
Note: See TracChangeset for help on using the changeset viewer.