diff --git a/OsmAnd-java/src/main/java/net/osmand/osm/edit/Entity.java b/OsmAnd-java/src/main/java/net/osmand/osm/edit/Entity.java index e0a3b69a27..13ae80af64 100644 --- a/OsmAnd-java/src/main/java/net/osmand/osm/edit/Entity.java +++ b/OsmAnd-java/src/main/java/net/osmand/osm/edit/Entity.java @@ -127,14 +127,18 @@ public abstract class Entity implements Serializable { public Entity(Entity copy, long id) { this.id = id; - for (String t : copy.getTagKeySet()) { - putTagNoLC(t, copy.getTag(t)); - } + copyTags(copy); this.dataLoaded = copy.dataLoaded; this.latitude = copy.latitude; this.longitude = copy.longitude; } + public void copyTags(Entity copy) { + for (String t : copy.getTagKeySet()) { + putTagNoLC(t, copy.getTag(t)); + } + } + public Set getChangedTags() { return changedTags; } diff --git a/OsmAnd-java/src/main/java/net/osmand/osm/edit/Way.java b/OsmAnd-java/src/main/java/net/osmand/osm/edit/Way.java index 4cc28e255a..2c378e347d 100644 --- a/OsmAnd-java/src/main/java/net/osmand/osm/edit/Way.java +++ b/OsmAnd-java/src/main/java/net/osmand/osm/edit/Way.java @@ -21,8 +21,8 @@ public class Way extends Entity { super(id); } - public Way(Way w) { - super(w.getId()); + public Way(Way w, long id) { + super(w, id); if (w.nodeIds != null) { nodeIds = new TLongArrayList(w.nodeIds); }