Index: trunk/src/org/openstreetmap/josm/actions/corrector/TagCorrector.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/corrector/TagCorrector.java	(revision 17240)
+++ trunk/src/org/openstreetmap/josm/actions/corrector/TagCorrector.java	(revision 17241)
@@ -20,5 +20,5 @@
 import javax.swing.JScrollPane;
 
-import org.openstreetmap.josm.command.ChangeCommand;
+import org.openstreetmap.josm.command.ChangePropertyCommand;
 import org.openstreetmap.josm.command.ChangeRelationMemberRoleCommand;
 import org.openstreetmap.josm.command.Command;
@@ -27,8 +27,5 @@
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
-import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.data.osm.Relation;
-import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.correction.RoleCorrectionTable;
@@ -38,4 +35,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.UserCancelException;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -164,20 +162,11 @@
                     OsmPrimitive primitive = entry.getKey();
 
-                    // create the clone
-                    OsmPrimitive clone;
-                    if (primitive instanceof Way) {
-                        clone = new Way((Way) primitive);
-                    } else if (primitive instanceof Node) {
-                        clone = new Node((Node) primitive);
-                    } else if (primitive instanceof Relation) {
-                        clone = new Relation((Relation) primitive);
-                    } else
-                        throw new AssertionError();
-
                     // use this structure to remember keys that have been set already so that
                     // they're not dropped by a later step
                     Set<String> keysChanged = new HashSet<>();
 
-                    // apply all changes to this clone
+                    // the map for the change command
+                    Map<String, String> tagMap = new HashMap<>();
+
                     List<TagCorrection> tagCorrections = entry.getValue();
                     for (int i = 0; i < tagCorrections.size(); i++) {
@@ -185,14 +174,15 @@
                             TagCorrection tagCorrection = tagCorrections.get(i);
                             if (tagCorrection.isKeyChanged() && !keysChanged.contains(tagCorrection.oldKey)) {
-                                clone.remove(tagCorrection.oldKey);
+                                tagMap.put(tagCorrection.oldKey, null);
                             }
-                            clone.put(tagCorrection.newKey, tagCorrection.newValue);
+                            tagMap.put(tagCorrection.newKey, tagCorrection.newValue);
                             keysChanged.add(tagCorrection.newKey);
                         }
                     }
 
-                    // save the clone
                     if (!keysChanged.isEmpty()) {
-                        commands.add(new ChangeCommand(dataSet, primitive, clone));
+                        // change the properties of this object
+                        commands.add(new ChangePropertyCommand(dataSet, Collections.singleton(primitive),
+                                Utils.toUnmodifiableMap(tagMap)));
                     }
                 }
