Index: /trunk/src/org/openstreetmap/josm/command/ChangeCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/ChangeCommand.java	(revision 6364)
+++ /trunk/src/org/openstreetmap/josm/command/ChangeCommand.java	(revision 6365)
@@ -18,8 +18,7 @@
 
 /**
- * Command that basically replaces one OSM primitive by another of the
- * same type.
+ * Command that basically replaces one OSM primitive by another of the same type.
  *
- * @author Imi
+ * @since 93
  */
 public class ChangeCommand extends Command {
@@ -45,13 +44,12 @@
         CheckParameterUtil.ensureParameterNotNull(osm, "osm");
         CheckParameterUtil.ensureParameterNotNull(newOsm, "newOsm");
-        if (newOsm instanceof Way) {
+        if (newOsm instanceof Way && ((Way)newOsm).getNodesCount() == 0) {
             // Do not allow to create empty ways (see #7465)
-            if (((Way)newOsm).getNodesCount() == 0) {
-                throw new IllegalArgumentException(tr("New way {0} has 0 nodes", newOsm));
-            }
+            throw new IllegalArgumentException(tr("New way {0} has 0 nodes", newOsm));
         }
     }
 
-    @Override public boolean executeCommand() {
+    @Override
+    public boolean executeCommand() {
         super.executeCommand();
         osm.cloneFrom(newOsm);
@@ -60,5 +58,6 @@
     }
 
-    @Override public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) {
+    @Override
+    public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) {
         modified.add(osm);
     }
Index: /trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java	(revision 6364)
+++ /trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java	(revision 6365)
@@ -222,5 +222,5 @@
     }
     
