Index: trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java	(revision 13591)
+++ trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java	(revision 13597)
@@ -18,7 +18,7 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
-import org.openstreetmap.josm.data.osm.Tag;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -82,6 +82,6 @@
             Map<String, String> newKeys = new HashMap<>(keys);
             for (Entry<String, String> e : keys.entrySet()) {
-                String v = Tag.removeWhiteSpaces(e.getValue());
-                String k = Tag.removeWhiteSpaces(e.getKey());
+                String v = Utils.removeWhiteSpaces(e.getValue());
+                String k = Utils.removeWhiteSpaces(e.getKey());
                 boolean drop = k.isEmpty() || v.isEmpty();
                 if (!e.getKey().equals(k)) {
Index: trunk/src/org/openstreetmap/josm/data/osm/Tag.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Tag.java	(revision 13591)
+++ trunk/src/org/openstreetmap/josm/data/osm/Tag.java	(revision 13597)
@@ -145,10 +145,9 @@
      * @return The string without leading, trailing or multiple inner whitespaces
      * @since 6699
-     */
+     * @deprecated since 13597. Use {@link Utils#removeWhiteSpaces(String)} instead
+     */
+    @Deprecated
     public static String removeWhiteSpaces(String s) {
-        if (s == null || s.isEmpty()) {
-            return s;
-        }
-        return Utils.strip(s).replaceAll("\\s+", " ");
+        return Utils.removeWhiteSpaces(s);
     }
 
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 13591)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 13597)
@@ -336,5 +336,5 @@
                             CheckParameterUtil.ensureThat(val.contains("=>"), "Separate old from new key by '=>'!");
                             final String[] x = val.split("=>", 2);
-                            check.fixCommands.add(FixCommand.fixChangeKey(Tag.removeWhiteSpaces(x[0]), Tag.removeWhiteSpaces(x[1])));
+                            check.fixCommands.add(FixCommand.fixChangeKey(Utils.removeWhiteSpaces(x[0]), Utils.removeWhiteSpaces(x[1])));
                         } else if (val != null && "fixDeleteObject".equals(ai.key)) {
                             CheckParameterUtil.ensureThat("this".equals(val), "fixDeleteObject must be followed by 'this'");
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 13591)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 13597)
@@ -710,7 +710,7 @@
                     commands.add(new ChangePropertyCommand(p, key, null));
                 } else if (value.startsWith(" ") || value.endsWith(" ") || value.contains("  ")) {
-                    commands.add(new ChangePropertyCommand(p, key, Tag.removeWhiteSpaces(value)));
+                    commands.add(new ChangePropertyCommand(p, key, Utils.removeWhiteSpaces(value)));
                 } else if (key.startsWith(" ") || key.endsWith(" ") || key.contains("  ")) {
-                    commands.add(new ChangePropertyKeyCommand(p, key, Tag.removeWhiteSpaces(key)));
+                    commands.add(new ChangePropertyKeyCommand(p, key, Utils.removeWhiteSpaces(key)));
                 } else {
                     String evalue = Entities.unescape(value);
Index: trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java	(revision 13591)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java	(revision 13597)
@@ -31,5 +31,4 @@
 import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.data.osm.Tag;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
@@ -39,4 +38,5 @@
 import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -197,5 +197,5 @@
         if (primitives == null || primitives.isEmpty())
             return null;
-        return new ChangePropertyCommand(primitives, Tag.removeWhiteSpaces(tfKey.getText()), Tag.removeWhiteSpaces(tfValue.getText()));
+        return new ChangePropertyCommand(primitives, Utils.removeWhiteSpaces(tfKey.getText()), Utils.removeWhiteSpaces(tfValue.getText()));
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(revision 13591)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(revision 13597)
@@ -494,10 +494,10 @@
         @Override
         public void performTagEdit() {
-            String value = Tag.removeWhiteSpaces(values.getEditor().getItem().toString());
+            String value = Utils.removeWhiteSpaces(values.getEditor().getItem().toString());
             value = Normalizer.normalize(value, Normalizer.Form.NFC);
             if (value.isEmpty()) {
                 value = null; // delete the key
             }
-            String newkey = Tag.removeWhiteSpaces(keys.getEditor().getItem().toString());
+            String newkey = Utils.removeWhiteSpaces(keys.getEditor().getItem().toString());
             newkey = Normalizer.normalize(newkey, Normalizer.Form.NFC);
             if (newkey.isEmpty()) {
@@ -1060,6 +1060,6 @@
          */
         public final void performTagAdding() {
-            String key = Tag.removeWhiteSpaces(keys.getEditor().getItem().toString());
-            String value = Tag.removeWhiteSpaces(values.getEditor().getItem().toString());
+            String key = Utils.removeWhiteSpaces(keys.getEditor().getItem().toString());
+            String value = Utils.removeWhiteSpaces(values.getEditor().getItem().toString());
             if (key.isEmpty() || value.isEmpty())
                 return;
Index: trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java	(revision 13591)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java	(revision 13597)
@@ -530,5 +530,5 @@
             value = "";
         }
-        value = Tag.removeWhiteSpaces(value);
+        value = Utils.removeWhiteSpaces(value);
 
         // no change if same as before
Index: trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java	(revision 13591)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java	(revision 13597)
@@ -31,4 +31,5 @@
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -207,5 +208,5 @@
         }
 
-        v = Tag.removeWhiteSpaces(v);
+        v = Utils.removeWhiteSpaces(v);
 
         if (!"false".equals(use_last_as_default) || auto_increment != null) {
Index: trunk/src/org/openstreetmap/josm/tools/TextTagParser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/TextTagParser.java	(revision 13591)
+++ trunk/src/org/openstreetmap/josm/tools/TextTagParser.java	(revision 13597)
@@ -59,6 +59,6 @@
             Matcher m = p.matcher(line);
             if (m.matches()) {
-                 k = m.group(1).trim();
-                 v = m.group(2).trim();
+                 k = Utils.removeWhiteSpaces(m.group(1));
+                 v = Utils.removeWhiteSpaces(m.group(2));
                  if (unescapeTextInQuotes) {
                      k = unescape(k);
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 13591)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 13597)
@@ -823,4 +823,17 @@
 
     /**
+     * Removes leading, trailing, and multiple inner whitespaces from the given string, to be used as a key or value.
+     * @param s The string
+     * @return The string without leading, trailing or multiple inner whitespaces
+     * @since 13597
+     */
+    public static String removeWhiteSpaces(String s) {
+        if (s == null || s.isEmpty()) {
+            return s;
+        }
+        return strip(s).replaceAll("\\s+", " ");
+    }
+
+    /**
      * Runs an external command and returns the standard output.
      *
