Index: trunk/src/org/openstreetmap/josm/data/validation/util/Entities.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/util/Entities.java	(revision 10136)
+++ trunk/src/org/openstreetmap/josm/data/validation/util/Entities.java	(revision 10137)
@@ -30,4 +30,5 @@
  * @see <a href="http://www.w3.org/TR/html401/charset.html#h-5.3">HTML 4.01 Character References</a>
  * @see <a href="http://www.w3.org/TR/html401/charset.html#code-position">HTML 4.01 Code positions</a>
+ * @since 3669
  */
 public final class Entities {
@@ -340,4 +341,9 @@
     }
 
+    /**
+     * Returns unescaped entity representation.
+     * @param str entity
+     * @return unescaped entity representation
+     */
     public static String unescape(String str) {
         int firstAmp = str.indexOf('&');
@@ -357,5 +363,5 @@
                 int amphersandIdx = str.indexOf('&', i + 1);
                 if (amphersandIdx != -1 && amphersandIdx < semiColonIdx) {
-                    // Then the text looks like &...&...;
+                    // Then the text looks like "&...&...;"
                     res.append(c);
                     continue;
@@ -365,6 +371,5 @@
                 int entityContentLen = entityContent.length();
                 if (entityContentLen > 0) {
-                    if (entityContent.charAt(0) == '#') { // escaped value content is an integer (decimal or
-                        // hexidecimal)
+                    if (entityContent.charAt(0) == '#') { // escaped value content is an integer (decimal or hexidecimal)
                         if (entityContentLen > 1) {
                             char isHexChar = entityContent.charAt(1);
Index: trunk/src/org/openstreetmap/josm/data/validation/util/MultipleNameVisitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/util/MultipleNameVisitor.java	(revision 10136)
+++ trunk/src/org/openstreetmap/josm/data/validation/util/MultipleNameVisitor.java	(revision 10137)
@@ -19,4 +19,7 @@
 public class MultipleNameVisitor extends NameVisitor {
 
+    /**
+     * Maximum displayed length, in characters.
+     */
     public static final int MULTIPLE_NAME_MAX_LENGTH = 80;
 
Index: trunk/src/org/openstreetmap/josm/data/validation/util/NameVisitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/util/NameVisitor.java	(revision 10136)
+++ trunk/src/org/openstreetmap/josm/data/validation/util/NameVisitor.java	(revision 10137)
@@ -19,6 +19,4 @@
  * @author imi
  */
-//TODO This class used to be in JOSM but it was removed. MultipleNameVisitor depends on it so I copied it here,
-// but MultipleNameVisitor should be refactored instead of using this class
 public class NameVisitor extends AbstractVisitor {
 
@@ -27,9 +25,15 @@
      */
     public String className;
+
+    /**
+     * The plural name of the item class
+     */
     public String classNamePlural;
+
     /**
      * The name of this item.
      */
     public String name = "";
+
     /**
      * The icon of this item.
@@ -38,6 +42,5 @@
 
     /**
-     * If the node has a name-key or id-key, this is displayed. If not, (lat,lon)
-     * is displayed.
+     * If the node has a name-key or id-key, this is displayed. If not, (lat,lon) is displayed.
      */
     @Override
@@ -69,4 +72,8 @@
     }
 
+    /**
+     * Returns an horizontal {@code JLabel} with icon and name.
+     * @return horizontal {@code JLabel} with icon and name
+     */
     public JLabel toLabel() {
         return new JLabel(name, icon, JLabel.HORIZONTAL);
Index: trunk/src/org/openstreetmap/josm/gui/help/HelpContentReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/HelpContentReader.java	(revision 10136)
+++ trunk/src/org/openstreetmap/josm/gui/help/HelpContentReader.java	(revision 10137)
@@ -51,11 +51,7 @@
             }
         } catch (MalformedURLException e) {
-            throw new HelpContentReaderException(e);
+            throw new HelpContentReaderException(e, 0);
         } catch (IOException e) {
-            HelpContentReaderException ex = new HelpContentReaderException(e);
-            if (con != null) {
-                ex.setResponseCode(con.getResponseCode());
-            }
-            throw ex;
+            throw new HelpContentReaderException(e, con != null ? con.getResponseCode() : 0);
         }
     }
@@ -81,5 +77,5 @@
             s = readFromTrac(in, url);
         } catch (IOException e) {
-            throw new HelpContentReaderException(e);
+            throw new HelpContentReaderException(e, 0);
         }
         if (dotest && s.isEmpty())
Index: trunk/src/org/openstreetmap/josm/gui/help/HelpContentReaderException.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/HelpContentReaderException.java	(revision 10136)
+++ trunk/src/org/openstreetmap/josm/gui/help/HelpContentReaderException.java	(revision 10137)
@@ -2,13 +2,20 @@
 package org.openstreetmap.josm.gui.help;
 
+/**
+ * Exception thrown when a problem occurs during help contents fetching.
+ * @since 2308
+ */
 public class HelpContentReaderException extends Exception {
-    private int responseCode;
+
+    private final int responseCode;
 
     /**
      * Constructs a new {@code HelpContentReaderException}.
      * @param message the detail message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
+     * @param responseCode HTTP response code related to the wiki access exception (0 if not applicable)
      */
-    public HelpContentReaderException(String message) {
+    public HelpContentReaderException(String message, int responseCode) {
         super(message);
+        this.responseCode = responseCode;
     }
 
@@ -17,7 +24,9 @@
      * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
      *        (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.)
+     * @param responseCode HTTP response code related to the wiki access exception (0 if not applicable)
      */
-    public HelpContentReaderException(Throwable cause) {
+    public HelpContentReaderException(Throwable cause, int responseCode) {
         super(cause);
+        this.responseCode = responseCode;
     }
 
@@ -28,15 +37,6 @@
      * @return the http response code
      */
-    public int getResponseCode() {
+    public final int getResponseCode() {
         return responseCode;
     }
-
-    /**
-     * Sets the HTTP response code
-     *
-     * @param responseCode the response code
-     */
-    public void setResponseCode(int responseCode) {
-        this.responseCode = responseCode;
-    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/help/Helpful.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/Helpful.java	(revision 10136)
+++ trunk/src/org/openstreetmap/josm/gui/help/Helpful.java	(revision 10137)
@@ -2,5 +2,14 @@
 package org.openstreetmap.josm.gui.help;
 
+/**
+ * Anything on which we can provide help.
+ * @since 2252
+ */
 public interface Helpful {
+
+    /**
+     * Returns the help topic on JOSM wiki for this feature.
+     * @return the help topic on JOSM wiki for this feature
+     */
     String helpTopic();
 }
Index: trunk/src/org/openstreetmap/josm/gui/help/MissingHelpContentException.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/MissingHelpContentException.java	(revision 10136)
+++ trunk/src/org/openstreetmap/josm/gui/help/MissingHelpContentException.java	(revision 10137)
@@ -13,5 +13,5 @@
      */
     public MissingHelpContentException(String message) {
-        super(message);
+        super(message, 0);
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java	(revision 10136)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java	(revision 10137)
@@ -70,5 +70,6 @@
 
     protected String formatPluginLocalVersion(PluginInformation pi) {
-        if (pi == null) return tr("unknown");
+        if (pi == null)
+            return tr("unknown");
         if (pi.localversion == null || pi.localversion.trim().isEmpty())
             return tr("unknown");
@@ -77,5 +78,6 @@
 
     protected String formatCheckboxTooltipText(PluginInformation pi) {
-        if (pi == null) return "";
+        if (pi == null)
+            return "";
         if (pi.downloadlink == null)
             return tr("Plugin bundled with JOSM");
@@ -107,8 +109,7 @@
     /**
      * A plugin checkbox.
-     *
      */
     private class JPluginCheckBox extends JCheckBox {
-        public final transient PluginInformation pi;
+        protected final transient PluginInformation pi;
 
         JPluginCheckBox(final PluginInformation pi, boolean selected) {
@@ -122,5 +123,4 @@
     /**
      * Listener called when the user selects/unselects a plugin checkbox.
-     *
      */
     private class PluginCbActionListener implements ActionListener {
@@ -172,5 +172,4 @@
     }
 
-
     /**
      * Alerts the user if an unselected plugin is still required by another plugins
@@ -181,6 +180,5 @@
      */
     private static void alertPluginStillRequired(Component parent, String plugin, Set<String> otherPlugins) {
-        StringBuilder sb = new StringBuilder();
-        sb.append("<html>")
+        StringBuilder sb = new StringBuilder("<html>")
           .append(trn("Plugin {0} is still required by this plugin:",
                 "Plugin {0} is still required by these {1} plugins:",
Index: trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java	(revision 10136)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java	(revision 10137)
@@ -270,6 +270,5 @@
         if (answer != 0 /* OK */)
             return;
-        List<String> sites = pnl.getUpdateSites();
-        Main.pref.setPluginSites(sites);
+        Main.pref.setPluginSites(pnl.getUpdateSites());
     }
 
@@ -497,9 +496,8 @@
 
     /**
-     * Applies the current filter condition in the filter text field to the
-     * model
+     * Applies the current filter condition in the filter text field to the model.
      */
     class SearchFieldAdapter implements DocumentListener {
-        public void filter() {
+        private void filter() {
             String expr = tfFilter.getText().trim();
             if (expr.isEmpty()) {
@@ -597,5 +595,5 @@
         }
 
-        public List<String> getUpdateSites() {
+        protected List<String> getUpdateSites() {
             if (model.getSize() == 0)
                 return Collections.emptyList();
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java	(revision 10136)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java	(revision 10137)
@@ -43,5 +43,5 @@
  *
  * For initial authorisation see {@link OAuthAuthorizationWizard}.
- *
+ * @since 2745
  */
 public class OAuthAuthenticationPreferencesPanel extends JPanel implements PropertyChangeListener {
@@ -53,4 +53,12 @@
     private JCheckBox cbShowAdvancedParameters;
     private JCheckBox cbSaveToPreferences;
+
+    /**
+     * Create the panel
+     */
+    public OAuthAuthenticationPreferencesPanel() {
+        build();
+        refreshView();
+    }
 
     /**
@@ -140,12 +148,4 @@
 
     /**
-     * Create the panel
-     */
-    public OAuthAuthenticationPreferencesPanel() {
-        build();
-        refreshView();
-    }
-
-    /**
      * Sets the URL of the OSM API for which this panel is currently displaying OAuth properties.
      *
@@ -224,4 +224,12 @@
         private JosmTextField tfAccessTokenSecret;
 
+        /**
+         * Constructs a new {@code AlreadyAuthorisedPanel}.
+         */
+        AlreadyAuthorisedPanel() {
+            build();
+            refreshView();
+        }
+
         protected void build() {
             setLayout(new GridBagLayout());
@@ -291,8 +299,7 @@
             gc.weighty = 1.0;
             add(new JPanel(), gc);
-
-        }
-
-        public final void refreshView() {
+        }
+
+        protected final void refreshView() {
             String v = OAuthAccessTokenHolder.getInstance().getAccessTokenKey();
             tfAccessTokenKey.setText(v == null ? "" : v);
@@ -300,12 +307,4 @@
             tfAccessTokenSecret.setText(v == null ? "" : v);
             cbSaveToPreferences.setSelected(OAuthAccessTokenHolder.getInstance().isSaveToPreferences());
-        }
-
-        /**
-         * Constructs a new {@code AlreadyAuthorisedPanel}.
-         */
-        AlreadyAuthorisedPanel() {
-            build();
-            refreshView();
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java	(revision 10136)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java	(revision 10137)
@@ -61,4 +61,12 @@
     private transient ApiUrlPropagator propagator;
 
+    /**
+     * Constructs a new {@code OsmApiUrlInputPanel}.
+     */
+    public OsmApiUrlInputPanel() {
+        build();
+        HelpUtil.setHelpContext(this, HelpUtil.ht("/Preferences/Connection#ApiUrl"));
+    }
+
     protected JComponent buildDefaultServerUrlPanel() {
         cbUseDefaultServerUrl = new JCheckBox(tr("<html>Use the default OSM server URL (<strong>{0}</strong>)</html>", OsmApi.DEFAULT_API_URL));
@@ -109,12 +117,4 @@
         tfOsmServerUrl.getEditorComponent().getDocument().addDocumentListener(actTest);
         add(btnTest = new SideButton(actTest), gc);
-    }
-
-    /**
-     * Constructs a new {@code OsmApiUrlInputPanel}.
-     */
-    public OsmApiUrlInputPanel() {
-        build();
-        HelpUtil.setHelpContext(this, HelpUtil.ht("/Preferences/Connection#ApiUrl"));
     }
 
@@ -152,6 +152,5 @@
         String newUrl = OsmApi.getOsmApi().getServerUrl();
 
-        // When API URL changes, re-initialize API connection so we may adjust
-        // server-dependent settings.
+        // When API URL changes, re-initialize API connection so we may adjust server-dependent settings.
         if (!oldUrl.equals(newUrl)) {
             try {
@@ -303,9 +302,9 @@
 
     class ApiUrlPropagator extends FocusAdapter implements ActionListener {
-        public void propagate() {
+        protected void propagate() {
             propagate(getStrippedApiUrl());
         }
 
-        public void propagate(String url) {
+        protected void propagate(String url) {
             firePropertyChange(API_URL_PROP, null, url);
         }
Index: trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionItemPriority.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionItemPriority.java	(revision 10136)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionItemPriority.java	(revision 10137)
@@ -7,4 +7,5 @@
  *
  * Instances of this class are not modifiable.
+ * @since 1762
  */
 public class AutoCompletionItemPriority implements Comparable<AutoCompletionItemPriority> {
@@ -44,10 +45,9 @@
     private final boolean selected;
 
-
     /**
-     * Create new AutoCompletionItemPriority object.
+     * Constructs a new {@code AutoCompletionItemPriority}.
      *
      * @param inDataSet true, if the item is found in the currently active data layer
-     * @param inStandard true, if the item is a standard tag, e.g. from the presets.
+     * @param inStandard true, if the item is a standard tag, e.g. from the presets
      * @param selected true, if it is found on an object that is currently selected
      * @param userInput null, if the user hasn't entered this tag so far. A number when
@@ -62,20 +62,45 @@
     }
 
+    /**
+     * Constructs a new {@code AutoCompletionItemPriority}.
+     *
+     * @param inDataSet true, if the item is found in the currently active data layer
+     * @param inStandard true, if the item is a standard tag, e.g. from the presets
+     * @param selected true, if it is found on an object that is currently selected
+     */
     public AutoCompletionItemPriority(boolean inDataSet, boolean inStandard, boolean selected) {
         this(inDataSet, inStandard, selected, NO_USER_INPUT);
     }
 
+    /**
+     * Determines if the item is found in the currently active data layer.
+     * @return {@code true} if the item is found in the currently active data layer
+     */
     public boolean isInDataSet() {
         return inDataSet;
     }
 
+    /**
+     * Determines if the item is a standard tag, e.g. from the presets.
+     * @return {@code true} if the item is a standard tag, e.g. from the presets
+     */
     public boolean isInStandard() {
         return inStandard;
     }
 
+    /**
+     * Determines if it is found on an object that is currently selected.
+     * @return {@code true} if it is found on an object that is currently selected
+     */
     public boolean isSelected() {
         return selected;
     }
 
+    /**
+     * Returns a number when the tag key / value has been entered by the user before.
+     * A lower number means this happened more recently and beats a higher number in priority.
+     * @return a number when the tag key / value has been entered by the user before.
+     *         {@code null}, if the user hasn't entered this tag so far.
+     */
     public Integer getUserInput() {
         return userInput == NO_USER_INPUT ? null : userInput;
@@ -89,14 +114,18 @@
     public int compareTo(AutoCompletionItemPriority other) {
         int ui = Integer.compare(other.userInput, userInput);
-        if (ui != 0) return ui;
+        if (ui != 0)
+            return ui;
 
         int sel = Boolean.valueOf(selected).compareTo(other.selected);
-        if (sel != 0) return sel;
+        if (sel != 0)
+            return sel;
 
         int ds = Boolean.valueOf(inDataSet).compareTo(other.inDataSet);
-        if (ds != 0) return ds;
+        if (ds != 0)
+            return ds;
 
         int std = Boolean.valueOf(inStandard).compareTo(other.inStandard);
-        if (std != 0) return std;
+        if (std != 0)
+            return std;
 
         return 0;
Index: trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java	(revision 10136)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java	(revision 10137)
@@ -28,5 +28,5 @@
  * AutoCompletionList is an {@link AbstractTableModel} which serves the list of filtered
  * items to a {@link JTable}.
- *
+ * @since 1762
  */
 public class AutoCompletionList extends AbstractTableModel {
@@ -67,5 +67,4 @@
     /**
      * clears the current filter
-     *
      */
     public void clearFilter() {
@@ -135,6 +134,7 @@
      */
     public void add(Collection<String> values, AutoCompletionItemPriority priority) {
-        if (values == null) return;
-        for (String value: values) {
+        if (values == null)
+            return;
+        for (String value : values) {
             if (value == null) {
                 continue;
@@ -148,14 +148,17 @@
     }
 
+    /**
+     * Adds values that have been entered by the user.
+     * @param values values that have been entered by the user
+     */
     public void addUserInput(Collection<String> values) {
-        if (values == null) return;
+        if (values == null)
+            return;
         int i = 0;
-        for (String value: values) {
-            if (value == null) {
-                continue;
-            }
-            AutoCompletionListItem item = new AutoCompletionListItem(value, new AutoCompletionItemPriority(false, false, false, i));
-            appendOrUpdatePriority(item);
-            i++;
+        for (String value : values) {
+            if (value != null) {
+                appendOrUpdatePriority(
+                        new AutoCompletionListItem(value, new AutoCompletionItemPriority(false, false, false, i++)));
+            }
         }
         sort();
