Index: /trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/Changeset.java	(revision 7994)
+++ /trunk/src/org/openstreetmap/josm/data/osm/Changeset.java	(revision 7995)
@@ -13,4 +13,5 @@
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.visitor.Visitor;
+import org.openstreetmap.josm.tools.CheckParameterUtil;
 
 /**
@@ -21,6 +22,6 @@
 public final class Changeset implements Tagged {
 
-    /** The maximum changeset comment text length allowed by API 0.6 **/
-    public static final int MAX_COMMENT_LENGTH = 255;
+    /** The maximum changeset tag length allowed by API 0.6 **/
+    public static final int MAX_CHANGESET_TAG_LENGTH = 255;
 
     /** the changeset id */
@@ -191,4 +192,10 @@
     @Override
     public void setKeys(Map<String, String> keys) {
+        CheckParameterUtil.ensureParameterNotNull(keys, "keys");
+        for (String value : keys.values()) {
+            if (value != null && value.length() > MAX_CHANGESET_TAG_LENGTH) {
+                throw new IllegalArgumentException("Changeset tag value is too long: "+value);
+            }
+        }
         this.tags = keys;
     }
@@ -204,4 +211,8 @@
     @Override
     public void put(String key, String value) {
+        CheckParameterUtil.ensureParameterNotNull(key, "key");
+        if (value != null && value.length() > MAX_CHANGESET_TAG_LENGTH) {
+            throw new IllegalArgumentException("Changeset tag value is too long: "+value);
+        }
         this.tags.put(key, value);
     }
Index: /trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java	(revision 7994)
+++ /trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java	(revision 7995)
@@ -34,7 +34,6 @@
 
 /**
- * BasicUploadSettingsPanel allows to enter the basic parameters required for uploading
- * data.
- *
+ * BasicUploadSettingsPanel allows to enter the basic parameters required for uploading data.
+ * @since 2599
  */
 public class BasicUploadSettingsPanel extends JPanel {
@@ -56,17 +55,17 @@
         JPanel pnl = new JPanel(new GridBagLayout());
 
-        final JEditorPane commentLabel = new JMultilineLabel("<html><b>" + tr("Provide a brief comment for the changes you are uploading:"));
+        JEditorPane commentLabel = new JMultilineLabel("<html><b>" + tr("Provide a brief comment for the changes you are uploading:"));
         pnl.add(commentLabel, GBC.eol().insets(0, 5, 10, 3).fill(GBC.HORIZONTAL));
         hcbUploadComment.setToolTipText(tr("Enter an upload comment"));
-        hcbUploadComment.setMaxTextLength(Changeset.MAX_COMMENT_LENGTH);
+        hcbUploadComment.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH);
         List<String> cmtHistory = new LinkedList<>(Main.pref.getCollection(HISTORY_KEY, new LinkedList<String>()));
         Collections.reverse(cmtHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
         hcbUploadComment.setPossibleItems(cmtHistory);
-        final CommentModelListener commentModelListener = new CommentModelListener(hcbUploadComment, changesetCommentModel);
+        CommentModelListener commentModelListener = new CommentModelListener(hcbUploadComment, changesetCommentModel);
         hcbUploadComment.getEditor().addActionListener(commentModelListener);
         hcbUploadComment.getEditor().getEditorComponent().addFocusListener(commentModelListener);
         pnl.add(hcbUploadComment, GBC.eol().fill(GBC.HORIZONTAL));
 
-        final JEditorPane sourceLabel = new JMultilineLabel("<html><b>" + tr("Specify the data source for the changes")
+        JEditorPane sourceLabel = new JMultilineLabel("<html><b>" + tr("Specify the data source for the changes")
                 + "</b> (<a href=\"urn:changeset-source\">" + tr("obtain from current layers") + "</a>)<b>:</b>");
         sourceLabel.addHyperlinkListener(new HyperlinkListener() {
@@ -83,8 +82,10 @@
 
         hcbUploadSource.setToolTipText(tr("Enter a source"));
-        List<String> sourceHistory = new LinkedList<>(Main.pref.getCollection(SOURCE_HISTORY_KEY, Arrays.asList("knowledge", "survey", "Bing")));
+        hcbUploadSource.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH);
+        List<String> sourceHistory = new LinkedList<>(Main.pref.getCollection(SOURCE_HISTORY_KEY,
+                Arrays.asList("knowledge", "survey", "Bing")));
         Collections.reverse(sourceHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
         hcbUploadSource.setPossibleItems(sourceHistory);
-        final CommentModelListener sourceModelListener = new CommentModelListener(hcbUploadSource, changesetSourceModel);
+        CommentModelListener sourceModelListener = new CommentModelListener(hcbUploadSource, changesetSourceModel);
         hcbUploadSource.getEditor().addActionListener(sourceModelListener);
         hcbUploadSource.getEditor().getEditorComponent().addFocusListener(sourceModelListener);