-    private List<TileSource> getTileSources() {
+    private final List<TileSource> getTileSources() {
         List<TileSource> tileSources = new ArrayList<TileSource>();
         for (TileSourceProvider provider: providers) {
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRenderer.java	(revision 6364)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRenderer.java	(revision 6365)
@@ -24,5 +24,5 @@
 public class PropertiesCellRenderer extends DefaultTableCellRenderer {
 
-    private void setColors(Component c, String key, boolean isSelected, boolean hasFocus) {
+    private void setColors(Component c, String key, boolean isSelected) {
         UIDefaults defaults = javax.swing.UIManager.getDefaults();
         if (OsmPrimitive.getDiscardableKeys().contains(key)) {
@@ -71,5 +71,5 @@
                     }
                 }
-                setColors(c, key, isSelected, hasFocus);
+                setColors(c, key, isSelected);
             }
         }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 6364)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 6365)
@@ -1241,9 +1241,7 @@
     @Override
     public void preferenceChanged(PreferenceChangeEvent e) {
-        if ("display.discardable-keys".equals(e.getKey())) {
-            if (Main.main.getCurrentDataSet() != null) {
-                // Re-load data when display preference change
-                selectionChanged(Main.main.getCurrentDataSet().getSelected());
-            }
+        if ("display.discardable-keys".equals(e.getKey()) && Main.main.getCurrentDataSet() != null) {
+            // Re-load data when display preference change
+            selectionChanged(Main.main.getCurrentDataSet().getSelected());
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/download/BookmarkList.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/download/BookmarkList.java	(revision 6364)
+++ /trunk/src/org/openstreetmap/josm/gui/download/BookmarkList.java	(revision 6365)
@@ -34,5 +34,5 @@
 /**
  * List class that read and save its content from the bookmark file.
- * @author imi
+ * @since 6340
  */
 public class BookmarkList extends JList {
@@ -40,5 +40,4 @@
     /**
      * Class holding one bookmarkentry.
-     * @author imi
      */
     public static class Bookmark implements Comparable<Bookmark> {
@@ -46,4 +45,10 @@
         private Bounds area;
 
+        /**
+         * Constructs a new {@code Bookmark} with the given contents.
+         * @param list Bookmark contents as a list of 5 elements. First item is the name, then come bounds arguments (minlat, minlon, maxlat, maxlon)
+         * @throws NumberFormatException If the bounds arguments are not numbers
+         * @throws IllegalArgumentException If list contain less than 5 elements
+         */
         public Bookmark(Collection<String> list) throws NumberFormatException, IllegalArgumentException {
             List<String> array = new ArrayList<String>(list);
@@ -56,5 +61,5 @@
 
         /**
-         * Constructs a new {@code Bookmark}.
+         * Constructs a new empty {@code Bookmark}.
          */
         public Bookmark() {
@@ -63,4 +68,8 @@
         }
 
+        /**
+         * Constructs a new unamed {@code Bookmark} for the given area.
+         * @param area The bookmark area
+         */
         public Bookmark(Bounds area) {
             this.area = area;
@@ -75,17 +84,64 @@
             return name.toLowerCase().compareTo(b.name.toLowerCase());
         }
-
+        
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + ((area == null) ? 0 : area.hashCode());
+            result = prime * result + ((name == null) ? 0 : name.hashCode());
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (obj == null)
+                return false;
+            if (getClass() != obj.getClass())
+                return false;
+            Bookmark other = (Bookmark) obj;
+            if (area == null) {
+                if (other.area != null)
+                    return false;
+            } else if (!area.equals(other.area))
+                return false;
+            if (name == null) {
+                if (other.name != null)
+                    return false;
+            } else if (!name.equals(other.name))
+                return false;
+            return true;
+        }
+
+        /**
+         * Returns the bookmark area
+         * @return The bookmark area
+         */
         public Bounds getArea() {
             return area;
         }
 
+        /**
+         * Returns the bookmark name
+         * @return The bookmark name
+         */
         public String getName() {
             return name;
         }
 
+        /**
+         * Sets the bookmark name
+         * @param name The bookmark name
+         */
         public void setName(String name) {
             this.name = name;
         }
 
+        /**
+         * Sets the bookmark area
+         * @param area The bookmark area
+         */
         public void setArea(Bounds area) {
             this.area = area;
@@ -94,5 +150,5 @@
 
     /**
-     * Create a bookmark list as well as the Buttons add and remove.
+     * Creates a bookmark list as well as the Buttons add and remove.
      */
     public BookmarkList() {
@@ -106,5 +162,5 @@
      * Loads the bookmarks from file.
      */
-    public void load() {
+    public final void load() {
         DefaultListModel model = (DefaultListModel)getModel();
         model.removeAllElements();
@@ -161,8 +217,10 @@
                     save();
                     Main.info("Removing obsolete bookmarks file");
-                    bookmarkFile.delete();
+                    if (!bookmarkFile.delete()) {
+                        bookmarkFile.deleteOnExit();
+                    }
                 }
             } catch (IOException e) {
-                e.printStackTrace();
+                Main.error(e);
                 JOptionPane.showMessageDialog(
                         Main.parent,
@@ -179,5 +237,5 @@
 
     /**
-     * Save all bookmarks to the preferences file
+     * Saves all bookmarks to the preferences file
      */
     public void save() {
Index: /trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java	(revision 6364)
+++ /trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java	(revision 6365)
@@ -102,6 +102,8 @@
         buildMainPanelAboveDownloadSelections(pnl);
 
+        slippyMapChooser = new SlippyMapChooser();
+        
         // predefined download selections
-        downloadSelections.add(slippyMapChooser = new SlippyMapChooser());
+        downloadSelections.add(slippyMapChooser);
         downloadSelections.add(new BookmarkSelection());
         downloadSelections.add(new BoundingBoxSelection());
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java	(revision 6364)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java	(revision 6365)
@@ -51,5 +51,5 @@
         GridBagConstraints gc = new GridBagConstraints();
 
-        AuthenticationMethodChangeListener  authChangeListener = new AuthenticationMethodChangeListener();
+        AuthenticationMethodChangeListener authChangeListener = new AuthenticationMethodChangeListener();
 
         // -- radio button for basic authentication
@@ -83,5 +83,6 @@
         gc.weightx = 1.0;
         gc.weighty = 1.0;
-        add(pnlAuthenticationParameteters = new JPanel(), gc);
+        pnlAuthenticationParameteters = new JPanel();
+        add(pnlAuthenticationParameteters, gc);
         pnlAuthenticationParameteters.setLayout(new BorderLayout());
 
@@ -96,5 +97,6 @@
         gc.gridy = 2;
         gc.fill = GridBagConstraints.NONE;
-        add(pnlMessagesPreferences = new MessagesNotifierPanel(), gc);
+        pnlMessagesPreferences = new MessagesNotifierPanel();
+        add(pnlMessagesPreferences, gc);
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/server/MessagesNotifierPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/server/MessagesNotifierPanel.java	(revision 6364)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/server/MessagesNotifierPanel.java	(revision 6365)
@@ -67,5 +67,5 @@
      * Initializes the panel from preferences
      */
-    public void initFromPreferences() {
+    public final void initFromPreferences() {
         notifier.setSelected(MessageNotifier.PROP_NOTIFIER_ENABLED.get());
         notifierInterval.setText(Integer.toString(MessageNotifier.PROP_INTERVAL.get()));
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/JMultilineLabel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/JMultilineLabel.java	(revision 6364)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/JMultilineLabel.java	(revision 6365)
@@ -1,4 +1,3 @@
 // License: GPL. For details, see LICENSE file.
-
 package org.openstreetmap.josm.gui.widgets;
 
@@ -17,4 +16,6 @@
  * Note that this won't work if JMultilineLabel is put into a JScrollBox or
  * similar as the bounds will never change. Instead scrollbars will be displayed.
+ * 
+ * @since 6340
  */
 public class JMultilineLabel extends JLabel {
@@ -29,14 +30,13 @@
      *
      * Use setMaxWidth to limit the width of the label.
-     * @param text
+     * @param text The text to display
      */
-    public JMultilineLabel(String text)
-    {
+    public JMultilineLabel(String text) {
         super();
-        text = text.trim().replaceAll("\n", "<br>");
-        if(!text.startsWith("<html>")) {
-            text = "<html>" + text + "</html>";
+        String html = text.trim().replaceAll("\n", "<br>");
+        if (!html.startsWith("<html>")) {
+            html = "<html>" + html + "</html>";
         }
-        super.setText(text);
+        super.setText(html);
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/UrlLabel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/UrlLabel.java	(revision 6364)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/UrlLabel.java	(revision 6365)
@@ -1,3 +1,3 @@
-// License: GPL. Copyright 2007 by Immanuel Scholz and others
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui.widgets;
 
@@ -16,6 +16,5 @@
 /**
  * Label that contains a clickable link.
- * @author Imi
- * 5050: Simplifications by Zverikk included by akks
+ * @since 6340
  */
 public class UrlLabel extends JLabel implements MouseListener {
@@ -25,5 +24,5 @@
 
     /**
-     * Constructs a new {@code UrlLabel}.
+     * Constructs a new empty {@code UrlLabel}.
      */
     public UrlLabel() {
@@ -32,16 +31,36 @@
     }
 
+    /**
+     * Constructs a new {@code UrlLabel} for the given URL.
+     * @param url The URL to use, also used as description
+     */
     public UrlLabel(String url) {
         this (url, url, 0);
     }
 
+    /**
+     * Constructs a new {@code UrlLabel} for the given URL and font increase.
+     * @param url The URL to use, also used as description
+     * @param fontPlus The font increase in 1/72 of an inch units.
+     */
     public UrlLabel(String url, int fontPlus) {
         this (url, url, fontPlus);
     }
 
+    /**
+     * Constructs a new {@code UrlLabel} for the given URL and description.
+     * @param url The URL to use
+     * @param description The description to display 
+     */
     public UrlLabel(String url, String description) {
         this (url, description, 0);
     }
 
+    /**
+     * Constructs a new {@code UrlLabel} for the given URL, description and font increase.
+     * @param url The URL to use
+     * @param description The description to display 
+     * @param fontPlus The font increase in 1/72 of an inch units.
+     */
     public UrlLabel(String url, String description, int fontPlus) {
         this();
@@ -54,5 +73,5 @@
     }
 
-    protected void refresh() {
+    protected final void refresh() {
         if (url != null) {
             setText("<html><a href=\""+url+"\">"+description+"</a></html>");
@@ -72,5 +91,5 @@
      * @param url the url. Can be null.
      */
-    public void setUrl(String url) {
+    public final void setUrl(String url) {
         this.url = url;
         refresh();
@@ -82,5 +101,5 @@
      * @param description the description
      */
-    public void setDescription(String description) {
+    public final void setDescription(String description) {
         this.description = description == null? "" : description;
         this.description = this.description.replace("&", "&amp;").replace(">", "&gt;").replace("<", "&lt;");
@@ -90,18 +109,29 @@
     @Override
     public void mouseClicked(MouseEvent e) {
-        if( SwingUtilities.isLeftMouseButton(e) ) {
+        if (SwingUtilities.isLeftMouseButton(e)) {
             OpenBrowser.displayUrl(url);
-        } else if( SwingUtilities.isRightMouseButton(e) ) {
+        } else if (SwingUtilities.isRightMouseButton(e)) {
             Utils.copyToClipboard(url);
         }
     }
+    
     @Override
-    public void mousePressed(MouseEvent e) {    }
+    public void mousePressed(MouseEvent e) {
+        // Ignored
+    }
+    
     @Override
-    public void mouseEntered(MouseEvent e) {    }
+    public void mouseEntered(MouseEvent e) {
+        // Ignored
+    }
+    
     @Override
-    public void mouseExited(MouseEvent e) {    }
+    public void mouseExited(MouseEvent e) {
+        // Ignored
+    }
+    
     @Override
-    public void mouseReleased(MouseEvent e) {    }
-
+    public void mouseReleased(MouseEvent e) {
+        // Ignored
+    }
 }
Index: /trunk/src/org/openstreetmap/josm/io/MessageNotifier.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/MessageNotifier.java	(revision 6364)
+++ /trunk/src/org/openstreetmap/josm/io/MessageNotifier.java	(revision 6365)
@@ -46,7 +46,7 @@
     public static final IntegerProperty PROP_INTERVAL = new IntegerProperty("message.notifier.interval", 5);
     
-    private static final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
+    private static final ScheduledExecutorService EXECUTOR = Executors.newSingleThreadScheduledExecutor();
     
-    private static final Runnable worker = new Worker();
+    private static final Runnable WORKER = new Worker();
     
     private static ScheduledFuture<?> task = null;
@@ -89,5 +89,5 @@
         int interval = PROP_INTERVAL.get();
         if (!isRunning() && interval > 0 && isUserEnoughIdentified()) {
-            task = executor.scheduleAtFixedRate(worker, 0, interval * 60, TimeUnit.SECONDS);
+            task = EXECUTOR.scheduleAtFixedRate(WORKER, 0, interval * 60, TimeUnit.SECONDS);
             Main.info("Message notifier active (checks every "+interval+" minute"+(interval>1?"s":"")+")");
         }
Index: /trunk/src/org/openstreetmap/josm/io/OsmServerUserInfoReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmServerUserInfoReader.java	(revision 6364)
+++ /trunk/src/org/openstreetmap/josm/io/OsmServerUserInfoReader.java	(revision 6365)
@@ -121,5 +121,5 @@
                     userInfo.setUnreadMessages(Integer.parseInt(v));
                 } catch(NumberFormatException e) {
-                    throw new OsmDataParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", "unread", "received", v));
+                    throw new OsmDataParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", "unread", "received", v), e);
                 }
             }
Index: /trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java	(revision 6364)
+++ /trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java	(revision 6365)
@@ -11,15 +11,21 @@
 /**
  * This is the default authenticator used in JOSM. It delegates lookup of credentials
- * for the OSM API and an optional proxy server to the currently configured
- * {@link CredentialsManager}.
- *
+ * for the OSM API and an optional proxy server to the currently configured {@link CredentialsManager}.
+ * @since 2641
  */
 public final class DefaultAuthenticator extends Authenticator {
     private static DefaultAuthenticator instance;
 
+    /**
+     * Returns the unique instance
+     * @return The unique instance
+     */
     public static DefaultAuthenticator getInstance() {
         return instance;
     }
 
+    /**
+     * Creates the unique instance
+     */
     public static void createInstance() {
         instance = new DefaultAuthenticator();
@@ -33,16 +39,14 @@
 
     /**
-     * Called by the Java http stack when either the OSM API server or a proxy requires
-     * authentication.
-     *
+     * Called by the Java HTTP stack when either the OSM API server or a proxy requires authentication.
      */
-    @Override protected PasswordAuthentication getPasswordAuthentication() {
+    @Override
+    protected PasswordAuthentication getPasswordAuthentication() {
         if (!enabled)
             return null;
         try {
-            if (getRequestorType().equals(Authenticator.RequestorType.SERVER)) {
+            if (getRequestorType().equals(Authenticator.RequestorType.SERVER) && OsmApi.isUsingOAuth()) {
                 // if we are working with OAuth we don't prompt for a password
-                if (OsmApi.isUsingOAuth())
-                    return null;
+                return null;
             }
             boolean tried = credentialsTried.get(getRequestorType()) != null;
