Index: trunk/src/org/openstreetmap/josm/gui/io/TagSettingsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/TagSettingsPanel.java	(revision 9521)
+++ trunk/src/org/openstreetmap/josm/gui/io/TagSettingsPanel.java	(revision 9522)
@@ -19,4 +19,8 @@
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 
+/**
+ * Tag settings panel of upload dialog.
+ * @since 2599
+ */
 public class TagSettingsPanel extends JPanel implements TableModelListener {
 
@@ -26,9 +30,4 @@
     private final transient ChangesetCommentModel changesetCommentModel;
     private final transient ChangesetCommentModel changesetSourceModel;
-
-    protected void build() {
-        setLayout(new BorderLayout());
-        add(pnlTagEditor, BorderLayout.CENTER);
-    }
 
     /**
@@ -50,14 +49,16 @@
     }
 
+    protected void build() {
+        setLayout(new BorderLayout());
+        add(pnlTagEditor, BorderLayout.CENTER);
+    }
+
     protected void setProperty(String key, String value) {
-        if (value == null) {
-            value = "";
-        }
-        value = value.trim();
+        String val = (value == null ? "" : value).trim();
         String commentInTag = getTagEditorValue(key);
-        if (value.equals(commentInTag))
+        if (val.equals(commentInTag))
             return;
 
-        if (value.isEmpty()) {
+        if (val.isEmpty()) {
             pnlTagEditor.getModel().delete(key);
             return;
@@ -65,8 +66,8 @@
         TagModel tag = pnlTagEditor.getModel().get(key);
         if (tag == null) {
-            tag = new TagModel(key, value);
+            tag = new TagModel(key, val);
             pnlTagEditor.getModel().add(tag);
         } else {
-            pnlTagEditor.getModel().updateTagValue(tag, value);
+            pnlTagEditor.getModel().updateTagValue(tag, val);
         }
     }
@@ -74,6 +75,5 @@
     protected String getTagEditorValue(String key) {
         TagModel tag = pnlTagEditor.getModel().get(key);
-        if (tag == null) return null;
-        return tag.getValue();
+        return tag == null ? null : tag.getValue();
     }
 
@@ -110,6 +110,10 @@
     @Deprecated
     public void setDefaultTags(Map<String, String> tags) {
+        // Deprecated
     }
 
+    /**
+     * Initializes the panel for user input
+     */
     public void startUserInput() {
         pnlTagEditor.initAutoCompletion(Main.main.getEditLayer());
@@ -128,5 +132,4 @@
      * Observes the changeset comment model and keeps the tag editor in sync
      * with the current changeset comment
-     *
      */
     class ChangesetCommentObserver implements Observer {
@@ -140,12 +143,13 @@
         @Override
         public void update(Observable o, Object arg) {
-            if (!(o instanceof ChangesetCommentModel)) return;
-            String newValue = (String) arg;
-            String oldValue = getTagEditorValue(key);
-            if (oldValue == null) {
-                oldValue = "";
-            }
-            if (!oldValue.equals(newValue)) {
-                setProperty(key, (String) arg);
+            if (o instanceof ChangesetCommentModel) {
+                String newValue = (String) arg;
+                String oldValue = getTagEditorValue(key);
+                if (oldValue == null) {
+                    oldValue = "";
+                }
+                if (!oldValue.equals(newValue)) {
+                    setProperty(key, (String) arg);
+                }
             }
         }
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java	(revision 9521)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java	(revision 9522)
@@ -65,23 +65,12 @@
  */
 public class UploadDialog extends AbstractUploadDialog implements PropertyChangeListener, PreferenceChangedListener {
-    /**  the unique instance of the upload dialog */
+    /** the unique instance of the upload dialog */
     private static UploadDialog uploadDialog;
 
-    /**
-     * List of custom components that can be added by plugins at JOSM startup.
-     */
+    /** list of custom components that can be added by plugins at JOSM startup */
     private static final Collection<Component> customComponents = new ArrayList<>();
 
-    /**
-     * Replies the unique instance of the upload dialog
-     *
-     * @return the unique instance of the upload dialog
-     */
-    public static synchronized UploadDialog getUploadDialog() {
-        if (uploadDialog == null) {
-            uploadDialog = new UploadDialog();
-        }
-        return uploadDialog;
-    }
+    /** the "created_by" changeset OSM key */
+    private static final String CREATED_BY = "created_by";
 
     /** the panel with the objects to upload */
@@ -108,4 +97,24 @@
 
     /**
+     * Constructs a new {@code UploadDialog}.
+     */
+    public UploadDialog() {
+        super(JOptionPane.getFrameForComponent(Main.parent), ModalityType.DOCUMENT_MODAL);
+        build();
+    }
+
+    /**
+     * Replies the unique instance of the upload dialog
+     *
+     * @return the unique instance of the upload dialog
+     */
+    public static synchronized UploadDialog getUploadDialog() {
+        if (uploadDialog == null) {
+            uploadDialog = new UploadDialog();
+        }
+        return uploadDialog;
+    }
+
+    /**
      * builds the content panel for the upload dialog
      *
@@ -117,6 +126,6 @@
 
         // the panel with the list of uploaded objects
-        //
-        pnl.add(pnlUploadedObjects = new UploadedObjectsSummaryPanel(), GBC.eol().fill(GBC.BOTH));
+        pnlUploadedObjects = new UploadedObjectsSummaryPanel();
+        pnl.add(pnlUploadedObjects, GBC.eol().fill(GBC.BOTH));
 
         // Custom components
@@ -126,27 +135,29 @@
 
         // a tabbed pane with configuration panels in the lower half
-        //
         tpConfigPanels = new JTabbedPane() {
             @Override
             public Dimension getPreferredSize() {
                 // make sure the tabbed pane never grabs more space than necessary
-                //
                 return super.getMinimumSize();
             }
         };
 
-        tpConfigPanels.add(pnlBasicUploadSettings = new BasicUploadSettingsPanel(changesetCommentModel, changesetSourceModel));
+        pnlBasicUploadSettings = new BasicUploadSettingsPanel(changesetCommentModel, changesetSourceModel);
+        tpConfigPanels.add(pnlBasicUploadSettings);
         tpConfigPanels.setTitleAt(0, tr("Settings"));
         tpConfigPanels.setToolTipTextAt(0, tr("Decide how to upload the data and which changeset to use"));
 
-        tpConfigPanels.add(pnlTagSettings = new TagSettingsPanel(changesetCommentModel, changesetSourceModel));
+        pnlTagSettings = new TagSettingsPanel(changesetCommentModel, changesetSourceModel);
+        tpConfigPanels.add(pnlTagSettings);
         tpConfigPanels.setTitleAt(1, tr("Tags of new changeset"));
         tpConfigPanels.setToolTipTextAt(1, tr("Apply tags to the changeset data is uploaded to"));
 
-        tpConfigPanels.add(pnlChangesetManagement = new ChangesetManagementPanel(changesetCommentModel));
+        pnlChangesetManagement = new ChangesetManagementPanel(changesetCommentModel);
+        tpConfigPanels.add(pnlChangesetManagement);
         tpConfigPanels.setTitleAt(2, tr("Changesets"));
         tpConfigPanels.setToolTipTextAt(2, tr("Manage open changesets and select a changeset to upload to"));
 
-        tpConfigPanels.add(pnlUploadStrategySelectionPanel = new UploadStrategySelectionPanel());
+        pnlUploadStrategySelectionPanel = new UploadStrategySelectionPanel();
+        tpConfigPanels.add(pnlUploadStrategySelectionPanel);
         tpConfigPanels.setTitleAt(3, tr("Advanced"));
         tpConfigPanels.setToolTipTextAt(3, tr("Configure advanced settings"));
@@ -167,6 +178,6 @@
 
         // -- upload button
-        UploadAction uploadAction = new UploadAction();
-        pnl.add(btnUpload = new SideButton(uploadAction));
+        btnUpload = new SideButton(new UploadAction());
+        pnl.add(btnUpload);
         btnUpload.setFocusable(true);
         InputMapUtils.enableEnter(btnUpload);
@@ -247,12 +258,4 @@
 
     /**
-     * constructor
-     */
-    public UploadDialog() {
-        super(JOptionPane.getFrameForComponent(Main.parent), ModalityType.DOCUMENT_MODAL);
-        build();
-    }
-
-    /**
      * Sets the collection of primitives to upload
      *
@@ -288,5 +291,5 @@
         final Map<String, String> tags = new HashMap<>();
 
-        // obtain from previos input
+        // obtain from previous input
         tags.put("source", getLastChangesetSourceFromHistory());
         tags.put("comment", getLastChangesetCommentFromHistory());
@@ -305,9 +308,9 @@
         // set/adapt created_by
         final String agent = Version.getInstance().getAgentString(false);
-        final String created_by = tags.get("created_by");
-        if (created_by == null || created_by.isEmpty()) {
-            tags.put("created_by", agent);
-        } else if (!created_by.contains(agent)) {
-            tags.put("created_by", created_by + ';' + agent);
+        final String createdBy = tags.get(CREATED_BY);
+        if (createdBy == null || createdBy.isEmpty()) {
+            tags.put(CREATED_BY, agent);
+        } else if (!createdBy.contains(agent)) {
+            tags.put(CREATED_BY, createdBy + ';' + agent);
         }
 
@@ -359,8 +362,18 @@
     }
 
+    /**
+     * Sets the changeset to be used in the next upload
+     *
+     * @param cs the changeset
+     */
     public void setSelectedChangesetForNextUpload(Changeset cs) {
         pnlChangesetManagement.setSelectedChangesetForNextUpload(cs);
     }
 
+    /**
+     * @deprecated No longer supported, does nothing;
+     * @return empty map
+     */
+    @Deprecated
     public Map<String, String> getDefaultChangesetTags() {
         return pnlTagSettings.getDefaultTags();
@@ -368,8 +381,10 @@
 
     /**
+     * @param tags ignored
      * @deprecated No longer supported, does nothing; use {@link #setChangesetTags(DataSet)} instead!
      */
     @Deprecated
     public void setDefaultChangesetTags(Map<String, String> tags) {
+        // Deprecated
     }
 
@@ -545,10 +560,9 @@
 
             UploadStrategySpecification strategy = getUploadStrategySpecification();
-            if (strategy.getStrategy().equals(UploadStrategy.CHUNKED_DATASET_STRATEGY)) {
-                if (strategy.getChunkSize() == UploadStrategySpecification.UNSPECIFIED_CHUNK_SIZE) {
-                    warnIllegalChunkSize();
-                    tpConfigPanels.setSelectedIndex(0);
-                    return;
-                }
+            if (strategy.getStrategy().equals(UploadStrategy.CHUNKED_DATASET_STRATEGY)
+                    && strategy.getChunkSize() == UploadStrategySpecification.UNSPECIFIED_CHUNK_SIZE) {
+                warnIllegalChunkSize();
+                tpConfigPanels.setSelectedIndex(0);
+                return;
             }
             setCanceled(false);
@@ -637,8 +651,16 @@
     }
 
+    /**
+     * Returns the last changeset comment from history.
+     * @return the last changeset comment from history
+     */
     public String getLastChangesetCommentFromHistory() {
         return getLastChangesetTagFromHistory(BasicUploadSettingsPanel.HISTORY_KEY, new ArrayList<String>());
     }
 
+    /**
+     * Returns the last changeset source from history.
+     * @return the last changeset source from history
+     */
     public String getLastChangesetSourceFromHistory() {
         return getLastChangesetTagFromHistory(BasicUploadSettingsPanel.SOURCE_HISTORY_KEY, BasicUploadSettingsPanel.getDefaultSources());
