Index: trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java	(revision 10226)
+++ trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java	(revision 10228)
@@ -274,5 +274,5 @@
                     public void run() {
                         if (items.size() == 1 && tr("No data found in this area.").equals(items.iterator().next())) {
-                            new Notification(items.iterator().next().toString()).setIcon(JOptionPane.WARNING_MESSAGE).show();
+                            new Notification(items.iterator().next()).setIcon(JOptionPane.WARNING_MESSAGE).show();
                         } else {
                             JOptionPane.showMessageDialog(Main.parent, "<html>"
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 10226)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 10228)
@@ -896,6 +896,6 @@
 
     /**
-     * if one of the ends of {@code way} is given {@code  node},
-     * then set  currentBaseNode = node and previousNode = adjacent node of way
+     * if one of the ends of {@code way} is given {@code node},
+     * then set currentBaseNode = node and previousNode = adjacent node of way
      * @param way way to continue
      * @param node starting node
@@ -1692,21 +1692,4 @@
         }
 
-        private void nextSnapMode() {
-            if (snapOn) {
-                // turn off snapping if we are in fixed mode or no actile snapping line exist
-                if (fixed || !active) {
-                    snapOn = false;
-                    unsetFixedMode();
-                } else {
-                    setFixedMode();
-                }
-            } else {
-                snapOn = true;
-                unsetFixedMode();
-            }
-            checkBox.setState(snapOn);
-            customBaseHeading = -1;
-        }
-
         private void enableSnapping() {
             snapOn = true;
@@ -1729,5 +1712,5 @@
         }
 
-        public  void unsetFixedMode() {
+        public void unsetFixedMode() {
             fixed = false;
             absoluteFix = false;
@@ -1736,9 +1719,9 @@
         }
 
-        public  boolean isActive() {
+        public boolean isActive() {
             return active;
         }
 
-        public  boolean isSnapOn() {
+        public boolean isSnapOn() {
             return snapOn;
         }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java	(revision 10226)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java	(revision 10228)
@@ -50,21 +50,22 @@
     protected static final String ASSOCIATED_STREET  = "associatedStreet";
 
-    protected class AddressError extends TestError {
-
-        public AddressError(int code, OsmPrimitive p, String message) {
-            this(code, Collections.singleton(p), message);
-        }
-
-        public AddressError(int code, Collection<OsmPrimitive> collection, String message) {
-            this(code, collection, message, null, null);
-        }
-
-        public AddressError(int code, Collection<OsmPrimitive> collection, String message, String description, String englishDescription) {
-            this(code, Severity.WARNING, collection, message, description, englishDescription);
-        }
-
-        public AddressError(int code, Severity severity, Collection<OsmPrimitive> collection, String message, String description,
-                String englishDescription) {
-            super(Addresses.this, severity, message, description, englishDescription, code, collection);
+    protected static class AddressError extends TestError {
+
+        public AddressError(Addresses tester, int code, OsmPrimitive p, String message) {
+            this(tester, code, Collections.singleton(p), message);
+        }
+
+        public AddressError(Addresses tester, int code, Collection<OsmPrimitive> collection, String message) {
+            this(tester, code, collection, message, null, null);
+        }
+
+        public AddressError(Addresses tester, int code, Collection<OsmPrimitive> collection, String message,
+                String description, String englishDescription) {
+            this(tester, code, Severity.WARNING, collection, message, description, englishDescription);
+        }
+
+        public AddressError(Addresses tester, int code, Severity severity, Collection<OsmPrimitive> collection, String message,
+                String description, String englishDescription) {
+            super(tester, severity, message, description, englishDescription, code, collection);
         }
     }
@@ -101,5 +102,5 @@
             List<OsmPrimitive> errorList = new ArrayList<OsmPrimitive>(list);
             errorList.add(0, p);
-            errors.add(new AddressError(MULTIPLE_STREET_RELATIONS, level, errorList,
+            errors.add(new AddressError(this, MULTIPLE_STREET_RELATIONS, level, errorList,
                     tr("Multiple associatedStreet relations"), null, null));
         }
@@ -122,5 +123,5 @@
             }
             // No street found
-            errors.add(new AddressError(HOUSE_NUMBER_WITHOUT_STREET, p, tr("House number without street")));
+            errors.add(new AddressError(this, HOUSE_NUMBER_WITHOUT_STREET, p, tr("House number without street")));
         }
     }
@@ -186,5 +187,5 @@
                 List<OsmPrimitive> list = entry.getValue();
                 if (list.size() > 1) {
-                    errors.add(new AddressError(DUPLICATE_HOUSE_NUMBER, list,
+                    errors.add(new AddressError(this, DUPLICATE_HOUSE_NUMBER, list,
                             tr("Duplicate house numbers"), tr(englishDescription, entry.getKey()), englishDescription));
                 }
@@ -192,5 +193,5 @@
             // Report wrong street names
             if (!wrongStreetNames.isEmpty()) {
-                errors.add(new AddressError(MULTIPLE_STREET_NAMES, wrongStreetNames,
+                errors.add(new AddressError(this, MULTIPLE_STREET_NAMES, wrongStreetNames,
                         tr("Multiple street names in relation")));
             }
@@ -248,5 +249,5 @@
         List<OsmPrimitive> errorList = new ArrayList<OsmPrimitive>(street);
         errorList.add(0, house);
-        errors.add(new AddressError(HOUSE_NUMBER_TOO_FAR, errorList,
+        errors.add(new AddressError(this, HOUSE_NUMBER_TOO_FAR, errorList,
                 tr("House number too far from street")));
     }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/Highways.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/Highways.java	(revision 10226)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/Highways.java	(revision 10228)
@@ -75,10 +75,10 @@
     }
 
-    protected class WrongRoundaboutHighway extends TestError {
+    protected static class WrongRoundaboutHighway extends TestError {
 
         public final String correctValue;
 
-        public WrongRoundaboutHighway(Way w, String key) {
-            super(Highways.this, Severity.WARNING,
+        public WrongRoundaboutHighway(Highways tester, Way w, String key) {
+            super(tester, Severity.WARNING,
                     tr("Incorrect roundabout (highway: {0} instead of {1})", w.get("highway"), key),
                     WRONG_ROUNDABOUT_HIGHWAY, w);
@@ -146,5 +146,5 @@
                     // Error when the highway tags do not match
                     if (!w.get("highway").equals(s)) {
-                        errors.add(new WrongRoundaboutHighway(w, s));
+                        errors.add(new WrongRoundaboutHighway(this, w, s));
                     }
                     break;
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java	(revision 10226)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java	(revision 10228)
@@ -70,5 +70,5 @@
                         if (!isPowerAllowed(n) && IN_DOWNLOADED_AREA.evaluate(n)) {
                             if (!w.isFirstLastNode(n) || !isPowerStation(n)) {
-                                potentialErrors.add(new PowerLineError(n, w));
+                                potentialErrors.add(new PowerLineError(this, n, w));
                                 erroneous = true;
                             }
@@ -209,6 +209,6 @@
         private final Way line;
 
-        public PowerLineError(Node n, Way line) {
-            super(PowerLines.this, Severity.WARNING,
+        public PowerLineError(PowerLines tester, Node n, Way line) {
+            super(tester, Severity.WARNING,
                     tr("Missing power tower/pole within power line"), POWER_LINES, n);
             this.line = line;
Index: trunk/src/org/openstreetmap/josm/gui/MainMenu.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainMenu.java	(revision 10226)
+++ trunk/src/org/openstreetmap/josm/gui/MainMenu.java	(revision 10228)
@@ -824,15 +824,4 @@
     }
 
-    private int getMaximumAvailableWidth() {
-        int maxWidth = getSize().width;
-        for (int i = 0; i < getMenuCount(); i++) {
-            JMenu menu = getMenu(i);
-            if (menu != null) {
-                maxWidth -= menu.getPreferredSize().width;
-            }
-        }
-        return maxWidth;
-    }
-
     /**
      * Search main menu for items with {@code textToFind} in title.
Index: trunk/src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 10226)
+++ trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 10228)
@@ -93,5 +93,5 @@
  * @author imi
  */
-public class MapStatus extends JPanel implements Helpful, Destroyable, PreferenceChangedListener, SoMChangeListener {
+public final class MapStatus extends JPanel implements Helpful, Destroyable, PreferenceChangedListener, SoMChangeListener {
 
     private final DecimalFormat DECIMAL_FORMAT = new DecimalFormat(Main.pref.get("statusbar.decimal-format", "0.0"));
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 10226)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 10228)
@@ -719,5 +719,5 @@
             @Override
             public int compare(Relation o1, Relation o2) {
-                int comp = Boolean.valueOf(o1.isDisabledAndHidden()).compareTo(o2.isDisabledAndHidden());
+                int comp = Boolean.compare(o1.isDisabledAndHidden(), o2.isDisabledAndHidden());
                 return comp != 0 ? comp : DefaultNameFormatter.getInstance().getRelationComparator().compare(o1, o2);
             }
Index: trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackAction.java	(revision 10226)
+++ trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackAction.java	(revision 10228)
@@ -60,11 +60,11 @@
         protected void realRun() throws SAXException, IOException, OsmTransferException {
             precacheTask = layer.downloadAreaToCache(progressMonitor, points, 0, 0);
-            while (!precacheTask.isFinished() && !progressMonitor.isCanceled()) {
-                synchronized (this) {
-                    try {
+            synchronized (this) {
+                try {
+                    while (!precacheTask.isFinished() && !progressMonitor.isCanceled()) {
                         wait(200);
-                    } catch (InterruptedException ex) {
-                        Main.warn("InterruptedException in "+getClass().getSimpleName()+" while precaching WMS");
                     }
+                } catch (InterruptedException ex) {
+                    Main.warn("InterruptedException in "+getClass().getSimpleName()+" while precaching WMS");
                 }
             }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginCheckBox.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginCheckBox.java	(revision 10228)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginCheckBox.java	(revision 10228)
@@ -0,0 +1,101 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.preferences.plugin;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import static org.openstreetmap.josm.tools.I18n.trn;
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.swing.JCheckBox;
+import javax.swing.JOptionPane;
+
+import org.openstreetmap.josm.plugins.PluginHandler;
+import org.openstreetmap.josm.plugins.PluginInformation;
+import org.openstreetmap.josm.tools.Utils;
+
+/**
+ * A plugin checkbox.
+ * @since 10228
+ */
+public class PluginCheckBox extends JCheckBox implements ActionListener {
+    private final transient PluginInformation pi;
+    private final PluginListPanel panel;
+    private final transient PluginPreferencesModel ppModel;
+
+    PluginCheckBox(PluginInformation pi, boolean selected, PluginListPanel panel, PluginPreferencesModel ppModel) {
+        this.pi = pi;
+        this.panel = panel;
+        this.ppModel = ppModel;
+        setSelected(selected);
+        setToolTipText(PluginListPanel.formatCheckboxTooltipText(pi));
+        addActionListener(this);
+    }
+
+    protected void selectRequiredPlugins(PluginInformation info) {
+        if (info != null && info.requires != null) {
+            for (String s : info.getRequiredPlugins()) {
+                if (!ppModel.isSelectedPlugin(s)) {
+                    ppModel.setPluginSelected(s, true);
+                    selectRequiredPlugins(ppModel.getPluginInformation(s));
+                }
+            }
+        }
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        // Select/unselect corresponding plugin in the model
+        ppModel.setPluginSelected(pi.getName(), isSelected());
+        // Does the newly selected plugin require other plugins ?
+        if (isSelected() && pi.requires != null) {
+            // Select required plugins
+            selectRequiredPlugins(pi);
+            // Alert user if plugin requirements are not met
+            PluginHandler.checkRequiredPluginsPreconditions(panel, ppModel.getAvailablePlugins(), pi, false);
+        } else if (!isSelected()) {
+            // If the plugin has been unselected, was it required by other plugins still selected ?
+            Set<String> otherPlugins = new HashSet<>();
+            for (PluginInformation p : ppModel.getAvailablePlugins()) {
+                if (!p.equals(pi) && p.requires != null && ppModel.isSelectedPlugin(p.getName())) {
+                    for (String s : p.getRequiredPlugins()) {
+                        if (s.equals(pi.getName())) {
+                            otherPlugins.add(p.getName());
+                            break;
+                        }
+                    }
+                }
+            }
+            if (!otherPlugins.isEmpty()) {
+                alertPluginStillRequired(panel, pi.getName(), otherPlugins);
+            }
+        }
+    }
+
+    /**
+     * Alerts the user if an unselected plugin is still required by another plugins
+     *
+     * @param parent The parent Component used to display error popup
+     * @param plugin the plugin
+     * @param otherPlugins the other plugins
+     */
+    private static void alertPluginStillRequired(Component parent, String plugin, Set<String> otherPlugins) {
+        StringBuilder sb = new StringBuilder("<html>")
+          .append(trn("Plugin {0} is still required by this plugin:",
+                "Plugin {0} is still required by these {1} plugins:",
+                otherPlugins.size(),
+                plugin,
+                otherPlugins.size()))
+          .append(Utils.joinAsHtmlUnorderedList(otherPlugins))
+          .append("</html>");
+        JOptionPane.showMessageDialog(
+                parent,
+                sb.toString(),
+                tr("Warning"),
+                JOptionPane.WARNING_MESSAGE
+        );
+    }
+}
Index: trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java	(revision 10226)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java	(revision 10228)
@@ -3,22 +3,14 @@
 
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.tools.I18n.trn;
 
-import java.awt.Component;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.Insets;
 import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
-import javax.swing.JCheckBox;
 import javax.swing.JLabel;
-import javax.swing.JOptionPane;
 import javax.swing.SwingConstants;
 import javax.swing.SwingUtilities;
@@ -29,8 +21,6 @@
 import org.openstreetmap.josm.gui.widgets.HtmlPanel;
 import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
-import org.openstreetmap.josm.plugins.PluginHandler;
 import org.openstreetmap.josm.plugins.PluginInformation;
 import org.openstreetmap.josm.tools.OpenBrowser;
-import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -56,5 +46,5 @@
     }
 
-    protected String formatPluginRemoteVersion(PluginInformation pi) {
+    protected static String formatPluginRemoteVersion(PluginInformation pi) {
         StringBuilder sb = new StringBuilder();
         if (pi.version == null || pi.version.trim().isEmpty()) {
@@ -69,5 +59,5 @@
     }
 
-    protected String formatPluginLocalVersion(PluginInformation pi) {
+    protected static String formatPluginLocalVersion(PluginInformation pi) {
         if (pi == null)
             return tr("unknown");
@@ -77,5 +67,5 @@
     }
 
-    protected String formatCheckboxTooltipText(PluginInformation pi) {
+    protected static String formatCheckboxTooltipText(PluginInformation pi) {
         if (pi == null)
             return "";
@@ -108,93 +98,4 @@
 
     /**
-     * A plugin checkbox.
-     */
-    private class JPluginCheckBox extends JCheckBox {
-        protected final transient PluginInformation pi;
-
-        JPluginCheckBox(final PluginInformation pi, boolean selected) {
-            this.pi = pi;
-            setSelected(selected);
-            setToolTipText(formatCheckboxTooltipText(pi));
-            addActionListener(new PluginCbActionListener(this));
-        }
-    }
-
-    /**
-     * Listener called when the user selects/unselects a plugin checkbox.
-     */
-    private class PluginCbActionListener implements ActionListener {
-        private final JPluginCheckBox cb;
-
-        PluginCbActionListener(JPluginCheckBox cb) {
-            this.cb = cb;
-        }
-
-        protected void selectRequiredPlugins(PluginInformation info) {
-            if (info != null && info.requires != null) {
-                for (String s : info.getRequiredPlugins()) {
-                    if (!model.isSelectedPlugin(s)) {
-                        model.setPluginSelected(s, true);
-                        selectRequiredPlugins(model.getPluginInformation(s));
-                    }
-                }
-            }
-        }
-
-        @Override
-        public void actionPerformed(ActionEvent e) {
-            // Select/unselect corresponding plugin in the model
-            model.setPluginSelected(cb.pi.getName(), cb.isSelected());
-            // Does the newly selected plugin require other plugins ?
-            if (cb.isSelected() && cb.pi.requires != null) {
-                // Select required plugins
-                selectRequiredPlugins(cb.pi);
-                // Alert user if plugin requirements are not met
-                PluginHandler.checkRequiredPluginsPreconditions(PluginListPanel.this, model.getAvailablePlugins(), cb.pi, false);
-            } else if (!cb.isSelected()) {
-                // If the plugin has been unselected, was it required by other plugins still selected ?
-                Set<String> otherPlugins = new HashSet<>();
-                for (PluginInformation pi : model.getAvailablePlugins()) {
-                    if (!pi.equals(cb.pi) && pi.requires != null && model.isSelectedPlugin(pi.getName())) {
-                        for (String s : pi.getRequiredPlugins()) {
-                            if (s.equals(cb.pi.getName())) {
-                                otherPlugins.add(pi.getName());
-                                break;
-                            }
-                        }
-                    }
-                }
-                if (!otherPlugins.isEmpty()) {
-                    alertPluginStillRequired(PluginListPanel.this, cb.pi.getName(), otherPlugins);
-                }
-            }
-        }
-    }
-
-    /**
-     * Alerts the user if an unselected plugin is still required by another plugins
-     *
-     * @param parent The parent Component used to display error popup
-     * @param plugin the plugin
-     * @param otherPlugins the other plugins
-     */
-    private static void alertPluginStillRequired(Component parent, String plugin, Set<String> otherPlugins) {
-        StringBuilder sb = new StringBuilder("<html>")
-          .append(trn("Plugin {0} is still required by this plugin:",
-                "Plugin {0} is still required by these {1} plugins:",
-                otherPlugins.size(),
-                plugin,
-                otherPlugins.size()))
-          .append(Utils.joinAsHtmlUnorderedList(otherPlugins))
-          .append("</html>");
-        JOptionPane.showMessageDialog(
-                parent,
-                sb.toString(),
-                tr("Warning"),
-                JOptionPane.WARNING_MESSAGE
-        );
-    }
-
-    /**
      * Refreshes the list.
      */
@@ -221,5 +122,5 @@
             String localversion = formatPluginLocalVersion(model.getPluginInformation(pi.getName()));
 
-            final JPluginCheckBox cbPlugin = new JPluginCheckBox(pi, selected);
+            final PluginCheckBox cbPlugin = new PluginCheckBox(pi, selected, this, model);
             String pluginText = tr("{0}: Version {1} (local: {2})", pi.getName(), remoteversion, localversion);
             if (pi.requires != null && !pi.requires.isEmpty()) {
Index: trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionItemPriority.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionItemPriority.java	(revision 10226)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionItemPriority.java	(revision 10228)
@@ -117,13 +117,13 @@
             return ui;
 
-        int sel = Boolean.valueOf(selected).compareTo(other.selected);
+        int sel = Boolean.compare(selected, other.selected);
         if (sel != 0)
             return sel;
 
-        int ds = Boolean.valueOf(inDataSet).compareTo(other.inDataSet);
+        int ds = Boolean.compare(inDataSet, other.inDataSet);
         if (ds != 0)
             return ds;
 
-        int std = Boolean.valueOf(inStandard).compareTo(other.inStandard);
+        int std = Boolean.compare(inStandard, other.inStandard);
         if (std != 0)
             return std;
Index: trunk/src/org/openstreetmap/josm/gui/util/RotationAngle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/util/RotationAngle.java	(revision 10226)
+++ trunk/src/org/openstreetmap/josm/gui/util/RotationAngle.java	(revision 10228)
@@ -67,5 +67,5 @@
             case "n":
             case "north":
-                return Math.toRadians(0);
+                return 0; // 0 degree => 0 radian
             case "ne":
             case "northeast":
@@ -79,5 +79,5 @@
             case "s":
             case "south":
-                return Math.toRadians(180);
+                return Math.PI; // 180 degree
             case "sw":
             case "southwest":
Index: trunk/src/org/openstreetmap/josm/io/AllFormatsImporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/AllFormatsImporter.java	(revision 10226)
+++ trunk/src/org/openstreetmap/josm/io/AllFormatsImporter.java	(revision 10228)
@@ -41,5 +41,5 @@
         }
         // remove last comma
-        return ext.substring(0, ext.length()-1).toString();
+        return ext.substring(0, ext.length()-1);
     }
 }
