Changeset 17113 in josm
- Timestamp:
- 2020-10-08T16:18:33+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r17010 r17113 39 39 import org.openstreetmap.josm.command.SequenceCommand; 40 40 import org.openstreetmap.josm.data.osm.AbstractPrimitive; 41 import org.openstreetmap.josm.data.osm. Node;41 import org.openstreetmap.josm.data.osm.DataSet; 42 42 import org.openstreetmap.josm.data.osm.OsmPrimitive; 43 43 import org.openstreetmap.josm.data.osm.OsmUtils; … … 46 46 import org.openstreetmap.josm.data.osm.TagMap; 47 47 import org.openstreetmap.josm.data.osm.Tagged; 48 import org.openstreetmap.josm.data.osm. Way;48 import org.openstreetmap.josm.data.osm.visitor.MergeSourceBuildingVisitor; 49 49 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper; 50 50 import org.openstreetmap.josm.data.validation.OsmValidator; … … 972 972 973 973 int unchangedDeprecated = countDeprecated(p); 974 975 // see #19895: create deep clone. This complex method works even with locked files 976 MergeSourceBuildingVisitor builder = new MergeSourceBuildingVisitor(p.getDataSet()); 977 p.accept(builder); 978 DataSet clonedDs = builder.build(); 979 OsmPrimitive clone = clonedDs.getPrimitiveById(p.getPrimitiveId()); 980 974 981 Iterator<String> iter = fixVals.iterator(); 975 OsmPrimitive clone;976 if (p instanceof Node) {977 clone = new Node((Node) p);978 } else if (p instanceof Way) {979 clone = new Way((Way) p);980 } else if (p instanceof Relation) {981 clone = new Relation((Relation) p);982 } else {983 return; // should not happen984 }985 982 while (iter.hasNext()) { 986 983 clone.put(key, iter.next()); … … 989 986 } 990 987 } 988 991 989 992 990 private int countDeprecated(OsmPrimitive p) {
Note:
See TracChangeset
for help on using the changeset viewer.