Index: trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java	(revision 13405)
+++ trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java	(revision 13414)
@@ -12,4 +12,5 @@
 import org.openstreetmap.josm.data.APIDataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Tagged;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.ExceptionDialogUtil;
@@ -61,5 +62,5 @@
             for (String key: osmPrimitive.keySet()) {
                 String value = osmPrimitive.get(key);
-                if (key.length() > 255) {
+                if (key.length() > Tagged.MAX_TAG_LENGTH) {
                     if (osmPrimitive.isDeleted()) {
                         // if OsmPrimitive is going to be deleted we automatically shorten the value
@@ -70,10 +71,10 @@
                                 )
                         );
-                        osmPrimitive.put(key, value.substring(0, 255));
+                        osmPrimitive.put(key, value.substring(0, Tagged.MAX_TAG_LENGTH));
                         continue;
                     }
                     JOptionPane.showMessageDialog(Main.parent,
                             tr("Length of value for tag ''{0}'' on object {1} exceeds the max. allowed length {2}. Values length is {3}.",
-                                    key, Long.toString(osmPrimitive.getId()), 255, value.length()
+                                    key, Long.toString(osmPrimitive.getId()), Tagged.MAX_TAG_LENGTH, value.length()
                             ),
                             tr("Precondition Violation"),
Index: trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Changeset.java	(revision 13405)
+++ trunk/src/org/openstreetmap/josm/data/osm/Changeset.java	(revision 13414)
@@ -25,5 +25,5 @@
 
     /** The maximum changeset tag length allowed by API 0.6 **/
-    public static final int MAX_CHANGESET_TAG_LENGTH = 255;
+    public static final int MAX_CHANGESET_TAG_LENGTH = MAX_TAG_LENGTH;
 
     /** the changeset id */
Index: trunk/src/org/openstreetmap/josm/data/osm/Tagged.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Tagged.java	(revision 13405)
+++ trunk/src/org/openstreetmap/josm/data/osm/Tagged.java	(revision 13414)
@@ -13,4 +13,11 @@
 //
 public interface Tagged {
+
+    /**
+     * The maximum tag length allowed by OSM API
+     * @since 13414
+     */
+    int MAX_TAG_LENGTH = 255;
+
     /**
      * Sets the map of key/value pairs
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 13405)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 13414)
@@ -34,4 +34,5 @@
 import org.openstreetmap.josm.data.osm.OsmUtils;
 import org.openstreetmap.josm.data.osm.Tag;
+import org.openstreetmap.josm.data.osm.Tagged;
 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper;
 import org.openstreetmap.josm.data.validation.Severity;
@@ -447,14 +448,14 @@
                 withErrors.put(p, "ICK");
             }
-            if (checkValues && (value != null && value.length() > 255) && !withErrors.contains(p, "LV")) {
+            if (checkValues && (value != null && value.length() > Tagged.MAX_TAG_LENGTH) && !withErrors.contains(p, "LV")) {
                 errors.add(TestError.builder(this, Severity.ERROR, LONG_VALUE)
-                        .message(tr("Tag value longer than allowed"), s, key)
+                        .message(tr("Tag value longer than {0} characters ({1} characters)", Tagged.MAX_TAG_LENGTH, value.length()), s, key)
                         .primitives(p)
                         .build());
                 withErrors.put(p, "LV");
             }
-            if (checkKeys && (key != null && key.length() > 255) && !withErrors.contains(p, "LK")) {
+            if (checkKeys && (key != null && key.length() > Tagged.MAX_TAG_LENGTH) && !withErrors.contains(p, "LK")) {
                 errors.add(TestError.builder(this, Severity.ERROR, LONG_KEY)
-                        .message(tr("Tag key longer than allowed"), s, key)
+                        .message(tr("Tag key longer than {0} characters ({1} characters)", Tagged.MAX_TAG_LENGTH, key.length()), s, key)
                         .primitives(p)
                         .build());
