Index: trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 10179)
@@ -1665,5 +1665,6 @@
                 }
             }
-            return projected = new EastNorth(e0+l*pe, n0+l*pn);
+            projected = new EastNorth(e0+l*pe, n0+l*pn);
+            return projected;
         }
 
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 10179)
@@ -725,6 +725,6 @@
                 ((MoveCommand) c).applyVectorTo(currentEN);
             } else {
-                Main.main.undoRedo.add(
-                        c = new MoveCommand(selection, startEN, currentEN));
+                c = new MoveCommand(selection, startEN, currentEN);
+                Main.main.undoRedo.add(c);
             }
             for (Node n : affectedNodes) {
@@ -834,5 +834,5 @@
                 limit -= ((Way) osm).getNodes().size();
             }
-            if ((limit -= 1) < 0) {
+            if (--limit < 0) {
                 break;
             }
@@ -1200,6 +1200,8 @@
                     w = ws.way;
 
-                    Point2D p1 = mv.getPoint2D(wnp.a = w.getNode(ws.lowerIndex));
-                    Point2D p2 = mv.getPoint2D(wnp.b = w.getNode(ws.lowerIndex + 1));
+                    wnp.a = w.getNode(ws.lowerIndex);
+                    wnp.b = w.getNode(ws.lowerIndex + 1);
+                    Point2D p1 = mv.getPoint2D(wnp.a);
+                    Point2D p2 = mv.getPoint2D(wnp.b);
                     if (WireframeMapRenderer.isLargeSegment(p1, p2, virtualSpace)) {
                         Point2D pc = new Point2D.Double((p1.getX() + p2.getX()) / 2, (p1.getY() + p2.getY()) / 2);
Index: trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java	(revision 10179)
@@ -203,23 +203,16 @@
      */
     public static int askForOption(String text, String opts) {
-        Integer answer;
         if (!opts.isEmpty()) {
-            String[] options = opts.split(";");
-            answer = JOptionPane.showOptionDialog(Main.parent, text, "Question",
-                    JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, 0);
+            return JOptionPane.showOptionDialog(Main.parent, text, "Question",
+                    JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, opts.split(";"), 0);
         } else {
-            answer = JOptionPane.showOptionDialog(Main.parent, text, "Question",
+            return JOptionPane.showOptionDialog(Main.parent, text, "Question",
                     JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, 2);
         }
-        if (answer == null) return -1; else return answer;
     }
 
     public static String askForText(String text) {
         String s = JOptionPane.showInputDialog(Main.parent, text, tr("Enter text"), JOptionPane.QUESTION_MESSAGE);
-        if (s != null && !(s = s.trim()).isEmpty()) {
-            return s;
-        } else {
-            return "";
-        }
+        return s != null ? s.trim() : null;
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/MultipolygonCache.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/MultipolygonCache.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/MultipolygonCache.java	(revision 10179)
@@ -84,13 +84,16 @@
             Map<DataSet, Map<Relation, Multipolygon>> map1 = cache.get(nc);
             if (map1 == null) {
-                cache.put(nc, map1 = new ConcurrentHashMap<>());
+                map1 = new ConcurrentHashMap<>();
+                cache.put(nc, map1);
             }
             Map<Relation, Multipolygon> map2 = map1.get(r.getDataSet());
             if (map2 == null) {
-                map1.put(r.getDataSet(), map2 = new ConcurrentHashMap<>());
+                map2 = new ConcurrentHashMap<>();
+                map1.put(r.getDataSet(), map2);
             }
             multipolygon = map2.get(r);
             if (multipolygon == null || forceRefresh) {
-                map2.put(r, multipolygon = new Multipolygon(r));
+                multipolygon = new Multipolygon(r);
+                map2.put(r, multipolygon);
                 for (PolyData pd : multipolygon.getCombinedPolygons()) {
                     if (pd.selected) {
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java	(revision 10179)
@@ -158,5 +158,6 @@
                         List<OsmPrimitive> list = map.get(number);
                         if (list == null) {
-                            map.put(number, list = new ArrayList<>());
+                            list = new ArrayList<>();
+                            map.put(number, list);
                         }
                         list.add(p);
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/Highways.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/Highways.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/Highways.java	(revision 10179)
@@ -128,5 +128,6 @@
                     List<Way> list = map.get(value);
                     if (list == null) {
-                        map.put(value, list = new ArrayList<>());
+                        list = new ArrayList<>();
+                        map.put(value, list);
                     }
                     list.add(h);
Index: trunk/src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 10179)
@@ -133,19 +133,19 @@
 
     /** Conflict dialog */
-    public ConflictDialog conflictDialog;
+    public final ConflictDialog conflictDialog;
     /** Filter dialog */
-    public FilterDialog filterDialog;
+    public final FilterDialog filterDialog;
     /** Relation list dialog */
-    public RelationListDialog relationListDialog;
+    public final RelationListDialog relationListDialog;
     /** Validator dialog */
-    public ValidatorDialog validatorDialog;
+    public final ValidatorDialog validatorDialog;
     /** Selection list dialog */
-    public SelectionListDialog selectionListDialog;
+    public final SelectionListDialog selectionListDialog;
     /** Properties dialog */
-    public PropertiesDialog propertiesDialog;
+    public final PropertiesDialog propertiesDialog;
     /** Map paint dialog */
-    public MapPaintDialog mapPaintDialog;
+    public final MapPaintDialog mapPaintDialog;
     /** Notes dialog */
-    public NotesDialog noteDialog;
+    public final NotesDialog noteDialog;
 
     // Map modes
@@ -238,8 +238,13 @@
 
         // toolBarActions, map mode buttons
-        addMapMode(new IconToggleButton(mapModeSelect = new SelectAction(this)));
-        addMapMode(new IconToggleButton(mapModeSelectLasso = new LassoModeAction(), true));
-        addMapMode(new IconToggleButton(mapModeDraw = new DrawAction(this)));
-        addMapMode(new IconToggleButton(mapModeZoom = new ZoomAction(this)));
+        mapModeSelect = new SelectAction(this);
+        mapModeSelectLasso = new LassoModeAction();
+        mapModeDraw = new DrawAction(this);
+        mapModeZoom = new ZoomAction(this);
+
+        addMapMode(new IconToggleButton(mapModeSelect));
+        addMapMode(new IconToggleButton(mapModeSelectLasso, true));
+        addMapMode(new IconToggleButton(mapModeDraw));
+        addMapMode(new IconToggleButton(mapModeZoom));
         addMapMode(new IconToggleButton(new DeleteAction(this), true));
         addMapMode(new IconToggleButton(new ParallelWayAction(this), true));
@@ -251,17 +256,26 @@
         // toolBarToggles, toggle dialog buttons
         LayerListDialog.createInstance(this);
+        propertiesDialog = new PropertiesDialog();
+        selectionListDialog = new SelectionListDialog();
+        relationListDialog = new RelationListDialog();
+        conflictDialog = new ConflictDialog();
+        validatorDialog = new ValidatorDialog();
+        filterDialog = new FilterDialog();
+        mapPaintDialog = new MapPaintDialog();
+        noteDialog = new NotesDialog();
+
         addToggleDialog(LayerListDialog.getInstance());
-        addToggleDialog(propertiesDialog = new PropertiesDialog());
-        addToggleDialog(selectionListDialog = new SelectionListDialog());
-        addToggleDialog(relationListDialog = new RelationListDialog());
+        addToggleDialog(propertiesDialog);
+        addToggleDialog(selectionListDialog);
+        addToggleDialog(relationListDialog);
         addToggleDialog(new MinimapDialog());
         addToggleDialog(new CommandStackDialog());
         addToggleDialog(new UserListDialog());
-        addToggleDialog(conflictDialog = new ConflictDialog());
-        addToggleDialog(validatorDialog = new ValidatorDialog());
-        addToggleDialog(filterDialog = new FilterDialog());
+        addToggleDialog(conflictDialog);
+        addToggleDialog(validatorDialog);
+        addToggleDialog(filterDialog);
         addToggleDialog(new ChangesetDialog(), true);
-        addToggleDialog(mapPaintDialog = new MapPaintDialog());
-        addToggleDialog(noteDialog = new NotesDialog());
+        addToggleDialog(mapPaintDialog);
+        addToggleDialog(noteDialog);
         toolBarToggle.setFloatable(false);
 
@@ -272,6 +286,10 @@
         boolean unregisterTab = Shortcut.findShortcut(KeyEvent.VK_TAB, 0) != null;
         if (unregisterTab) {
-            for (JComponent c: allDialogButtons) c.setFocusTraversalKeysEnabled(false);
-            for (JComponent c: allMapModeButtons) c.setFocusTraversalKeysEnabled(false);
+            for (JComponent c: allDialogButtons) {
+                c.setFocusTraversalKeysEnabled(false);
+            }
+            for (JComponent c: allMapModeButtons) {
+                c.setFocusTraversalKeysEnabled(false);
+            }
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 10179)
@@ -91,5 +91,5 @@
  * @author imi
  */
-public class MapStatus extends JPanel implements Helpful, Destroyable, PreferenceChangedListener {
+public class MapStatus extends JPanel implements Helpful, Destroyable, PreferenceChangedListener, SoMChangeListener {
 
     private final DecimalFormat DECIMAL_FORMAT = new DecimalFormat(Main.pref.get("statusbar.decimal-format", "0.0"));
@@ -201,6 +201,4 @@
     private final JProgressBar progressBar = new JProgressBar();
     public final transient BackgroundProgressMonitor progressMonitor = new BackgroundProgressMonitor();
-
-    private final transient SoMChangeListener somListener;
 
     // Distance value displayed in distText, stored if refresh needed after a change of system of measurement
@@ -924,10 +922,5 @@
         }
 
-        SystemOfMeasurement.addSoMChangeListener(somListener = new SoMChangeListener() {
-            @Override
-            public void systemOfMeasurementChanged(String oldSoM, String newSoM) {
-                setDist(distValue);
-            }
-        });
+        SystemOfMeasurement.addSoMChangeListener(this);
 
         latText.addMouseListener(jumpToOnLeftClick);
@@ -961,4 +954,9 @@
     }
 
+    @Override
+    public void systemOfMeasurementChanged(String oldSoM, String newSoM) {
+        setDist(distValue);
+    }
+
     /**
      * Updates the system of measurement and displays a notification.
@@ -1078,5 +1076,5 @@
     @Override
     public void destroy() {
-        SystemOfMeasurement.removeSoMChangeListener(somListener);
+        SystemOfMeasurement.removeSoMChangeListener(this);
         Main.pref.removePreferenceChangeListener(this);
 
Index: trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java	(revision 10179)
@@ -39,5 +39,5 @@
     /** the text area and the scroll pane for the log */
     private final JosmTextArea taLog = new JosmTextArea(5, 50);
-    private  JScrollPane spLog;
+    private final JScrollPane spLog = new JScrollPane(taLog);
 
     private void initDialog() {
@@ -60,5 +60,5 @@
         gc.weighty = 1.0;
         gc.weightx = 1.0;
-        pane.add(spLog = new JScrollPane(taLog), gc);
+        pane.add(spLog, gc);
         spLog.setVisible(false);
         setContentPane(pane);
Index: trunk/src/org/openstreetmap/josm/gui/SideButton.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/SideButton.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/SideButton.java	(revision 10179)
@@ -22,5 +22,6 @@
 
 /**
- * Button that is usually used in toggle dialogs
+ * Button that is usually used in toggle dialogs.
+ * @since 744
  */
 public class SideButton extends JButton implements Destroyable {
@@ -29,4 +30,8 @@
     private transient PropertyChangeListener propertyChangeListener;
 
+    /**
+     * Constructs a new {@code SideButton}.
+     * @param action action used to specify the new button
+     */
     public SideButton(Action action) {
         super(action);
@@ -35,4 +40,9 @@
     }
 
+    /**
+     * Constructs a new {@code SideButton}.
+     * @param action action used to specify the new button
+     * @param usename use action name
+     */
     public SideButton(Action action, boolean usename) {
         super(action);
@@ -44,7 +54,12 @@
     }
 
+    /**
+     * Constructs a new {@code SideButton}.
+     * @param action action used to specify the new button
+     * @param imagename image name in "dialogs" directory
+     */
     public SideButton(Action action, String imagename) {
         super(action);
-        setIcon(makeIcon(imagename));
+        setIcon(getScaledImage(ImageProvider.get("dialogs", imagename).getImage()));
         doStyle();
     }
@@ -54,5 +69,5 @@
         // SideButton is constructed get the proper icon size
         if (action != null) {
-            action.addPropertyChangeListener(propertyChangeListener = new PropertyChangeListener() {
+            propertyChangeListener = new PropertyChangeListener() {
                 @Override
                 public void propertyChange(PropertyChangeEvent evt) {
@@ -61,5 +76,6 @@
                     }
                 }
-            });
+            };
+            action.addPropertyChangeListener(propertyChangeListener);
         }
         Icon i = getIcon();
@@ -77,9 +93,4 @@
         int newWidth = im.getWidth(null) *  iconHeight / im.getHeight(null);
         return new ImageIcon(im.getScaledInstance(newWidth, iconHeight, Image.SCALE_SMOOTH));
-    }
-
-    public static ImageIcon makeIcon(String imagename) {
-        Image im = ImageProvider.get("dialogs", imagename).getImage();
-        return getScaledImage(im);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java	(revision 10179)
@@ -85,11 +85,9 @@
     private transient Bounds bbox;
     /** the map viewer showing the selected bounding box */
-    private TileBoundsMapView mapViewer;
+    private final TileBoundsMapView mapViewer = new TileBoundsMapView();
     /** a panel for entering a bounding box given by a  tile grid and a zoom level */
-    private TileGridInputPanel pnlTileGrid;
-    /** a panel for entering a bounding box given by the address of an individual OSM tile at
-     *  a given zoom level
-     */
-    private TileAddressInputPanel pnlTileAddress;
+    private final TileGridInputPanel pnlTileGrid = new TileGridInputPanel();
+    /** a panel for entering a bounding box given by the address of an individual OSM tile at a given zoom level */
+    private final TileAddressInputPanel pnlTileAddress = new TileAddressInputPanel();
 
     /**
@@ -103,8 +101,8 @@
         gc.fill = GridBagConstraints.HORIZONTAL;
         gc.anchor = GridBagConstraints.NORTHWEST;
-        add(pnlTileGrid = new TileGridInputPanel(), gc);
+        add(pnlTileGrid, gc);
 
         gc.gridx = 1;
-        add(pnlTileAddress = new TileAddressInputPanel(), gc);
+        add(pnlTileAddress, gc);
 
         gc.gridx = 0;
@@ -115,5 +113,5 @@
         gc.fill = GridBagConstraints.BOTH;
         gc.insets = new Insets(2, 2, 2, 2);
-        add(mapViewer = new TileBoundsMapView(), gc);
+        add(mapViewer, gc);
         mapViewer.setFocusable(false);
         mapViewer.setZoomContolsVisible(false);
@@ -217,13 +215,13 @@
         public static final String TILE_BOUNDS_PROP = TileGridInputPanel.class.getName() + ".tileBounds";
 
-        private JosmTextField tfMaxY;
-        private JosmTextField tfMinY;
-        private JosmTextField tfMaxX;
-        private JosmTextField tfMinX;
+        private final JosmTextField tfMaxY = new JosmTextField();
+        private final JosmTextField tfMinY = new JosmTextField();
+        private final JosmTextField tfMaxX = new JosmTextField();
+        private final JosmTextField tfMinX = new JosmTextField();
         private transient TileCoordinateValidator valMaxY;
         private transient TileCoordinateValidator valMinY;
         private transient TileCoordinateValidator valMaxX;
         private transient TileCoordinateValidator valMinX;
-        private JSpinner spZoomLevel;
+        private final JSpinner spZoomLevel = new JSpinner(new SpinnerNumberModel(0, 0, 18, 1));
         private final transient TileBoundsBuilder tileBoundsBuilder = new TileBoundsBuilder();
         private boolean doFireTileBoundChanged = true;
@@ -240,5 +238,5 @@
             JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
             pnl.add(new JLabel(tr("Zoom level:")));
-            pnl.add(spZoomLevel = new JSpinner(new SpinnerNumberModel(0, 0, 18, 1)));
+            pnl.add(spZoomLevel);
             spZoomLevel.addChangeListener(new ZomeLevelChangeHandler());
             spZoomLevel.addChangeListener(tileBoundsBuilder);
@@ -274,5 +272,5 @@
             gc.gridx = 1;
             gc.weightx = 0.5;
-            pnl.add(tfMinX = new JosmTextField(), gc);
+            pnl.add(tfMinX, gc);
             valMinX = new TileCoordinateValidator(tfMinX);
             SelectAllOnFocusGainedDecorator.decorate(tfMinX);
@@ -282,5 +280,5 @@
             gc.gridx = 2;
             gc.weightx = 0.5;
-            pnl.add(tfMaxX = new JosmTextField(), gc);
+            pnl.add(tfMaxX, gc);
             valMaxX = new TileCoordinateValidator(tfMaxX);
             SelectAllOnFocusGainedDecorator.decorate(tfMaxX);
@@ -295,5 +293,5 @@
             gc.gridx = 1;
             gc.weightx = 0.5;
-            pnl.add(tfMinY = new JosmTextField(), gc);
+            pnl.add(tfMinY, gc);
             valMinY = new TileCoordinateValidator(tfMinY);
             SelectAllOnFocusGainedDecorator.decorate(tfMinY);
@@ -303,5 +301,5 @@
             gc.gridx = 2;
             gc.weightx = 0.5;
-            pnl.add(tfMaxY = new JosmTextField(), gc);
+            pnl.add(tfMaxY, gc);
             valMaxY = new TileCoordinateValidator(tfMaxY);
             SelectAllOnFocusGainedDecorator.decorate(tfMaxY);
Index: trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMerger.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMerger.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMerger.java	(revision 10179)
@@ -37,14 +37,14 @@
     private static final DecimalFormat COORD_FORMATTER = new DecimalFormat("###0.0000000");
 
-    private JLabel lblMyCoordinates;
-    private JLabel lblMergedCoordinates;
-    private JLabel lblTheirCoordinates;
-
-    private JLabel lblMyDeletedState;
-    private JLabel lblMergedDeletedState;
-    private JLabel lblTheirDeletedState;
-
-    private JLabel lblMyReferrers;
-    private JLabel lblTheirReferrers;
+    private final JLabel lblMyCoordinates = buildValueLabel("label.mycoordinates");
+    private final JLabel lblMergedCoordinates = buildValueLabel("label.mergedcoordinates");
+    private final JLabel lblTheirCoordinates = buildValueLabel("label.theircoordinates");
+
+    private final JLabel lblMyDeletedState = buildValueLabel("label.mydeletedstate");
+    private final JLabel lblMergedDeletedState = buildValueLabel("label.mergeddeletedstate");
+    private final JLabel lblTheirDeletedState = buildValueLabel("label.theirdeletedstate");
+
+    private final JLabel lblMyReferrers = buildValueLabel("label.myreferrers");
+    private final JLabel lblTheirReferrers = buildValueLabel("label.theirreferrers");
 
     private final transient PropertiesMergeModel model;
@@ -61,5 +61,5 @@
     }
 
-    protected JLabel buildValueLabel(String name) {
+    protected static JLabel buildValueLabel(String name) {
         JLabel lbl = new JLabel();
         lbl.setName(name);
@@ -129,5 +129,5 @@
         gc.weightx = 0.33;
         gc.weighty = 0.0;
-        add(lblMyCoordinates = buildValueLabel("label.mycoordinates"), gc);
+        add(lblMyCoordinates, gc);
 
         gc.gridx = 2;
@@ -147,5 +147,5 @@
         gc.weightx = 0.33;
         gc.weighty = 0.0;
-        add(lblMergedCoordinates = buildValueLabel("label.mergedcoordinates"), gc);
+        add(lblMergedCoordinates, gc);
 
         gc.gridx = 4;
@@ -164,5 +164,5 @@
         gc.weightx = 0.33;
         gc.weighty = 0.0;
-        add(lblTheirCoordinates = buildValueLabel("label.theircoordinates"), gc);
+        add(lblTheirCoordinates, gc);
 
         // ---------------------------------------------------
@@ -198,5 +198,5 @@
         gc.weightx = 0.33;
         gc.weighty = 0.0;
-        add(lblMyDeletedState = buildValueLabel("label.mydeletedstate"), gc);
+        add(lblMyDeletedState, gc);
 
         gc.gridx = 2;
@@ -216,5 +216,5 @@
         gc.weightx = 0.33;
         gc.weighty = 0.0;
-        add(lblMergedDeletedState = buildValueLabel("label.mergeddeletedstate"), gc);
+        add(lblMergedDeletedState, gc);
 
         gc.gridx = 4;
@@ -234,5 +234,5 @@
         gc.weightx = 0.33;
         gc.weighty = 0.0;
-        add(lblTheirDeletedState = buildValueLabel("label.theirdeletedstate"), gc);
+        add(lblTheirDeletedState, gc);
 
         // ---------------------------------------------------
@@ -270,5 +270,5 @@
         gc.weightx = 0.33;
         gc.weighty = 0.0;
-        add(lblMyReferrers = buildValueLabel("label.myreferrers"), gc);
+        add(lblMyReferrers, gc);
 
         gc.gridx = 5;
@@ -278,5 +278,5 @@
         gc.weightx = 0.33;
         gc.weighty = 0.0;
-        add(lblTheirReferrers = buildValueLabel("label.theirreferrers"), gc);
+        add(lblTheirReferrers, gc);
     }
 
@@ -289,5 +289,5 @@
     }
 
-    public String coordToString(LatLon coord) {
+    protected static String coordToString(LatLon coord) {
         if (coord == null)
             return tr("(none)");
@@ -301,5 +301,5 @@
     }
 
-    public String deletedStateToString(Boolean deleted) {
+    protected static String deletedStateToString(Boolean deleted) {
         if (deleted == null)
             return tr("(none)");
@@ -310,5 +310,5 @@
     }
 
-    public String referrersToString(List<OsmPrimitive> referrers) {
+    protected static String referrersToString(List<OsmPrimitive> referrers) {
         if (referrers.isEmpty())
             return tr("(none)");
@@ -390,4 +390,8 @@
     }
 
+    /**
+     * Returns properties merge model.
+     * @return properties merge model
+     */
     public PropertiesMergeModel getModel() {
         return model;
Index: trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java	(revision 10179)
@@ -172,5 +172,6 @@
         spTagConflictTypes.setTopComponent(buildTagConflictResolverPanel());
         spTagConflictTypes.setBottomComponent(buildRelationMemberConflictResolverPanel());
-        getContentPane().add(pnlButtons = buildButtonPanel(), BorderLayout.SOUTH);
+        pnlButtons = buildButtonPanel();
+        getContentPane().add(pnlButtons, BorderLayout.SOUTH);
         addWindowListener(new AdjustDividerLocationAction());
         HelpUtil.setHelpContext(getRootPane(), ht("/"));
Index: trunk/src/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialog.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialog.java	(revision 10179)
@@ -57,14 +57,14 @@
     }
 
-    private TagConflictResolver allPrimitivesResolver;
-    private transient Map<OsmPrimitiveType, TagConflictResolver> resolvers;
-    private JTabbedPane tpResolvers;
+    private final TagConflictResolver allPrimitivesResolver = new TagConflictResolver();
+    private final transient Map<OsmPrimitiveType, TagConflictResolver> resolvers = new EnumMap<>(OsmPrimitiveType.class);
+    private final JTabbedPane tpResolvers = new JTabbedPane();
     private Mode mode;
     private boolean canceled;
 
-    private final ImageIcon iconResolved;
-    private final ImageIcon iconUnresolved;
-    private StatisticsTableModel statisticsModel;
-    private JPanel pnlTagResolver;
+    private final ImageIcon iconResolved = ImageProvider.get("dialogs/conflict", "tagconflictresolved");
+    private final ImageIcon iconUnresolved = ImageProvider.get("dialogs/conflict", "tagconflictunresolved");
+    private final StatisticsTableModel statisticsModel = new StatisticsTableModel();
+    private final JPanel pnlTagResolver = new JPanel(new BorderLayout());
 
     /**
@@ -75,17 +75,12 @@
         super(GuiHelper.getFrameForComponent(owner), ModalityType.DOCUMENT_MODAL);
         build();
-        iconResolved = ImageProvider.get("dialogs/conflict", "tagconflictresolved");
-        iconUnresolved = ImageProvider.get("dialogs/conflict", "tagconflictunresolved");
     }
 
     protected final void build() {
         setTitle(tr("Conflicts in pasted tags"));
-        allPrimitivesResolver = new TagConflictResolver();
-        resolvers = new EnumMap<>(OsmPrimitiveType.class);
         for (OsmPrimitiveType type: OsmPrimitiveType.dataValues()) {
             resolvers.put(type, new TagConflictResolver());
             resolvers.get(type).getModel().addPropertyChangeListener(this);
         }
-        tpResolvers = new JTabbedPane();
         getContentPane().setLayout(new GridBagLayout());
         mode = null;
@@ -102,5 +97,5 @@
         gc.weightx = 1.0;
         gc.weighty = 1.0;
-        getContentPane().add(pnlTagResolver = new JPanel(new BorderLayout()), gc);
+        getContentPane().add(pnlTagResolver, gc);
         gc.gridx = 0;
         gc.gridy = 2;
@@ -131,5 +126,4 @@
     protected JPanel buildSourceAndTargetInfoPanel() {
         JPanel pnl = new JPanel(new BorderLayout());
-        statisticsModel = new StatisticsTableModel();
         pnl.add(new StatisticsInfoTable(statisticsModel), BorderLayout.CENTER);
         return pnl;
Index: trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java	(revision 10179)
@@ -40,16 +40,16 @@
 public class RelationMemberConflictResolver extends JPanel {
 
-    private AutoCompletingTextField tfRole;
-    private AutoCompletingTextField tfKey;
-    private AutoCompletingTextField tfValue;
+    private final AutoCompletingTextField tfRole = new AutoCompletingTextField(10);
+    private final AutoCompletingTextField tfKey = new AutoCompletingTextField(10);
+    private final AutoCompletingTextField tfValue = new AutoCompletingTextField(10);
     private JCheckBox cbTagRelations;
     private final RelationMemberConflictResolverModel model;
-    private RelationMemberConflictResolverTable tblResolver;
-    private JMultilineLabel lblHeader;
+    private final RelationMemberConflictResolverTable tblResolver;
+    private final JMultilineLabel lblHeader = new JMultilineLabel("");
 
     protected final void build() {
         setLayout(new GridBagLayout());
         final JPanel pnl = new JPanel(new BorderLayout());
-        pnl.add(lblHeader = new JMultilineLabel(""));
+        pnl.add(lblHeader);
         GridBagConstraints gc = new GridBagConstraints();
         gc.fill = GridBagConstraints.HORIZONTAL;
@@ -63,5 +63,5 @@
         gc.fill = GridBagConstraints.BOTH;
         gc.insets = new Insets(0, 0, 0, 0);
-        add(new JScrollPane(tblResolver = new RelationMemberConflictResolverTable(model)), gc);
+        add(new JScrollPane(tblResolver), gc);
 
         final JPanel pnl2 = new JPanel();
@@ -78,5 +78,5 @@
         JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
         pnl.add(new JLabel(tr("Role:")));
-        pnl.add(tfRole = new AutoCompletingTextField(10));
+        pnl.add(tfRole);
         tfRole.setToolTipText(tr("Enter a role for all relation memberships"));
         pnl.add(new JButton(new ApplyRoleAction()));
@@ -102,8 +102,8 @@
         pnl.add(cbTagRelations);
         pnl.add(new JLabel(trc("tag", "Key:")));
-        pnl.add(tfKey = new AutoCompletingTextField(10));
+        pnl.add(tfKey);
         tfKey.setToolTipText(tr("<html>Enter a tag key, e.g. <strong><tt>fixme</tt></strong></html>"));
         pnl.add(new JLabel(tr("Value:")));
-        pnl.add(tfValue = new AutoCompletingTextField(10));
+        pnl.add(tfValue);
         tfValue.setToolTipText(tr("<html>Enter a tag value, e.g. <strong><tt>check members</tt></strong></html>"));
         cbTagRelations.setSelected(false);
@@ -120,4 +120,5 @@
     public RelationMemberConflictResolver(RelationMemberConflictResolverModel model) {
         this.model = model;
+        this.tblResolver = new RelationMemberConflictResolverTable(model);
         build();
     }
Index: trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolver.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolver.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolver.java	(revision 10179)
@@ -21,6 +21,5 @@
  * This is a UI widget for resolving tag conflicts, i.e. differences of the tag values
  * of multiple {@link org.openstreetmap.josm.data.osm.OsmPrimitive}s.
- *
- *
+ * @since 2008
  */
 public class TagConflictResolver extends JPanel {
@@ -29,6 +28,14 @@
     private final TagConflictResolverModel model;
     /** selects whether only tags with conflicts are displayed */
-    private JCheckBox cbShowTagsWithConflictsOnly;
-    private JCheckBox cbShowTagsWithMultiValuesOnly;
+    private final JCheckBox cbShowTagsWithConflictsOnly = new JCheckBox(tr("Show tags with conflicts only"));
+    private final JCheckBox cbShowTagsWithMultiValuesOnly = new JCheckBox(tr("Show tags with multiple values only"));
+
+    /**
+     * Constructs a new {@code TagConflictResolver}.
+     */
+    public TagConflictResolver() {
+        this.model = new TagConflictResolverModel();
+        build();
+    }
 
     protected JPanel buildInfoPanel() {
@@ -47,6 +54,6 @@
         gc.fill = GridBagConstraints.HORIZONTAL;
         gc.weighty = 0.0;
-        pnl.add(cbShowTagsWithConflictsOnly = new JCheckBox(tr("Show tags with conflicts only")), gc);
-        pnl.add(cbShowTagsWithMultiValuesOnly = new JCheckBox(tr("Show tags with multiple values only")), gc);
+        pnl.add(cbShowTagsWithConflictsOnly, gc);
+        pnl.add(cbShowTagsWithMultiValuesOnly, gc);
         cbShowTagsWithConflictsOnly.addChangeListener(
                 new ChangeListener() {
@@ -92,12 +99,4 @@
 
     /**
-     * Constructs a new {@code TagConflictResolver}.
-     */
-    public TagConflictResolver() {
-        this.model = new TagConflictResolverModel();
-        build();
-    }
-
-    /**
      * Replies the model used by this dialog
      *
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java	(revision 10179)
@@ -72,5 +72,5 @@
  * browser with information about a changeset. Furthermore, it can select all objects in
  * the current data layer being assigned to a specific changeset.
- *
+ * @since 2613
  */
 public class ChangesetDialog extends ToggleDialog {
@@ -162,5 +162,6 @@
         JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
         pnl.setBorder(null);
-        pnl.add(cbInSelectionOnly = new JCheckBox(tr("For selected objects only")));
+        cbInSelectionOnly = new JCheckBox(tr("For selected objects only"));
+        pnl.add(cbInSelectionOnly);
         cbInSelectionOnly.setToolTipText(tr("<html>Select to show changesets for the currently selected objects only.<br>"
                 + "Unselect to show all changesets for objects in the current data layer.</html>"));
@@ -183,5 +184,6 @@
         JPanel pnl = new JPanel(new BorderLayout());
         pnl.add(buildFilterPanel(), BorderLayout.NORTH);
-        pnl.add(pnlList = buildListPanel(), BorderLayout.CENTER);
+        pnlList = buildListPanel();
+        pnl.add(pnlList, BorderLayout.CENTER);
 
         cbInSelectionOnly.addItemListener(new FilterChangeHandler());
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/DeleteFromRelationConfirmationDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/DeleteFromRelationConfirmationDialog.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/DeleteFromRelationConfirmationDialog.java	(revision 10179)
@@ -69,7 +69,7 @@
     /** the data model */
     private RelationMemberTableModel model;
-    private HtmlPanel htmlPanel;
+    private final HtmlPanel htmlPanel = new HtmlPanel();
     private boolean canceled;
-    private SideButton btnOK;
+    private final SideButton btnOK = new SideButton(new OKAction());
 
     protected JPanel buildRelationMemberTablePanel() {
@@ -82,5 +82,5 @@
     protected JPanel buildButtonPanel() {
         JPanel pnl = new JPanel(new FlowLayout());
-        pnl.add(btnOK = new SideButton(new OKAction()));
+        pnl.add(btnOK);
         btnOK.setFocusable(true);
         pnl.add(new SideButton(new CancelAction()));
@@ -93,5 +93,5 @@
         model.addTableModelListener(this);
         getContentPane().setLayout(new BorderLayout());
-        getContentPane().add(htmlPanel = new HtmlPanel(), BorderLayout.NORTH);
+        getContentPane().add(htmlPanel, BorderLayout.NORTH);
         getContentPane().add(buildRelationMemberTablePanel(), BorderLayout.CENTER);
         getContentPane().add(buildButtonPanel(), BorderLayout.SOUTH);
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 10179)
@@ -89,9 +89,13 @@
 import org.openstreetmap.josm.tools.Utils;
 
+/**
+ * Dialog to configure the map painting style.
+ * @since 3843
+ */
 public class MapPaintDialog extends ToggleDialog {
 
     protected StylesTable tblStyles;
     protected StylesModel model;
-    protected DefaultListSelectionModel selectionModel;
+    protected final DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
 
     protected OnOffAction onoffAction;
@@ -144,5 +148,5 @@
 
         tblStyles = new StylesTable(model);
-        tblStyles.setSelectionModel(selectionModel = new DefaultListSelectionModel());
+        tblStyles.setSelectionModel(selectionModel);
         tblStyles.addMouseListener(new PopupMenuHandler());
         tblStyles.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
@@ -272,6 +276,8 @@
         public void ensureSelectedIsVisible() {
             int index = selectionModel.getMinSelectionIndex();
-            if (index < 0) return;
-            if (index >= getRowCount()) return;
+            if (index < 0)
+                return;
+            if (index >= getRowCount())
+                return;
             tblStyles.scrollToVisible(index, 0);
             tblStyles.repaint();
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/SingleChangesetDownloadPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/SingleChangesetDownloadPanel.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/SingleChangesetDownloadPanel.java	(revision 10179)
@@ -26,9 +26,16 @@
  * This panel allows to enter the ID of single changeset and to download
  * the respective changeset.
- *
+ * @since 2689
  */
 public class SingleChangesetDownloadPanel extends JPanel {
 
-    private ChangesetIdTextField tfChangesetId;
+    private final ChangesetIdTextField tfChangesetId = new ChangesetIdTextField();
+
+    /**
+     * Constructs a new {@link SingleChangesetDownloadPanel}
+     */
+    public SingleChangesetDownloadPanel() {
+        build();
+    }
 
     protected void build() {
@@ -42,5 +49,5 @@
 
         add(new JLabel(tr("Changeset ID: ")));
-        add(tfChangesetId = new ChangesetIdTextField());
+        add(tfChangesetId);
         tfChangesetId.setToolTipText(tr("Enter a changeset id"));
         SelectAllOnFocusGainedDecorator.decorate(tfChangesetId);
@@ -55,11 +62,4 @@
             tfChangesetId.tryToPasteFromClipboard();
         }
-    }
-
-    /**
-     * Constructs a new {@link SingleChangesetDownloadPanel}
-     */
-    public SingleChangesetDownloadPanel() {
-        build();
     }
 
@@ -90,5 +90,6 @@
                 return;
             int id = getChangesetId();
-            if (id == 0) return;
+            if (id == 0)
+                return;
             ChangesetContentDownloadTask task =  new ChangesetContentDownloadTask(
                     SingleChangesetDownloadPanel.this,
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java	(revision 10179)
@@ -42,19 +42,25 @@
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 
-
 /**
  * This panel allows to specify a changeset query
- *
+ * @since 2689
  */
 public class AdvancedChangesetQueryPanel extends JPanel {
 
-    private JCheckBox cbUserRestriction;
-    private JCheckBox cbOpenAndCloseRestrictions;
-    private JCheckBox cbTimeRestrictions;
-    private JCheckBox cbBoundingBoxRestriction;
-    private UserRestrictionPanel pnlUserRestriction;
-    private OpenAndCloseStateRestrictionPanel pnlOpenAndCloseRestriction;
-    private TimeRestrictionPanel pnlTimeRestriction;
-    private BBoxRestrictionPanel pnlBoundingBoxRestriction;
+    private final JCheckBox cbUserRestriction = new JCheckBox();
+    private final JCheckBox cbOpenAndCloseRestrictions = new JCheckBox();
+    private final JCheckBox cbTimeRestrictions = new JCheckBox();
+    private final JCheckBox cbBoundingBoxRestriction = new JCheckBox();
+    private final UserRestrictionPanel pnlUserRestriction = new UserRestrictionPanel();
+    private final OpenAndCloseStateRestrictionPanel pnlOpenAndCloseRestriction = new OpenAndCloseStateRestrictionPanel();
+    private final TimeRestrictionPanel pnlTimeRestriction = new TimeRestrictionPanel();
+    private final BBoxRestrictionPanel pnlBoundingBoxRestriction = new BBoxRestrictionPanel();
+
+    /**
+     * Constructs a new {@code AdvancedChangesetQueryPanel}.
+     */
+    public AdvancedChangesetQueryPanel() {
+        build();
+    }
 
     protected JPanel buildQueryPanel() {
@@ -69,5 +75,5 @@
         gc.weightx = 0.0;
         gc.fill = GridBagConstraints.HORIZONTAL;
-        pnl.add(cbUserRestriction = new JCheckBox(), gc);
+        pnl.add(cbUserRestriction, gc);
         cbUserRestriction.addItemListener(stateChangeHandler);
 
@@ -79,5 +85,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(pnlUserRestriction = new UserRestrictionPanel(), gc);
+        pnl.add(pnlUserRestriction, gc);
 
         // -- restricting the query to open and closed changesets
@@ -88,5 +94,5 @@
         gc.weightx = 0.0;
         gc.fill = GridBagConstraints.HORIZONTAL;
-        pnl.add(cbOpenAndCloseRestrictions = new JCheckBox(), gc);
+        pnl.add(cbOpenAndCloseRestrictions, gc);
         cbOpenAndCloseRestrictions.addItemListener(stateChangeHandler);
 
@@ -98,5 +104,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(pnlOpenAndCloseRestriction = new OpenAndCloseStateRestrictionPanel(), gc);
+        pnl.add(pnlOpenAndCloseRestriction, gc);
 
         // -- restricting the query to a specific time
@@ -107,5 +113,5 @@
         gc.weightx = 0.0;
         gc.fill = GridBagConstraints.HORIZONTAL;
-        pnl.add(cbTimeRestrictions = new JCheckBox(), gc);
+        pnl.add(cbTimeRestrictions, gc);
         cbTimeRestrictions.addItemListener(stateChangeHandler);
 
@@ -117,5 +123,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(pnlTimeRestriction = new TimeRestrictionPanel(), gc);
+        pnl.add(pnlTimeRestriction, gc);
 
 
@@ -127,5 +133,5 @@
         gc.weightx = 0.0;
         gc.fill = GridBagConstraints.HORIZONTAL;
-        pnl.add(cbBoundingBoxRestriction = new JCheckBox(), gc);
+        pnl.add(cbBoundingBoxRestriction, gc);
         cbBoundingBoxRestriction.addItemListener(stateChangeHandler);
 
@@ -137,5 +143,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(pnlBoundingBoxRestriction = new BBoxRestrictionPanel(), gc);
+        pnl.add(pnlBoundingBoxRestriction, gc);
 
 
@@ -155,11 +161,4 @@
         JScrollPane spQueryPanel = GuiHelper.embedInVerticalScrollPane(buildQueryPanel());
         add(spQueryPanel, BorderLayout.CENTER);
-    }
-
-    /**
-     * Constructs a new {@code AdvancedChangesetQueryPanel}.
-     */
-    public AdvancedChangesetQueryPanel() {
-        build();
     }
 
@@ -241,20 +240,24 @@
     class RestrictionGroupStateChangeHandler implements ItemListener {
         protected void userRestrictionStateChanged() {
-            if (pnlUserRestriction == null) return;
+            if (pnlUserRestriction == null)
+                return;
             pnlUserRestriction.setVisible(cbUserRestriction.isSelected());
         }
 
         protected void openCloseRestrictionStateChanged() {
-            if (pnlOpenAndCloseRestriction == null) return;
+            if (pnlOpenAndCloseRestriction == null)
+                return;
             pnlOpenAndCloseRestriction.setVisible(cbOpenAndCloseRestrictions.isSelected());
         }
 
         protected void timeRestrictionsStateChanged() {
-            if (pnlTimeRestriction == null) return;
+            if (pnlTimeRestriction == null)
+                return;
             pnlTimeRestriction.setVisible(cbTimeRestrictions.isSelected());
         }
 
         protected void boundingBoxRestrictionChanged() {
-            if (pnlBoundingBoxRestriction == null) return;
+            if (pnlBoundingBoxRestriction == null)
+                return;
             pnlBoundingBoxRestriction.setVisible(cbBoundingBoxRestriction.isSelected());
         }
@@ -282,7 +285,11 @@
     private static class OpenAndCloseStateRestrictionPanel extends JPanel {
 
-        private JRadioButton rbOpenOnly;
-        private JRadioButton rbClosedOnly;
-        private JRadioButton rbBoth;
+        private final JRadioButton rbOpenOnly = new JRadioButton();
+        private final JRadioButton rbClosedOnly = new JRadioButton();
+        private final JRadioButton rbBoth = new JRadioButton();
+
+        OpenAndCloseStateRestrictionPanel() {
+            build();
+        }
 
         protected void build() {
@@ -299,5 +306,5 @@
             gc.fill = GridBagConstraints.HORIZONTAL;
             gc.weightx = 0.0;
-            add(rbOpenOnly = new JRadioButton(), gc);
+            add(rbOpenOnly, gc);
 
             gc.gridx = 1;
@@ -308,5 +315,5 @@
             gc.gridx = 0;
             gc.weightx = 0.0;
-            add(rbClosedOnly = new JRadioButton(), gc);
+            add(rbClosedOnly, gc);
 
             gc.gridx = 1;
@@ -317,5 +324,5 @@
             gc.gridx = 0;
             gc.weightx = 0.0;
-            add(rbBoth = new JRadioButton(), gc);
+            add(rbBoth, gc);
 
             gc.gridx = 1;
@@ -327,8 +334,4 @@
             bgRestrictions.add(rbClosedOnly);
             bgRestrictions.add(rbOpenOnly);
-        }
-
-        OpenAndCloseStateRestrictionPanel() {
-            build();
         }
 
@@ -369,18 +372,20 @@
 
     /**
-     * This is the panel for selecting whether the query should be restricted to a specific
-     * user
-     *
+     * This is the panel for selecting whether the query should be restricted to a specific user
      */
     private static class UserRestrictionPanel extends JPanel {
-        private ButtonGroup bgUserRestrictions;
-        private JRadioButton rbRestrictToMyself;
-        private JRadioButton rbRestrictToUid;
-        private JRadioButton rbRestrictToUserName;
-        private JosmTextField tfUid;
+        private final ButtonGroup bgUserRestrictions = new ButtonGroup();
+        private final JRadioButton rbRestrictToMyself = new JRadioButton();
+        private final JRadioButton rbRestrictToUid = new JRadioButton();
+        private final JRadioButton rbRestrictToUserName = new JRadioButton();
+        private final JosmTextField tfUid = new JosmTextField(10);
         private transient UidInputFieldValidator valUid;
-        private JosmTextField tfUserName;
+        private final JosmTextField tfUserName = new JosmTextField(10);
         private transient UserNameValidator valUserName;
-        private JMultilineLabel lblRestrictedToMyself;
+        private final JMultilineLabel lblRestrictedToMyself = new JMultilineLabel(tr("Only changesets owned by myself"));
+
+        UserRestrictionPanel() {
+            build();
+        }
 
         protected JPanel buildUidInputPanel() {
@@ -393,5 +398,5 @@
 
             gc.gridx = 1;
-            pnl.add(tfUid = new JosmTextField(10), gc);
+            pnl.add(tfUid, gc);
             SelectAllOnFocusGainedDecorator.decorate(tfUid);
             valUid = UidInputFieldValidator.decorate(tfUid);
@@ -413,5 +418,5 @@
 
             gc.gridx = 1;
-            pnl.add(tfUserName = new JosmTextField(10), gc);
+            pnl.add(tfUserName, gc);
             SelectAllOnFocusGainedDecorator.decorate(tfUserName);
             valUserName = new UserNameValidator(tfUserName);
@@ -440,5 +445,5 @@
             gc.fill = GridBagConstraints.HORIZONTAL;
             gc.weightx = 0.0;
-            add(rbRestrictToMyself = new JRadioButton(), gc);
+            add(rbRestrictToMyself, gc);
             rbRestrictToMyself.addItemListener(userRestrictionChangeHandler);
 
@@ -446,5 +451,5 @@
             gc.fill =  GridBagConstraints.HORIZONTAL;
             gc.weightx = 1.0;
-            add(lblRestrictedToMyself = new JMultilineLabel(tr("Only changesets owned by myself")), gc);
+            add(lblRestrictedToMyself, gc);
 
             gc.gridx = 0;
@@ -452,5 +457,5 @@
             gc.fill = GridBagConstraints.HORIZONTAL;
             gc.weightx = 0.0;
-            add(rbRestrictToUid = new JRadioButton(), gc);
+            add(rbRestrictToUid, gc);
             rbRestrictToUid.addItemListener(userRestrictionChangeHandler);
 
@@ -470,5 +475,5 @@
             gc.fill = GridBagConstraints.HORIZONTAL;
             gc.weightx = 0.0;
-            add(rbRestrictToUserName = new JRadioButton(), gc);
+            add(rbRestrictToUserName, gc);
             rbRestrictToUserName.addItemListener(userRestrictionChangeHandler);
 
@@ -484,12 +489,7 @@
             add(buildUserNameInputPanel(), gc);
 
-            bgUserRestrictions = new ButtonGroup();
             bgUserRestrictions.add(rbRestrictToMyself);
             bgUserRestrictions.add(rbRestrictToUid);
             bgUserRestrictions.add(rbRestrictToUserName);
-        }
-
-        UserRestrictionPanel() {
-            build();
         }
 
@@ -637,18 +637,22 @@
     private static class TimeRestrictionPanel extends JPanel {
 
-        private JRadioButton rbClosedAfter;
-        private JRadioButton rbClosedAfterAndCreatedBefore;
-        private JosmTextField tfClosedAfterDate1;
+        private final JRadioButton rbClosedAfter = new JRadioButton();
+        private final JRadioButton rbClosedAfterAndCreatedBefore = new JRadioButton();
+        private final JosmTextField tfClosedAfterDate1 = new JosmTextField();
         private transient DateValidator valClosedAfterDate1;
-        private JosmTextField tfClosedAfterTime1;
+        private final JosmTextField tfClosedAfterTime1 = new JosmTextField();
         private transient TimeValidator valClosedAfterTime1;
-        private JosmTextField tfClosedAfterDate2;
+        private final JosmTextField tfClosedAfterDate2 = new JosmTextField();
         private transient DateValidator valClosedAfterDate2;
-        private JosmTextField tfClosedAfterTime2;
+        private final JosmTextField tfClosedAfterTime2 = new JosmTextField();
         private transient TimeValidator valClosedAfterTime2;
-        private JosmTextField tfCreatedBeforeDate;
+        private final JosmTextField tfCreatedBeforeDate = new JosmTextField();
         private transient DateValidator valCreatedBeforeDate;
-        private JosmTextField tfCreatedBeforeTime;
+        private final JosmTextField tfCreatedBeforeTime = new JosmTextField();
         private transient TimeValidator valCreatedBeforeTime;
+
+        TimeRestrictionPanel() {
+            build();
+        }
 
         protected JPanel buildClosedAfterInputPanel() {
@@ -662,5 +666,5 @@
             gc.gridx = 1;
             gc.weightx = 0.7;
-            pnl.add(tfClosedAfterDate1 = new JosmTextField(), gc);
+            pnl.add(tfClosedAfterDate1, gc);
             SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterDate1);
             valClosedAfterDate1 = DateValidator.decorate(tfClosedAfterDate1);
@@ -673,5 +677,5 @@
             gc.gridx = 3;
             gc.weightx = 0.3;
-            pnl.add(tfClosedAfterTime1 = new JosmTextField(), gc);
+            pnl.add(tfClosedAfterTime1, gc);
             SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterTime1);
             valClosedAfterTime1 = TimeValidator.decorate(tfClosedAfterTime1);
@@ -696,5 +700,5 @@
             gc.gridx = 2;
             gc.weightx = 0.7;
-            pnl.add(tfClosedAfterDate2 = new JosmTextField(), gc);
+            pnl.add(tfClosedAfterDate2, gc);
             SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterDate2);
             valClosedAfterDate2 = DateValidator.decorate(tfClosedAfterDate2);
@@ -706,5 +710,5 @@
             gc.gridx = 4;
             gc.weightx = 0.3;
-            pnl.add(tfClosedAfterTime2 = new JosmTextField(), gc);
+            pnl.add(tfClosedAfterTime2, gc);
             SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterTime2);
             valClosedAfterTime2 = TimeValidator.decorate(tfClosedAfterTime2);
@@ -726,5 +730,5 @@
             gc.gridx = 2;
             gc.weightx = 0.7;
-            pnl.add(tfCreatedBeforeDate = new JosmTextField(), gc);
+            pnl.add(tfCreatedBeforeDate, gc);
             SelectAllOnFocusGainedDecorator.decorate(tfCreatedBeforeDate);
             valCreatedBeforeDate = DateValidator.decorate(tfCreatedBeforeDate);
@@ -737,5 +741,5 @@
             gc.gridx = 4;
             gc.weightx = 0.3;
-            pnl.add(tfCreatedBeforeTime = new JosmTextField(), gc);
+            pnl.add(tfCreatedBeforeTime, gc);
             SelectAllOnFocusGainedDecorator.decorate(tfCreatedBeforeTime);
             valCreatedBeforeTime = TimeValidator.decorate(tfCreatedBeforeTime);
@@ -762,5 +766,5 @@
             gc.fill = GridBagConstraints.HORIZONTAL;
             gc.weightx = 0.0;
-            add(rbClosedAfter = new JRadioButton(), gc);
+            add(rbClosedAfter, gc);
 
             gc.gridx = 1;
@@ -783,5 +787,5 @@
             gc.fill = GridBagConstraints.HORIZONTAL;
             gc.weightx = 0.0;
-            add(rbClosedAfterAndCreatedBefore = new JRadioButton(), gc);
+            add(rbClosedAfterAndCreatedBefore, gc);
 
             gc.gridx = 1;
@@ -805,8 +809,4 @@
 
             rbClosedAfter.setSelected(true);
-        }
-
-        TimeRestrictionPanel() {
-            build();
         }
 
@@ -864,5 +864,6 @@
 
         public void displayMessageIfInvalid() {
-            if (isValidChangesetQuery()) return;
+            if (isValidChangesetQuery())
+                return;
             HelpAwareOptionPane.showOptionDialog(
                     this,
@@ -949,5 +950,6 @@
 
         public void displayMessageIfInvalid() {
-            if (isValidChangesetQuery()) return;
+            if (isValidChangesetQuery())
+                return;
             HelpAwareOptionPane.showOptionDialog(
                     this,
@@ -968,10 +970,10 @@
      */
     private static class UidInputFieldValidator extends AbstractTextComponentValidator {
+        UidInputFieldValidator(JTextComponent tc) {
+            super(tc);
+        }
+
         public static UidInputFieldValidator decorate(JTextComponent tc) {
             return new UidInputFieldValidator(tc);
-        }
-
-        UidInputFieldValidator(JTextComponent tc) {
-            super(tc);
         }
 
@@ -1006,5 +1008,6 @@
             try {
                 int uid = Integer.parseInt(value.trim());
-                if (uid > 0) return uid;
+                if (uid > 0)
+                    return uid;
                 return 0;
             } catch (NumberFormatException e) {
@@ -1021,10 +1024,10 @@
      */
     private static class DateValidator extends AbstractTextComponentValidator {
+        DateValidator(JTextComponent tc) {
+            super(tc);
+        }
+
         public static DateValidator decorate(JTextComponent tc) {
             return new DateValidator(tc);
-        }
-
-        DateValidator(JTextComponent tc) {
-            super(tc);
         }
 
@@ -1088,15 +1091,16 @@
      */
     private static class TimeValidator extends AbstractTextComponentValidator {
+        TimeValidator(JTextComponent tc) {
+            super(tc);
+        }
+
         public static TimeValidator decorate(JTextComponent tc) {
             return new TimeValidator(tc);
         }
 
-        TimeValidator(JTextComponent tc) {
-            super(tc);
-        }
-
         @Override
         public boolean isValid() {
-            if (getComponent().getText().trim().isEmpty()) return true;
+            if (getComponent().getText().trim().isEmpty())
+                return true;
             return getDate() != null;
         }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanel.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanel.java	(revision 10179)
@@ -103,5 +103,6 @@
         gc.fill = GridBagConstraints.HORIZONTAL;
         gc.weightx = 1.0;
-        pnl.add(cbMyChangesetsOnly = new JCheckBox(tr("Download my changesets only")), gc);
+        cbMyChangesetsOnly = new JCheckBox(tr("Download my changesets only"));
+        pnl.add(cbMyChangesetsOnly, gc);
         cbMyChangesetsOnly.setToolTipText(
                 tr("<html>Select to restrict the query to your changesets only.<br>Unselect to include all changesets in the query.</html>"));
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/ChangesetQueryDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/ChangesetQueryDialog.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/ChangesetQueryDialog.java	(revision 10179)
@@ -32,19 +32,28 @@
 /**
  * This is a modal dialog for entering query criteria to search for changesets.
- *
+ * @since 2689
  */
 public class ChangesetQueryDialog extends JDialog {
 
     private JTabbedPane tpQueryPanels;
-    private BasicChangesetQueryPanel pnlBasicChangesetQueries;
-    private UrlBasedQueryPanel pnlUrlBasedQueries;
-    private AdvancedChangesetQueryPanel pnlAdvancedQueries;
+    private final BasicChangesetQueryPanel pnlBasicChangesetQueries = new BasicChangesetQueryPanel();
+    private final UrlBasedQueryPanel pnlUrlBasedQueries = new UrlBasedQueryPanel();
+    private final AdvancedChangesetQueryPanel pnlAdvancedQueries = new AdvancedChangesetQueryPanel();
     private boolean canceled;
+
+    /**
+     * Constructs a new {@code ChangesetQueryDialog}.
+     * @param parent parent window
+     */
+    public ChangesetQueryDialog(Window parent) {
+        super(parent, ModalityType.DOCUMENT_MODAL);
+        build();
+    }
 
     protected JPanel buildContentPanel() {
         tpQueryPanels = new JTabbedPane();
-        tpQueryPanels.add(pnlBasicChangesetQueries = new BasicChangesetQueryPanel());
-        tpQueryPanels.add(pnlUrlBasedQueries = new UrlBasedQueryPanel());
-        tpQueryPanels.add(pnlAdvancedQueries = new AdvancedChangesetQueryPanel());
+        tpQueryPanels.add(pnlBasicChangesetQueries);
+        tpQueryPanels.add(pnlUrlBasedQueries);
+        tpQueryPanels.add(pnlAdvancedQueries);
 
         tpQueryPanels.setTitleAt(0, tr("Basic"));
@@ -92,9 +101,4 @@
 
         addWindowListener(new WindowEventHandler());
-    }
-
-    public ChangesetQueryDialog(Window parent) {
-        super(parent, ModalityType.DOCUMENT_MODAL);
-        build();
     }
 
@@ -184,5 +188,4 @@
                     }
                     break;
-
                 case 2:
                     if (getChangesetQuery() == null) {
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java	(revision 10179)
@@ -31,6 +31,13 @@
 public class UrlBasedQueryPanel extends JPanel {
 
-    private JosmTextField tfUrl;
-    private JLabel lblValid;
+    private final JosmTextField tfUrl = new JosmTextField();
+    private final JLabel lblValid = new JLabel();
+
+    /**
+     * Constructs a new {@code UrlBasedQueryPanel}.
+     */
+    public UrlBasedQueryPanel() {
+        build();
+    }
 
     protected JPanel buildURLPanel() {
@@ -45,5 +52,5 @@
         gc.weightx = 1.0;
         gc.fill = GridBagConstraints.HORIZONTAL;
-        pnl.add(tfUrl = new JosmTextField(), gc);
+        pnl.add(tfUrl, gc);
         tfUrl.getDocument().addDocumentListener(new ChangetQueryUrlValidator());
         tfUrl.addFocusListener(
@@ -59,5 +66,5 @@
         gc.weightx = 0.0;
         gc.fill = GridBagConstraints.HORIZONTAL;
-        pnl.add(lblValid = new JLabel(), gc);
+        pnl.add(lblValid, gc);
         lblValid.setPreferredSize(new Dimension(20, 20));
         return pnl;
@@ -115,11 +122,4 @@
     }
 
-    /**
-     * Constructs a new {@code UrlBasedQueryPanel}.
-     */
-    public UrlBasedQueryPanel() {
-        build();
-    }
-
     protected boolean isValidChangesetQueryUrl(String text) {
         return buildChangesetQuery(text) != null;
@@ -135,5 +135,6 @@
         String path = url.getPath();
         String query = url.getQuery();
-        if (path == null || !path.endsWith("/changesets")) return null;
+        if (path == null || !path.endsWith("/changesets"))
+            return null;
 
         try {
@@ -170,5 +171,6 @@
 
         protected void feedbackValid() {
-            if ("valid".equals(getCurrentFeedback())) return;
+            if ("valid".equals(getCurrentFeedback()))
+                return;
             lblValid.setIcon(ImageProvider.get("dialogs", "valid"));
             lblValid.setToolTipText(null);
@@ -177,5 +179,6 @@
 
         protected void feedbackInvalid() {
-            if ("invalid".equals(getCurrentFeedback())) return;
+            if ("invalid".equals(getCurrentFeedback()))
+                return;
             lblValid.setIcon(ImageProvider.get("warning-small"));
             lblValid.setToolTipText(tr("This changeset query URL is invalid"));
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java	(revision 10179)
@@ -39,6 +39,17 @@
     private final ReferringRelationsBrowserModel model;
     private final transient OsmDataLayer layer;
-    private JCheckBox cbReadFull;
+    private final JCheckBox cbReadFull = new JCheckBox(tr("including immediate children of parent relations"));
     private EditAction editAction;
+
+    /**
+     * Constructs a new {@code ReferringRelationsBrowser}.
+     * @param layer OSM data layer
+     * @param model referrinf relations browser model
+     */
+    public ReferringRelationsBrowser(OsmDataLayer layer, ReferringRelationsBrowserModel model) {
+        this.model = model;
+        this.layer = layer;
+        build();
+    }
 
     /**
@@ -58,5 +69,5 @@
         referrers.getModel().addListDataListener(reloadAction);
         pnl.add(new SideButton(reloadAction));
-        pnl.add(cbReadFull = new JCheckBox(tr("including immediate children of parent relations")));
+        pnl.add(cbReadFull);
 
         editAction = new EditAction();
@@ -64,10 +75,4 @@
         pnl.add(new SideButton(editAction));
         add(pnl, BorderLayout.SOUTH);
-    }
-
-    public ReferringRelationsBrowser(OsmDataLayer layer, ReferringRelationsBrowserModel model) {
-        this.model = model;
-        this.layer = layer;
-        build();
     }
 
@@ -157,7 +162,9 @@
         public void run() {
             int idx = referrers.getSelectedIndex();
-            if (idx < 0) return;
+            if (idx < 0)
+                return;
             Relation r = model.getElementAt(idx);
-            if (r == null) return;
+            if (r == null)
+                return;
             RelationEditor editor = RelationEditor.getEditor(getLayer(), r, null);
             editor.setVisible(true);
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorter.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorter.java	(revision 10179)
@@ -154,5 +154,6 @@
                     list = customMap.get(sorter);
                     if (list == null) {
-                        customMap.put(sorter, list = new LinkedList<>());
+                        list = new LinkedList<>();
+                        customMap.put(sorter, list);
                     }
                     list.add(m);
Index: trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java	(revision 10179)
@@ -47,8 +47,8 @@
 
     /** displays information about the current download area */
-    private JMultilineLabel lblCurrentDownloadArea;
+    private final JMultilineLabel lblCurrentDownloadArea = new JMultilineLabel("");
     private final JosmTextArea bboxDisplay = new JosmTextArea();
     /** the add action */
-    private AddAction actAdd;
+    private final AddAction actAdd = new AddAction();
 
     /**
@@ -84,5 +84,5 @@
         gc.anchor = GridBagConstraints.NORTHWEST;
         gc.insets = new Insets(5, 5, 5, 5);
-        pnl.add(lblCurrentDownloadArea = new JMultilineLabel(""), gc);
+        pnl.add(lblCurrentDownloadArea, gc);
 
         gc.weightx = 1.0;
@@ -98,5 +98,5 @@
         gc.weighty = 0.0;
         gc.insets = new Insets(5, 5, 5, 5);
-        pnl.add(new JButton(actAdd = new AddAction()), gc);
+        pnl.add(new JButton(actAdd), gc);
         return pnl;
     }
@@ -163,5 +163,6 @@
     @Override
     public void setDownloadArea(Bounds area) {
-        if (area == null) return;
+        if (area == null)
+            return;
         this.currentArea = area;
         bookmarks.clearSelection();
Index: trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java	(revision 10179)
@@ -83,6 +83,6 @@
     protected JCheckBox cbDownloadNotes;
     /** the download action and button */
-    private DownloadAction actDownload;
-    protected SideButton btnDownload;
+    private final DownloadAction actDownload = new DownloadAction();
+    protected final SideButton btnDownload = new SideButton(actDownload);
 
     private void makeCheckBoxRespondToEnter(JCheckBox cb) {
@@ -190,5 +190,5 @@
 
         // -- download button
-        pnl.add(btnDownload = new SideButton(actDownload = new DownloadAction()));
+        pnl.add(btnDownload);
         InputMapUtils.enableEnter(btnDownload);
 
@@ -201,5 +201,6 @@
         SideButton btnCancel;
         CancelAction actCancel = new CancelAction();
-        pnl.add(btnCancel = new SideButton(actCancel));
+        btnCancel = new SideButton(actCancel);
+        pnl.add(btnCancel);
         InputMapUtils.enableEnter(btnCancel);
 
@@ -209,6 +210,6 @@
 
         // -- help button
-        SideButton btnHelp;
-        pnl.add(btnHelp = new SideButton(new ContextSensitiveHelpAction(getRootPane().getClientProperty("help").toString())));
+        SideButton btnHelp = new SideButton(new ContextSensitiveHelpAction(getRootPane().getClientProperty("help").toString()));
+        pnl.add(btnHelp);
         InputMapUtils.enableEnter(btnHelp);
 
Index: trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java	(revision 10179)
@@ -83,5 +83,6 @@
         gc.fill = GridBagConstraints.HORIZONTAL;
         gc.anchor = GridBagConstraints.NORTHWEST;
-        add(referenceLatLonViewer = new LatLonViewer(model, PointInTimeType.REFERENCE_POINT_IN_TIME), gc);
+        referenceLatLonViewer = new LatLonViewer(model, PointInTimeType.REFERENCE_POINT_IN_TIME);
+        add(referenceLatLonViewer, gc);
 
         gc.gridx = 1;
@@ -91,5 +92,6 @@
         gc.fill = GridBagConstraints.HORIZONTAL;
         gc.anchor = GridBagConstraints.NORTHWEST;
-        add(currentLatLonViewer = new LatLonViewer(model, PointInTimeType.CURRENT_POINT_IN_TIME), gc);
+        currentLatLonViewer = new LatLonViewer(model, PointInTimeType.CURRENT_POINT_IN_TIME);
+        add(currentLatLonViewer, gc);
 
         // --------------------
@@ -101,5 +103,6 @@
         gc.weightx = 1.0;
         gc.weighty = 0.0;
-        add(distanceViewer = new DistanceViewer(model), gc);
+        distanceViewer = new DistanceViewer(model);
+        add(distanceViewer, gc);
 
         // the map panel
@@ -110,5 +113,6 @@
         gc.weightx = 1.0;
         gc.weighty = 1.0;
-        add(mapViewer = new MapViewer(model), gc);
+        mapViewer = new MapViewer(model);
+        add(mapViewer, gc);
         mapViewer.setZoomContolsVisible(false);
     }
Index: trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java	(revision 10179)
@@ -34,4 +34,21 @@
 
     /**
+     * Constructs a new {@code HistoryBrowser}.
+     */
+    public HistoryBrowser() {
+        model = new HistoryBrowserModel();
+        build();
+    }
+
+    /**
+     * Constructs a new {@code HistoryBrowser}.
+     * @param history the history of an {@link OsmPrimitive}
+     */
+    public HistoryBrowser(History history) {
+        this();
+        populate(history);
+    }
+
+    /**
      * creates the table which shows the list of versions
      *
@@ -40,7 +57,5 @@
     protected JPanel createVersionTablePanel() {
         JPanel pnl = new JPanel(new BorderLayout());
-
-        VersionTable versionTable = new VersionTable(model);
-        pnl.add(new JScrollPane(versionTable), BorderLayout.CENTER);
+        pnl.add(new JScrollPane(new VersionTable(model)), BorderLayout.CENTER);
         return pnl;
     }
@@ -82,12 +97,8 @@
      */
     protected void build() {
-        JPanel left;
-        JPanel right;
+        JPanel left = createVersionTablePanel();
+        JPanel right = createVersionComparePanel();
         setLayout(new BorderLayout());
-        JSplitPane pane = new JSplitPane(
-                JSplitPane.HORIZONTAL_SPLIT,
-                left = createVersionTablePanel(),
-                right = createVersionComparePanel()
-        );
+        JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, left, right);
         add(pane, BorderLayout.CENTER);
 
@@ -100,20 +111,4 @@
     }
 
-    /**
-     * constructor
-     */
-    public HistoryBrowser() {
-        model = new HistoryBrowserModel();
-        build();
-    }
-
-    /**
-     * constructor
-     * @param history  the history of an {@link OsmPrimitive}
-     */
-    public HistoryBrowser(History history) {
-        this();
-        populate(history);
-    }
 
     /**
Index: trunk/src/org/openstreetmap/josm/gui/io/CloseChangesetDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/CloseChangesetDialog.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/io/CloseChangesetDialog.java	(revision 10179)
@@ -61,5 +61,6 @@
         JPanel pnl = new JPanel(new BorderLayout());
         model = new DefaultListModel<>();
-        pnl.add(new JScrollPane(lstOpenChangesets = new JList<>(model)), BorderLayout.CENTER);
+        lstOpenChangesets = new JList<>(model);
+        pnl.add(new JScrollPane(lstOpenChangesets), BorderLayout.CENTER);
         lstOpenChangesets.setCellRenderer(new ChangesetCellRenderer());
         return pnl;
@@ -72,10 +73,11 @@
         CloseAction closeAction = new CloseAction();
         lstOpenChangesets.addListSelectionListener(closeAction);
-        pnl.add(btnCloseChangesets = new SideButton(closeAction));
+        btnCloseChangesets = new SideButton(closeAction);
+        pnl.add(btnCloseChangesets);
         InputMapUtils.enableEnter(btnCloseChangesets);
 
         // -- cancel action
-        SideButton btn;
-        pnl.add(btn = new SideButton(new CancelAction()));
+        SideButton btn = new SideButton(new CancelAction());
+        pnl.add(btn);
         btn.setFocusable(true);
         return pnl;
Index: trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java	(revision 10179)
@@ -117,5 +117,6 @@
     public void prepareForOsmApiCredentials(String username, String password) {
         setTitle(tr("Enter credentials for OSM API"));
-        getContentPane().add(pnlCredentials = new OsmApiCredentialsPanel(this), BorderLayout.CENTER);
+        pnlCredentials = new OsmApiCredentialsPanel(this);
+        getContentPane().add(pnlCredentials, BorderLayout.CENTER);
         pnlCredentials.init(username, password);
         validate();
@@ -124,5 +125,6 @@
     public void prepareForOtherHostCredentials(String username, String password, String host) {
         setTitle(tr("Enter credentials for host"));
-        getContentPane().add(pnlCredentials = new OtherHostCredentialsPanel(this, host), BorderLayout.CENTER);
+        pnlCredentials = new OtherHostCredentialsPanel(this, host);
+        getContentPane().add(pnlCredentials, BorderLayout.CENTER);
         pnlCredentials.init(username, password);
         validate();
@@ -131,5 +133,6 @@
     public void prepareForProxyCredentials(String username, String password) {
         setTitle(tr("Enter credentials for HTTP proxy"));
-        getContentPane().add(pnlCredentials = new HttpProxyCredentialsPanel(this), BorderLayout.CENTER);
+        pnlCredentials = new HttpProxyCredentialsPanel(this);
+        getContentPane().add(pnlCredentials, BorderLayout.CENTER);
         pnlCredentials.init(username, password);
         validate();
@@ -137,15 +140,18 @@
 
     public String getUsername() {
-        if (pnlCredentials == null) return null;
+        if (pnlCredentials == null)
+            return null;
         return pnlCredentials.getUserName();
     }
 
     public char[] getPassword() {
-        if (pnlCredentials == null) return null;
+        if (pnlCredentials == null)
+            return null;
         return pnlCredentials.getPassword();
     }
 
     public boolean isSaveCredentials() {
-        if (pnlCredentials == null) return false;
+        if (pnlCredentials == null)
+            return false;
         return pnlCredentials.isSaveCredentials();
     }
@@ -155,6 +161,6 @@
         protected JosmPasswordField tfPassword;
         protected JCheckBox cbSaveCredentials;
-        protected JMultilineLabel lblHeading;
-        protected JMultilineLabel lblWarning;
+        protected final JMultilineLabel lblHeading = new JMultilineLabel("");
+        protected final JMultilineLabel lblWarning = new JMultilineLabel("");
         protected CredentialDialog owner; // owner Dependency Injection to use Key listeners for username and password text fields
 
@@ -176,5 +182,5 @@
             gc.weighty = 0.0;
             gc.insets = new Insets(0, 0, 10, 0);
-            add(lblHeading = new JMultilineLabel(""), gc);
+            add(lblHeading, gc);
 
             gc.gridx = 0;
@@ -208,5 +214,4 @@
             gc.weightx = 1.0;
             gc.weighty = 0.0;
-            lblWarning = new JMultilineLabel("");
             lblWarning.setFont(lblWarning.getFont().deriveFont(Font.ITALIC));
             add(lblWarning, gc);
Index: trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java	(revision 10179)
@@ -67,11 +67,22 @@
     private SaveLayersModel model;
     private UserAction action = UserAction.CANCEL;
-    private UploadAndSaveProgressRenderer pnlUploadLayers;
-
-    private SaveAndProceedAction saveAndProceedAction;
-    private SaveSessionAction saveSessionAction;
-    private DiscardAndProceedAction discardAndProceedAction;
-    private CancelAction cancelAction;
+    private final UploadAndSaveProgressRenderer pnlUploadLayers = new UploadAndSaveProgressRenderer();
+
+    private final SaveAndProceedAction saveAndProceedAction = new SaveAndProceedAction();
+    private final SaveSessionAction saveSessionAction = new SaveSessionAction();
+    private final DiscardAndProceedAction discardAndProceedAction = new DiscardAndProceedAction();
+    private final CancelAction cancelAction = new CancelAction();
     private transient SaveAndUploadTask saveAndUploadTask;
+
+    private final JButton saveAndProceedActionButton = new JButton(saveAndProceedAction);
+
+    /**
+     * Constructs a new {@code SaveLayersDialog}.
+     * @param parent parent component
+     */
+    public SaveLayersDialog(Component parent) {
+        super(GuiHelper.getFrameForComponent(parent), ModalityType.DOCUMENT_MODAL);
+        build();
+    }
 
     /**
@@ -96,6 +107,4 @@
     }
 
-    private JButton saveAndProceedActionButton;
-
     /**
      * builds the button row
@@ -106,20 +115,16 @@
         JPanel pnl = new JPanel(new GridBagLayout());
 
-        saveAndProceedAction = new SaveAndProceedAction();
         model.addPropertyChangeListener(saveAndProceedAction);
-        pnl.add(saveAndProceedActionButton = new JButton(saveAndProceedAction), GBC.std(0, 0).insets(5, 5, 0, 0).fill(GBC.HORIZONTAL));
-
-        saveSessionAction = new SaveSessionAction();
+        pnl.add(saveAndProceedActionButton, GBC.std(0, 0).insets(5, 5, 0, 0).fill(GBC.HORIZONTAL));
+
         pnl.add(new JButton(saveSessionAction), GBC.std(1, 0).insets(5, 5, 5, 0).fill(GBC.HORIZONTAL));
 
-        discardAndProceedAction = new DiscardAndProceedAction();
         model.addPropertyChangeListener(discardAndProceedAction);
         pnl.add(new JButton(discardAndProceedAction), GBC.std(0, 1).insets(5, 5, 0, 5).fill(GBC.HORIZONTAL));
 
-        cancelAction = new CancelAction();
         pnl.add(new JButton(cancelAction), GBC.std(1, 1).insets(5, 5, 5, 5).fill(GBC.HORIZONTAL));
 
         JPanel pnl2 = new JPanel(new BorderLayout());
-        pnl2.add(pnlUploadLayers = new UploadAndSaveProgressRenderer(), BorderLayout.CENTER);
+        pnl2.add(pnlUploadLayers, BorderLayout.CENTER);
         model.addPropertyChangeListener(pnlUploadLayers);
         pnl2.add(pnl, BorderLayout.SOUTH);
@@ -137,9 +142,4 @@
         this.saveAndProceedAction.initForSaveAndDelete();
         this.discardAndProceedAction.initForDiscardAndDelete();
-    }
-
-    public SaveLayersDialog(Component parent) {
-        super(GuiHelper.getFrameForComponent(parent), ModalityType.DOCUMENT_MODAL);
-        build();
     }
 
@@ -311,6 +311,8 @@
         public void cancel() {
             switch(model.getMode()) {
-            case EDITING_DATA: cancelWhenInEditingModel(); break;
-            case UPLOADING_AND_SAVING: cancelSafeAndUploadTask(); break;
+            case EDITING_DATA: cancelWhenInEditingModel();
+                break;
+            case UPLOADING_AND_SAVING: cancelSafeAndUploadTask();
+                break;
             }
         }
@@ -350,6 +352,8 @@
                 Mode mode = (Mode) evt.getNewValue();
                 switch(mode) {
-                case EDITING_DATA: setEnabled(true); break;
-                case UPLOADING_AND_SAVING: setEnabled(false); break;
+                case EDITING_DATA: setEnabled(true);
+                    break;
+                case UPLOADING_AND_SAVING: setEnabled(false);
+                    break;
                 }
             }
@@ -433,6 +437,8 @@
                 SaveLayersModel.Mode mode = (SaveLayersModel.Mode) evt.getNewValue();
                 switch(mode) {
-                case EDITING_DATA: setEnabled(true); break;
-                case UPLOADING_AND_SAVING: setEnabled(false); break;
+                case EDITING_DATA: setEnabled(true);
+                    break;
+                case UPLOADING_AND_SAVING: setEnabled(false);
+                    break;
                 }
             }
@@ -560,5 +566,6 @@
         protected void warnBecauseOfUnsavedData() {
             int numProblems = model.getNumCancel() + model.getNumFailed();
-            if (numProblems == 0) return;
+            if (numProblems == 0)
+                return;
             Main.warn(numProblems + " problems occured during upload/save");
             String msg = trn(
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java	(revision 10179)
@@ -51,6 +51,6 @@
 public class UploadSelectionDialog extends JDialog {
 
-    private OsmPrimitiveList lstSelectedPrimitives;
-    private OsmPrimitiveList lstDeletedPrimitives;
+    private final OsmPrimitiveList lstSelectedPrimitives = new OsmPrimitiveList();
+    private final OsmPrimitiveList lstDeletedPrimitives = new OsmPrimitiveList();
     private JSplitPane spLists;
     private boolean canceled;
@@ -71,5 +71,5 @@
         lbl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
         pnl.add(lbl, BorderLayout.NORTH);
-        pnl.add(new JScrollPane(lstSelectedPrimitives = new OsmPrimitiveList()), BorderLayout.CENTER);
+        pnl.add(new JScrollPane(lstSelectedPrimitives), BorderLayout.CENTER);
         lbl.setLabelFor(lstSelectedPrimitives);
         return pnl;
@@ -81,5 +81,5 @@
         lbl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
         pnl.add(lbl, BorderLayout.NORTH);
-        pnl.add(new JScrollPane(lstDeletedPrimitives = new OsmPrimitiveList()), BorderLayout.CENTER);
+        pnl.add(new JScrollPane(lstDeletedPrimitives), BorderLayout.CENTER);
         lbl.setLabelFor(lstDeletedPrimitives);
         return pnl;
@@ -89,5 +89,6 @@
         JPanel pnl = new JPanel(new FlowLayout());
         ContinueAction continueAction = new ContinueAction();
-        pnl.add(btnContinue = new SideButton(continueAction));
+        btnContinue = new SideButton(continueAction);
+        pnl.add(btnContinue);
         btnContinue.setFocusable(true);
         lstDeletedPrimitives.getSelectionModel().addListSelectionListener(continueAction);
@@ -176,16 +177,16 @@
 
     static class OsmPrimitiveList extends JList<OsmPrimitive> {
+        OsmPrimitiveList() {
+            this(new OsmPrimitiveListModel());
+        }
+
+        OsmPrimitiveList(OsmPrimitiveListModel model) {
+            super(model);
+            init();
+        }
+
         protected void init() {
             setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
             setCellRenderer(new OsmPrimitivRenderer());
-        }
-
-        OsmPrimitiveList() {
-            this(new OsmPrimitiveListModel());
-        }
-
-        OsmPrimitiveList(OsmPrimitiveListModel model) {
-            super(model);
-            init();
         }
 
@@ -208,5 +209,6 @@
                         public int compare(OsmPrimitive o1, OsmPrimitive o2) {
                             int ret = OsmPrimitiveType.from(o1).compareTo(OsmPrimitiveType.from(o2));
-                            if (ret != 0) return ret;
+                            if (ret != 0)
+                                return ret;
                             return o1.getDisplayName(formatter).compareTo(o1.getDisplayName(formatter));
                         }
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java	(revision 10179)
@@ -56,8 +56,10 @@
     private transient Map<UploadStrategy, JLabel> lblNumRequests;
     private transient Map<UploadStrategy, JMultilineLabel> lblStrategies;
-    private JosmTextField tfChunkSize;
-    private JPanel pnlMultiChangesetPolicyPanel;
-    private JRadioButton rbFillOneChangeset;
-    private JRadioButton rbUseMultipleChangesets;
+    private final JosmTextField tfChunkSize = new JosmTextField(4);
+    private final JPanel pnlMultiChangesetPolicyPanel = new JPanel(new GridBagLayout());
+    private final JRadioButton rbFillOneChangeset = new JRadioButton(
+            tr("Fill up one changeset and return to the Upload Dialog"));
+    private final JRadioButton rbUseMultipleChangesets = new JRadioButton(
+            tr("Open and use as many new changesets as necessary"));
     private JMultilineLabel lblMultiChangesetPoliciesHeader;
 
@@ -138,5 +140,5 @@
         gc.weighty = 0.0;
         gc.gridwidth = 1;
-        pnl.add(tfChunkSize = new JosmTextField(4), gc);
+        pnl.add(tfChunkSize, gc);
         gc.gridx = 3;
         gc.gridy = 2;
@@ -181,5 +183,4 @@
 
     protected JPanel buildMultiChangesetPolicyPanel() {
-        pnlMultiChangesetPolicyPanel = new JPanel(new GridBagLayout());
         GridBagConstraints gc = new GridBagConstraints();
         gc.gridx = 0;
@@ -188,14 +189,13 @@
         gc.anchor = GridBagConstraints.FIRST_LINE_START;
         gc.weightx = 1.0;
-        pnlMultiChangesetPolicyPanel.add(lblMultiChangesetPoliciesHeader = new JMultilineLabel(
+        lblMultiChangesetPoliciesHeader = new JMultilineLabel(
                 tr("<html>There are <strong>multiple changesets</strong> necessary in order to upload {0} objects. " +
                    "Which strategy do you want to use?</html>",
-                        numUploadedObjects)), gc);
+                        numUploadedObjects));
+        pnlMultiChangesetPolicyPanel.add(lblMultiChangesetPoliciesHeader, gc);
         gc.gridy = 1;
-        pnlMultiChangesetPolicyPanel.add(rbFillOneChangeset = new JRadioButton(
-                tr("Fill up one changeset and return to the Upload Dialog")), gc);
-        gc.gridy = 2;
-        pnlMultiChangesetPolicyPanel.add(rbUseMultipleChangesets = new JRadioButton(
-                tr("Open and use as many new changesets as necessary")), gc);
+        pnlMultiChangesetPolicyPanel.add(rbFillOneChangeset, gc);
+        gc.gridy = 2;
+        pnlMultiChangesetPolicyPanel.add(rbUseMultipleChangesets, gc);
 
         ButtonGroup bgMultiChangesetPolicies = new ButtonGroup();
@@ -473,5 +473,6 @@
         public void itemStateChanged(ItemEvent e) {
             UploadStrategy strategy = getUploadStrategy();
-            if (strategy == null) return;
+            if (strategy == null)
+                return;
             switch(strategy) {
             case CHUNKED_DATASET_STRATEGY:
Index: trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 10179)
@@ -1580,7 +1580,7 @@
                 int offset = 200;
                 for (String part: cachedTileLoader.getStats().split("\n")) {
-                    myDrawString(g, tr("Cache stats: {0}", part), 50, offset += 15);
-                }
-
+                    offset += 15;
+                    myDrawString(g, tr("Cache stats: {0}", part), 50, offset);
+                }
             }
         }
Index: trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java	(revision 10179)
@@ -103,5 +103,6 @@
 
     public double getPPD() {
-        if (!Main.isDisplayingMapView()) return Main.getProjection().getDefaultZoomInPPD();
+        if (!Main.isDisplayingMapView())
+            return Main.getProjection().getDefaultZoomInPPD();
         ProjectionBounds bounds = Main.map.mapView.getProjectionBounds();
         return Main.map.mapView.getWidth() / (bounds.maxEast - bounds.minEast);
@@ -122,7 +123,13 @@
 
     public void displace(double dx, double dy) {
-        setOffset(this.dx += dx, this.dy += dy);
-    }
-
+        this.dx += dx;
+        this.dy += dy;
+        setOffset(this.dx, this.dy);
+    }
+
+    /**
+     * Returns imagery info.
+     * @return imagery info
+     */
     public ImageryInfo getInfo() {
         return info;
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintMenu.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintMenu.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintMenu.java	(revision 10179)
@@ -98,5 +98,6 @@
             MapPaintAction a = actions.get(k);
             if (a == null) {
-                actions.put(k, a = new MapPaintAction(style));
+                a = new MapPaintAction(style);
+                actions.put(k, a);
                 add(a.getButton());
             } else {
Index: trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java	(revision 10179)
@@ -37,6 +37,19 @@
 public class PreferenceDialog extends JDialog {
 
-    private PreferenceTabbedPane tpPreferences;
+    private final PreferenceTabbedPane tpPreferences = new PreferenceTabbedPane();
     private boolean canceled;
+
+    /**
+     * Constructs a new {@code PreferenceDialog}.
+     * @param parent parent component
+     */
+    public PreferenceDialog(Component parent) {
+        super(GuiHelper.getFrameForComponent(parent), tr("Preferences"), ModalityType.DOCUMENT_MODAL);
+        build();
+        this.setMinimumSize(new Dimension(600, 350));
+        // set the maximum width to the current screen. If the dialog is opened on a
+        // smaller screen than before, this will reset the stored preference.
+        this.setMaximumSize(GuiHelper.getScreenSize());
+    }
 
     protected JPanel buildActionPanel() {
@@ -65,5 +78,5 @@
         Container c = getContentPane();
         c.setLayout(new BorderLayout());
-        c.add(tpPreferences = new PreferenceTabbedPane(), BorderLayout.CENTER);
+        c.add(tpPreferences, BorderLayout.CENTER);
         tpPreferences.buildGui();
         tpPreferences.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
@@ -75,13 +88,4 @@
         getRootPane().getActionMap().put("cancel", new CancelAction());
         HelpUtil.setHelpContext(getRootPane(), HelpUtil.ht("/Action/Preferences"));
-    }
-
-    public PreferenceDialog(Component parent) {
-        super(GuiHelper.getFrameForComponent(parent), tr("Preferences"), ModalityType.DOCUMENT_MODAL);
-        build();
-        this.setMinimumSize(new Dimension(600, 350));
-        // set the maximum width to the current screen. If the dialog is opened on a
-        // smaller screen than before, this will reset the stored preference.
-        this.setMaximumSize(GuiHelper.getScreenSize());
     }
 
@@ -126,12 +130,24 @@
     }
 
+    /**
+     * Select preferences tab by name.
+     * @param name preferences tab name (icon)
+     */
     public void selectPreferencesTabByName(String name) {
         tpPreferences.selectTabByName(name);
     }
 
+    /**
+     * Select preferences tab by class.
+     * @param clazz preferences tab class
+     */
     public void selectPreferencesTabByClass(Class<? extends TabPreferenceSetting> clazz) {
         tpPreferences.selectTabByPref(clazz);
     }
 
+    /**
+     * Select preferences sub-tab by class.
+     * @param clazz preferences sub-tab class
+     */
     public void selectSubPreferencesTabByClass(Class<? extends SubPreferenceSetting> clazz) {
         tpPreferences.selectSubTabByPref(clazz);
Index: trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 10179)
@@ -1486,5 +1486,6 @@
                         Matcher m = Pattern.compile("^(.+);(.+)$").matcher(line);
                         if (m.matches()) {
-                            sources.add(last = new ExtendedSourceEntry(m.group(1), m.group(2)));
+                            last = new ExtendedSourceEntry(m.group(1), m.group(2));
+                            sources.add(last);
                         } else {
                             Main.error(tr(getStr(I18nString.ILLEGAL_FORMAT_OF_ENTRY), url, line));
@@ -1528,5 +1529,5 @@
 
     class FileOrUrlCellEditor extends JPanel implements TableCellEditor {
-        private JosmTextField tfFileName;
+        private final JosmTextField tfFileName = new JosmTextField();
         private final CopyOnWriteArrayList<CellEditorListener> listeners;
         private String value;
@@ -1544,5 +1545,5 @@
             gc.weightx = 1.0;
             gc.weighty = 1.0;
-            add(tfFileName = new JosmTextField(), gc);
+            add(tfFileName, gc);
 
             gc.gridx = 1;
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 10179)
@@ -682,11 +682,15 @@
         private JPanel actionParametersPanel;
 
-        private JButton upButton;
-        private JButton downButton;
-        private JButton removeButton;
-        private JButton addButton;
+        private final JButton upButton = createButton("up");
+        private final JButton downButton = createButton("down");
+        private final JButton removeButton = createButton(">");
+        private final JButton addButton = createButton("<");
 
         private String movingComponent;
 
+        /**
+         * Constructs a new {@code Settings}.
+         * @param rootActionsNode root actions node
+         */
         public Settings(DefaultMutableTreeNode rootActionsNode) {
             super(/* ICON(preferences/) */ "toolbar", tr("Toolbar customization"), tr("Customize the elements on the toolbar."));
@@ -815,8 +819,8 @@
 
             final JPanel buttons = new JPanel(new GridLayout(6, 1));
-            buttons.add(upButton = createButton("up"));
-            buttons.add(addButton = createButton("<"));
-            buttons.add(removeButton = createButton(">"));
-            buttons.add(downButton = createButton("down"));
+            buttons.add(upButton);
+            buttons.add(addButton);
+            buttons.add(removeButton);
+            buttons.add(downButton);
             updateEnabledState();
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java	(revision 10179)
@@ -66,5 +66,6 @@
         add(formats, GBC.eol().fill());
 
-        add(wmsInstruction = new JLabel(tr("4. Verify generated WMS URL")), GBC.eol());
+        wmsInstruction = new JLabel(tr("4. Verify generated WMS URL"));
+        add(wmsInstruction, GBC.eol());
         wmsInstruction.setLabelFor(wmsUrl);
         add(wmsUrl, GBC.eop().fill());
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java	(revision 10179)
@@ -79,7 +79,7 @@
     private ImageryLayerInfo layerInfo;
 
-    private CommonSettingsPanel commonSettings;
-    private WMSSettingsPanel wmsSettings;
-    private TMSSettingsPanel tmsSettings;
+    private final CommonSettingsPanel commonSettings = new CommonSettingsPanel();
+    private final WMSSettingsPanel wmsSettings = new WMSSettingsPanel();
+    private final TMSSettingsPanel tmsSettings = new TMSSettingsPanel();
 
     /**
@@ -115,8 +115,8 @@
         p.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
 
-        addSettingsSection(p, tr("Common Settings"), commonSettings = new CommonSettingsPanel());
-        addSettingsSection(p, tr("WMS Settings"), wmsSettings = new WMSSettingsPanel(),
+        addSettingsSection(p, tr("Common Settings"), commonSettings);
+        addSettingsSection(p, tr("WMS Settings"), wmsSettings,
                 GBC.eol().fill(GBC.HORIZONTAL));
-        addSettingsSection(p, tr("TMS Settings"), tmsSettings = new TMSSettingsPanel(),
+        addSettingsSection(p, tr("TMS Settings"), tmsSettings,
                 GBC.eol().fill(GBC.HORIZONTAL));
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java	(revision 10179)
@@ -46,8 +46,9 @@
 
         static Policy fromPreferenceValue(String preferenceValue) {
-            if (preferenceValue == null) return null;
-            preferenceValue = preferenceValue.trim().toLowerCase(Locale.ENGLISH);
+            if (preferenceValue == null)
+                return null;
+            String prefValue = preferenceValue.trim().toLowerCase(Locale.ENGLISH);
             for (Policy p: Policy.values()) {
-                if (p.getPreferencesValue().equals(preferenceValue))
+                if (p.getPreferencesValue().equals(prefValue))
                     return p;
             }
@@ -58,6 +59,14 @@
     private transient Map<Policy, JRadioButton> rbVersionBasedUpatePolicy;
     private transient Map<Policy, JRadioButton> rbTimeBasedUpatePolicy;
-    private JosmTextField tfUpdateInterval;
-    private JLabel lblUpdateInterval;
+    private final JosmTextField tfUpdateInterval = new JosmTextField(5);
+    private final JLabel lblUpdateInterval = new JLabel(tr("Update interval (in days):"));
+
+    /**
+     * Constructs a new {@code PluginUpdatePolicyPanel}.
+     */
+    public PluginUpdatePolicyPanel() {
+        build();
+        initFromPreferences();
+    }
 
     protected JPanel buildVersionBasedUpdatePolicyPanel() {
@@ -95,6 +104,6 @@
     protected JPanel buildUpdateIntervalPanel() {
         JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
-        pnl.add(lblUpdateInterval = new JLabel(tr("Update interval (in days):")));
-        pnl.add(tfUpdateInterval = new JosmTextField(5));
+        pnl.add(lblUpdateInterval);
+        pnl.add(tfUpdateInterval);
         lblUpdateInterval.setLabelFor(tfUpdateInterval);
         SelectAllOnFocusGainedDecorator.decorate(tfUpdateInterval);
@@ -160,14 +169,5 @@
 
     /**
-     * Constructs a new {@code PluginUpdatePolicyPanel}.
-     */
-    public PluginUpdatePolicyPanel() {
-        build();
-        initFromPreferences();
-    }
-
-    /**
      * Loads the relevant preference values from the JOSM preferences
-     *
      */
     public final void initFromPreferences() {
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java	(revision 10179)
@@ -47,6 +47,6 @@
     private static class CodeSelectionPanel extends JPanel implements ListSelectionListener, DocumentListener {
 
-        public JosmTextField filter;
-        private ProjectionCodeListModel model;
+        public final JosmTextField filter = new JosmTextField(30);
+        private final ProjectionCodeListModel model = new ProjectionCodeListModel();
         public JList<String> selectionList;
         private final List<String> data;
@@ -89,10 +89,9 @@
 
         private void build() {
-            filter = new JosmTextField(30);
             filter.setColumns(10);
             filter.getDocument().addDocumentListener(this);
 
             selectionList = new JList<>(data.toArray(new String[0]));
-            selectionList.setModel(model = new ProjectionCodeListModel());
+            selectionList.setModel(model);
             JScrollPane scroll = new JScrollPane(selectionList);
             scroll.setPreferredSize(new Dimension(200, 214));
@@ -105,5 +104,6 @@
         public String getCode() {
             int idx = selectionList.getSelectedIndex();
-            if (idx == -1) return lastCode;
+            if (idx == -1)
+                return lastCode;
             return filteredData.get(selectionList.getSelectedIndex());
         }
@@ -174,5 +174,6 @@
                 if (matcher2.matches()) {
                     int cmp1 = matcher1.group(1).compareTo(matcher2.group(1));
-                    if (cmp1 != 0) return cmp1;
+                    if (cmp1 != 0)
+                        return cmp1;
                     int num1 = Integer.parseInt(matcher1.group(2));
                     int num2 = Integer.parseInt(matcher2.group(2));
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java	(revision 10179)
@@ -69,6 +69,43 @@
     private static Map<String, ProjectionChoice> projectionChoicesById = new HashMap<>();
 
-    // some ProjectionChoices that are referenced from other parts of the code
-    public static final ProjectionChoice wgs84, mercator, lambert, utm_france_dom, lambert_cc9;
+    /**
+     * WGS84: Directly use latitude / longitude values as x/y.
+     */
+    public static final ProjectionChoice wgs84 = registerProjectionChoice(tr("WGS84 Geographic"), "core:wgs84", 4326, "epsg4326");
+
+    /**
+     * Mercator Projection.
+     *
+     * The center of the mercator projection is always the 0 grad coordinate.
+     *
+     * See also USGS Bulletin 1532 (http://pubs.usgs.gov/bul/1532/report.pdf)
+     * initially EPSG used 3785 but that has been superseded by 3857, see https://www.epsg-registry.org/
+     */
+    public static final ProjectionChoice mercator = registerProjectionChoice(tr("Mercator"), "core:mercator", 3857);
+
+    /**
+     * Lambert conic conform 4 zones using the French geodetic system NTF.
+     *
+     * This newer version uses the grid translation NTF<->RGF93 provided by IGN for a submillimetric accuracy.
+     * (RGF93 is the French geodetic system similar to WGS84 but not mathematically equal)
+     *
+     * Source: http://geodesie.ign.fr/contenu/fichiers/Changement_systeme_geodesique.pdf
+     */
+    public static final ProjectionChoice lambert = new LambertProjectionChoice();
+
+    /**
+     * French departements in the Caribbean Sea and Indian Ocean.
+     *
+     * Using the UTM transvers Mercator projection and specific geodesic settings.
+     */
+    public static final ProjectionChoice utm_france_dom = new UTMFranceDOMProjectionChoice();
+
+    /**
+     * Lambert Conic Conform 9 Zones projection.
+     *
+     * As specified by the IGN in this document
+     * http://geodesie.ign.fr/contenu/fichiers/documentation/rgf93/cc9zones.pdf
+     */
+    public static final ProjectionChoice lambert_cc9 = new LambertCC9ZonesProjectionChoice();
 
     static {
@@ -77,22 +114,4 @@
          * Global projections.
          */
-
-        /**
-         * WGS84: Directly use latitude / longitude values as x/y.
-         */
-        wgs84 = registerProjectionChoice(tr("WGS84 Geographic"), "core:wgs84", 4326, "epsg4326");
-
-        /**
-         * Mercator Projection.
-         *
-         * The center of the mercator projection is always the 0 grad
-         * coordinate.
-         *
-         * See also USGS Bulletin 1532
-         * (http://pubs.usgs.gov/bul/1532/report.pdf)
-         * initially EPSG used 3785 but that has been superseded by 3857,
-         * see https://www.epsg-registry.org/
-         */
-        mercator = registerProjectionChoice(tr("Mercator"), "core:mercator", 3857);
 
         /**
@@ -156,5 +175,5 @@
          * @author Pieren
          */
-        registerProjectionChoice(lambert = new LambertProjectionChoice());                          // FR
+        registerProjectionChoice(lambert);                                                          // FR
 
         /**
@@ -174,5 +193,5 @@
          * @author Pieren
          */
-        registerProjectionChoice(lambert_cc9 = new LambertCC9ZonesProjectionChoice());              // FR
+        registerProjectionChoice(lambert_cc9);                                                      // FR
 
         /**
@@ -181,5 +200,5 @@
          * Using the UTM transvers Mercator projection and specific geodesic settings.
          */
-        registerProjectionChoice(utm_france_dom = new UTMFranceDOMProjectionChoice());              // FR
+        registerProjectionChoice(utm_france_dom);                                                   // FR
 
         /**
@@ -281,9 +300,9 @@
     private final JPanel projSubPrefPanelWrapper = new JPanel(new GridBagLayout());
 
-    private JLabel projectionCodeLabel;
-    private Component projectionCodeGlue;
+    private JLabel projectionCodeLabel = new JLabel(tr("Projection code"));
+    private Component projectionCodeGlue = GBC.glue(5, 0);
     private final JLabel projectionCode = new JLabel();
-    private JLabel projectionNameLabel;
-    private Component projectionNameGlue;
+    private final JLabel projectionNameLabel = new JLabel(tr("Projection name"));
+    private final Component projectionNameGlue = GBC.glue(5, 0);
     private final JLabel projectionName = new JLabel();
     private final JLabel bounds = new JLabel();
@@ -323,9 +342,9 @@
         projPanel.add(GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL));
         projPanel.add(projectionCombo, GBC.eop().fill(GBC.HORIZONTAL).insets(0, 5, 5, 5));
-        projPanel.add(projectionCodeLabel = new JLabel(tr("Projection code")), GBC.std().insets(25, 5, 0, 5));
-        projPanel.add(projectionCodeGlue = GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL));
+        projPanel.add(projectionCodeLabel, GBC.std().insets(25, 5, 0, 5));
+        projPanel.add(projectionCodeGlue, GBC.std().fill(GBC.HORIZONTAL));
         projPanel.add(projectionCode, GBC.eop().fill(GBC.HORIZONTAL).insets(0, 5, 5, 5));
-        projPanel.add(projectionNameLabel = new JLabel(tr("Projection name")), GBC.std().insets(25, 5, 0, 5));
-        projPanel.add(projectionNameGlue = GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL));
+        projPanel.add(projectionNameLabel, GBC.std().insets(25, 5, 0, 5));
+        projPanel.add(projectionNameGlue, GBC.std().fill(GBC.HORIZONTAL));
         projPanel.add(projectionName, GBC.eop().fill(GBC.HORIZONTAL).insets(0, 5, 5, 5));
         projPanel.add(new JLabel(tr("Bounds")), GBC.std().insets(25, 5, 0, 5));
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java	(revision 10179)
@@ -25,18 +25,15 @@
 
 /**
- * This is the preference panel for the authentication method and the authentication
- * parameters.
- *
+ * This is the preference panel for the authentication method and the authentication parameters.
+ * @since 2745
  */
 public class AuthenticationPreferencesPanel extends VerticallyScrollablePanel implements PropertyChangeListener {
 
     /** indicates whether we use basic authentication */
-    private JRadioButton rbBasicAuthentication;
+    private final JRadioButton rbBasicAuthentication = new JRadioButton();
     /** indicates whether we use OAuth as authentication scheme */
-    private JRadioButton rbOAuth;
-    /** the panel which contains the authentication parameters for the respective
-     * authentication scheme
-     */
-    private JPanel pnlAuthenticationParameteters;
+    private final JRadioButton rbOAuth = new JRadioButton();
+    /** the panel which contains the authentication parameters for the respective authentication scheme */
+    private final JPanel pnlAuthenticationParameteters = new JPanel(new BorderLayout());
     /** the panel for the basic authentication parameters */
     private BasicAuthenticationPreferencesPanel pnlBasicAuthPreferences;
@@ -45,4 +42,13 @@
     /** the panel for messages notifier preferences */
     private FeaturesPanel pnlFeaturesPreferences;
+
+    /**
+     * Constructs a new {@code AuthenticationPreferencesPanel}.
+     */
+    public AuthenticationPreferencesPanel() {
+        build();
+        initFromPreferences();
+        HelpUtil.setHelpContext(this, HelpUtil.ht("/Preferences/Connection#AuthenticationSettings"));
+    }
 
     /**
@@ -61,5 +67,5 @@
         gc.weightx = 1.0;
         gc.insets = new Insets(0, 0, 0, 3);
-        add(rbBasicAuthentication = new JRadioButton(), gc);
+        add(rbBasicAuthentication, gc);
         rbBasicAuthentication.setText(tr("Use Basic Authentication"));
         rbBasicAuthentication.setToolTipText(tr("Select to use HTTP basic authentication with your OSM username and password"));
@@ -69,5 +75,5 @@
         gc.gridx = 0;
         gc.weightx = 0.0;
-        add(rbOAuth = new JRadioButton(), gc);
+        add(rbOAuth, gc);
         rbOAuth.setText(tr("Use OAuth"));
         rbOAuth.setToolTipText(tr("Select to use OAuth as authentication mechanism"));
@@ -86,5 +92,4 @@
         gc.weightx = 1.0;
         gc.weighty = 1.0;
-        pnlAuthenticationParameteters = new JPanel(new BorderLayout());
         add(pnlAuthenticationParameteters, gc);
 
@@ -104,13 +109,4 @@
         pnlFeaturesPreferences = new FeaturesPanel();
         add(pnlFeaturesPreferences, gc);
-    }
-
-    /**
-     * Constructs a new {@code AuthenticationPreferencesPanel}.
-     */
-    public AuthenticationPreferencesPanel() {
-        build();
-        initFromPreferences();
-        HelpUtil.setHelpContext(this, HelpUtil.ht("/Preferences/Connection#AuthenticationSettings"));
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java	(revision 10179)
@@ -25,16 +25,22 @@
 
 /**
- * The preferences panel for parameters necessary for the Basic Authentication
- * Scheme.
- *
+ * The preferences panel for parameters necessary for the Basic Authentication Scheme.
+ * @since 2745
  */
 public class BasicAuthenticationPreferencesPanel extends JPanel {
 
     /** the OSM user name */
-    private JosmTextField tfOsmUserName;
+    private final JosmTextField tfOsmUserName = new JosmTextField();
     /** the OSM password */
-    private JosmPasswordField tfOsmPassword;
+    private final JosmPasswordField tfOsmPassword = new JosmPasswordField();
     /** a panel with further information, e.g. some warnings */
     private JPanel decorationPanel;
+
+    /**
+     * Constructs a new {@code BasicAuthenticationPreferencesPanel}.
+     */
+    public BasicAuthenticationPreferencesPanel() {
+        build();
+    }
 
     /**
@@ -55,5 +61,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        add(tfOsmUserName = new JosmTextField(), gc);
+        add(tfOsmUserName, gc);
         SelectAllOnFocusGainedDecorator.decorate(tfOsmUserName);
         UserNameValidator valUserName = new UserNameValidator(tfOsmUserName);
@@ -68,5 +74,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        add(tfOsmPassword = new JosmPasswordField(), gc);
+        add(tfOsmPassword, gc);
         SelectAllOnFocusGainedDecorator.decorate(tfOsmPassword);
         tfOsmPassword.setToolTipText(tr("Please enter your OSM password"));
@@ -82,11 +88,4 @@
         decorationPanel = new JPanel(new BorderLayout());
         add(decorationPanel, gc);
-    }
-
-    /**
-     * Constructs a new {@code BasicAuthenticationPreferencesPanel}.
-     */
-    public BasicAuthenticationPreferencesPanel() {
-        build();
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java	(revision 10179)
@@ -46,11 +46,11 @@
  */
 public class OAuthAuthenticationPreferencesPanel extends JPanel implements PropertyChangeListener {
-    private JPanel pnlAuthorisationMessage;
-    private NotYetAuthorisedPanel pnlNotYetAuthorised;
-    private AlreadyAuthorisedPanel pnlAlreadyAuthorised;
-    private AdvancedOAuthPropertiesPanel pnlAdvancedProperties;
+    private final JPanel pnlAuthorisationMessage = new JPanel(new BorderLayout());
+    private final NotYetAuthorisedPanel pnlNotYetAuthorised = new NotYetAuthorisedPanel();
+    private final AlreadyAuthorisedPanel pnlAlreadyAuthorised = new AlreadyAuthorisedPanel();
+    private final AdvancedOAuthPropertiesPanel pnlAdvancedProperties = new AdvancedOAuthPropertiesPanel();
     private String apiUrl;
-    private JCheckBox cbShowAdvancedParameters;
-    private JCheckBox cbSaveToPreferences;
+    private final JCheckBox cbShowAdvancedParameters = new JCheckBox();
+    private final JCheckBox cbSaveToPreferences = new JCheckBox(tr("Save to preferences"));
 
     /**
@@ -75,5 +75,5 @@
         gc.weightx = 0.0;
         gc.insets = new Insets(0, 0, 0, 3);
-        pnl.add(cbShowAdvancedParameters = new JCheckBox(), gc);
+        pnl.add(cbShowAdvancedParameters, gc);
         cbShowAdvancedParameters.setSelected(false);
         cbShowAdvancedParameters.addItemListener(
@@ -98,5 +98,5 @@
         gc.weightx = 1.0;
         gc.weighty = 1.0;
-        pnl.add(pnlAdvancedProperties = new AdvancedOAuthPropertiesPanel(), gc);
+        pnl.add(pnlAdvancedProperties, gc);
         pnlAdvancedProperties.initFromPreferences(Main.pref);
         pnlAdvancedProperties.setBorder(
@@ -126,10 +126,5 @@
         gc.weightx = 1.0;
         gc.insets = new Insets(10, 0, 0, 0);
-        add(pnlAuthorisationMessage = new JPanel(new BorderLayout()), gc);
-
-        // create these two panels, they are going to be used later in refreshView
-        //
-        pnlAlreadyAuthorised = new AlreadyAuthorisedPanel();
-        pnlNotYetAuthorised = new NotYetAuthorisedPanel();
+        add(pnlAuthorisationMessage, gc);
     }
 
@@ -196,7 +191,7 @@
             gc.fill = GridBagConstraints.HORIZONTAL;
             gc.weightx = 1.0;
-            JMultilineLabel lbl;
-            add(lbl = new JMultilineLabel(
-                    tr("You do not have an Access Token yet to access the OSM server using OAuth. Please authorize first.")), gc);
+            JMultilineLabel lbl = new JMultilineLabel(
+                    tr("You do not have an Access Token yet to access the OSM server using OAuth. Please authorize first."));
+            add(lbl, gc);
             lbl.setFont(lbl.getFont().deriveFont(Font.PLAIN));
 
@@ -221,6 +216,6 @@
      */
     private class AlreadyAuthorisedPanel extends JPanel {
-        private JosmTextField tfAccessTokenKey;
-        private JosmTextField tfAccessTokenSecret;
+        private final JosmTextField tfAccessTokenKey = new JosmTextField();
+        private final JosmTextField tfAccessTokenSecret = new JosmTextField();
 
         /**
@@ -240,6 +235,6 @@
             gc.weightx = 1.0;
             gc.gridwidth = 2;
-            JMultilineLabel lbl;
-            add(lbl = new JMultilineLabel(tr("You already have an Access Token to access the OSM server using OAuth.")), gc);
+            JMultilineLabel lbl = new JMultilineLabel(tr("You already have an Access Token to access the OSM server using OAuth."));
+            add(lbl, gc);
             lbl.setFont(lbl.getFont().deriveFont(Font.PLAIN));
 
@@ -253,5 +248,5 @@
             gc.gridx = 1;
             gc.weightx = 1.0;
-            add(tfAccessTokenKey = new JosmTextField(), gc);
+            add(tfAccessTokenKey, gc);
             tfAccessTokenKey.setEditable(false);
 
@@ -265,5 +260,5 @@
             gc.gridx = 1;
             gc.weightx = 1.0;
-            add(tfAccessTokenSecret = new JosmTextField(), gc);
+            add(tfAccessTokenSecret, gc);
             tfAccessTokenSecret.setEditable(false);
 
@@ -273,5 +268,5 @@
             gc.gridwidth = 2;
             gc.weightx = 1.0;
-            add(cbSaveToPreferences = new JCheckBox(tr("Save to preferences")), gc);
+            add(cbSaveToPreferences, gc);
             cbSaveToPreferences.setSelected(OAuthAccessTokenHolder.getInstance().isSaveToPreferences());
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java	(revision 10179)
@@ -49,7 +49,7 @@
     public static final String API_URL_PROP = OsmApiUrlInputPanel.class.getName() + ".apiUrl";
 
-    private JLabel lblValid;
-    private JLabel lblApiUrl;
-    private HistoryComboBox tfOsmServerUrl;
+    private final JLabel lblValid = new JLabel();
+    private final JLabel lblApiUrl = new JLabel(tr("OSM Server URL:"));
+    private final HistoryComboBox tfOsmServerUrl = new HistoryComboBox();
     private transient ApiUrlValidator valOsmServerUrl;
     private SideButton btnTest;
@@ -95,9 +95,9 @@
         gc.weightx = 0.0;
         gc.insets = new Insets(0, 0, 0, 3);
-        add(lblApiUrl = new JLabel(tr("OSM Server URL:")), gc);
+        add(lblApiUrl, gc);
 
         gc.gridx = 1;
         gc.weightx = 1.0;
-        add(tfOsmServerUrl = new HistoryComboBox(), gc);
+        add(tfOsmServerUrl, gc);
         lblApiUrl.setLabelFor(tfOsmServerUrl);
         SelectAllOnFocusGainedDecorator.decorate(tfOsmServerUrl.getEditorComponent());
@@ -110,5 +110,5 @@
         gc.gridx = 2;
         gc.weightx = 0.0;
-        add(lblValid = new JLabel(), gc);
+        add(lblValid, gc);
 
         gc.gridx = 3;
@@ -116,5 +116,6 @@
         ValidateApiUrlAction actTest = new ValidateApiUrlAction();
         tfOsmServerUrl.getEditorComponent().getDocument().addDocumentListener(actTest);
-        add(btnTest = new SideButton(actTest), gc);
+        btnTest = new SideButton(actTest);
+        add(btnTest, gc);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java	(revision 10179)
@@ -102,10 +102,10 @@
 
     private transient Map<ProxyPolicy, JRadioButton> rbProxyPolicy;
-    private JosmTextField tfProxyHttpHost;
-    private JosmTextField tfProxyHttpPort;
-    private JosmTextField tfProxySocksHost;
-    private JosmTextField tfProxySocksPort;
-    private JosmTextField tfProxyHttpUser;
-    private JosmPasswordField tfProxyHttpPassword;
+    private final JosmTextField tfProxyHttpHost = new JosmTextField();
+    private final JosmTextField tfProxyHttpPort = new JosmTextField(5);
+    private final JosmTextField tfProxySocksHost = new JosmTextField(20);
+    private final JosmTextField tfProxySocksPort = new JosmTextField(5);
+    private final JosmTextField tfProxyHttpUser = new JosmTextField(20);
+    private final JosmPasswordField tfProxyHttpPassword = new JosmPasswordField(20);
 
     private JPanel pnlHttpProxyConfigurationPanel;
@@ -134,5 +134,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfProxyHttpHost = new JosmTextField(), gc);
+        pnl.add(tfProxyHttpHost, gc);
 
         gc.gridy = 1;
@@ -144,5 +144,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfProxyHttpPort = new JosmTextField(5), gc);
+        pnl.add(tfProxyHttpPort, gc);
         tfProxyHttpPort.setMinimumSize(tfProxyHttpPort.getPreferredSize());
 
@@ -164,5 +164,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfProxyHttpUser = new JosmTextField(20), gc);
+        pnl.add(tfProxyHttpUser, gc);
         tfProxyHttpUser.setMinimumSize(tfProxyHttpUser.getPreferredSize());
 
@@ -174,5 +174,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfProxyHttpPassword = new JosmPasswordField(20), gc);
+        pnl.add(tfProxyHttpPassword, gc);
         tfProxyHttpPassword.setMinimumSize(tfProxyHttpPassword.getPreferredSize());
 
@@ -209,5 +209,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfProxySocksHost = new JosmTextField(20), gc);
+        pnl.add(tfProxySocksHost, gc);
 
         gc.gridy = 1;
@@ -219,5 +219,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfProxySocksPort = new JosmTextField(5), gc);
+        pnl.add(tfProxySocksPort, gc);
         tfProxySocksPort.setMinimumSize(tfProxySocksPort.getPreferredSize());
 
@@ -290,5 +290,6 @@
         gc.weightx = 1.0;
         gc.weighty = 0.0;
-        pnl.add(pnlHttpProxyConfigurationPanel = buildHttpProxyConfigurationPanel(), gc);
+        pnlHttpProxyConfigurationPanel = buildHttpProxyConfigurationPanel();
+        pnl.add(pnlHttpProxyConfigurationPanel, gc);
 
         // radio button SOCKS proxy
@@ -309,5 +310,6 @@
         gc.weightx = 1.0;
         gc.weighty = 0.0;
-        pnl.add(pnlSocksProxyConfigurationPanel = buildSocksProxyConfigurationPanel(), gc);
+        pnlSocksProxyConfigurationPanel = buildSocksProxyConfigurationPanel();
+        pnl.add(pnlSocksProxyConfigurationPanel, gc);
 
         return pnl;
Index: trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorPanel.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorPanel.java	(revision 10179)
@@ -75,21 +75,16 @@
         pnl.setLayout(new BoxLayout(pnl, BoxLayout.Y_AXIS));
 
-        // add action
-        //
-        JButton btn;
-        pnl.add(btn = new JButton(tagTable.getAddAction()));
+        buildButton(pnl, tagTable.getAddAction());
+        buildButton(pnl, tagTable.getDeleteAction());
+        buildButton(pnl, tagTable.getPasteAction());
+
+        return pnl;
+    }
+
+    private void buildButton(JPanel pnl, AbstractAction action) {
+        JButton btn = new JButton(action);
+        pnl.add(btn);
         btn.setMargin(new Insets(0, 0, 0, 0));
         tagTable.addComponentNotStoppingCellEditing(btn);
-
-        // delete action
-        pnl.add(btn = new JButton(tagTable.getDeleteAction()));
-        btn.setMargin(new Insets(0, 0, 0, 0));
-        tagTable.addComponentNotStoppingCellEditing(btn);
-
-        // paste action
-        pnl.add(btn = new JButton(tagTable.getPasteAction()));
-        btn.setMargin(new Insets(0, 0, 0, 0));
-        tagTable.addComponentNotStoppingCellEditing(btn);
-        return pnl;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/widgets/HistoryComboBox.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/HistoryComboBox.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/HistoryComboBox.java	(revision 10179)
@@ -22,5 +22,6 @@
     public HistoryComboBox() {
         int maxsize = Main.pref.getInteger("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE);
-        setModel(model = new ComboBoxHistory(maxsize));
+        model = new ComboBoxHistory(maxsize);
+        setModel(model);
         setEditable(true);
     }
Index: trunk/src/org/openstreetmap/josm/gui/widgets/ImageLabel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/ImageLabel.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/ImageLabel.java	(revision 10179)
@@ -18,6 +18,6 @@
  */
 public class ImageLabel extends JPanel {
-    private final JLabel imgLabel;
-    private final JLabel tf;
+    private final JLabel imgLabel = new JLabel();
+    private final JLabel tf = new JLabel();
     private final int charCount;
 
@@ -32,7 +32,7 @@
         setLayout(new GridBagLayout());
         setBackground(background);
-        add(imgLabel = new JLabel(), GBC.std().anchor(GBC.WEST).insets(0, 1, 1, 0));
+        add(imgLabel, GBC.std().anchor(GBC.WEST).insets(0, 1, 1, 0));
         setIcon(img);
-        add(tf = new JLabel(), GBC.std().fill(GBC.BOTH).anchor(GBC.WEST).insets(2, 1, 1, 0));
+        add(tf, GBC.std().fill(GBC.BOTH).anchor(GBC.WEST).insets(2, 1, 1, 0));
         setToolTipText(tooltip);
         this.charCount = charCount;
Index: trunk/src/org/openstreetmap/josm/io/OsmChangeBuilder.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmChangeBuilder.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/io/OsmChangeBuilder.java	(revision 10179)
@@ -13,25 +13,35 @@
 /**
  * Creates an OsmChange document from JOSM edits.
- * See http://wiki.openstreetmap.org/index.php/OsmChange for a documentation of the
- * OsmChange format.
- *
+ * See http://wiki.openstreetmap.org/index.php/OsmChange for a documentation of the OsmChange format.
+ * @since 1071
  */
 public class OsmChangeBuilder {
+    /** Default OSM API version */
     public static final String DEFAULT_API_VERSION = "0.6";
 
     private String currentMode;
-    private PrintWriter writer;
-    private StringWriter swriter;
-    private OsmWriter osmwriter;
+    private final PrintWriter writer;
+    private final StringWriter swriter;
+    private final OsmWriter osmwriter;
     private String apiVersion = DEFAULT_API_VERSION;
     private boolean prologWritten;
 
+    /**
+     * Constructs a new {@code OsmChangeBuilder}.
+     * @param changeset changeset
+     */
     public OsmChangeBuilder(Changeset changeset) {
         this(changeset, null /* default api version */);
     }
 
+    /**
+     * Constructs a new {@code OsmChangeBuilder}.
+     * @param changeset changeset
+     * @param apiVersion OSM API version
+     */
     public OsmChangeBuilder(Changeset changeset, String apiVersion) {
         this.apiVersion = apiVersion == null ? DEFAULT_API_VERSION : apiVersion;
-        writer = new PrintWriter(swriter = new StringWriter());
+        swriter = new StringWriter();
+        writer = new PrintWriter(swriter);
         osmwriter = OsmWriterFactory.createOsmWriter(writer, false, apiVersion);
         osmwriter.setChangeset(changeset);
@@ -90,10 +100,15 @@
      */
     public void append(Collection<? extends IPrimitive> primitives) {
-        if (primitives == null) return;
-        if (!prologWritten)
-            throw new IllegalStateException(tr("Prolog of OsmChange document not written yet. Please write first."));
+        if (primitives == null)
+            return;
+        checkProlog();
         for (IPrimitive p : primitives) {
             write(p);
         }
+    }
+
+    private void checkProlog() {
+        if (!prologWritten)
+            throw new IllegalStateException(tr("Prolog of OsmChange document not written yet. Please write first."));
     }
 
@@ -107,7 +122,7 @@
      */
     public void append(IPrimitive p) {
-        if (p == null) return;
-        if (!prologWritten)
-            throw new IllegalStateException(tr("Prolog of OsmChange document not written yet. Please write first."));
+        if (p == null)
+            return;
+        checkProlog();
         write(p);
     }
@@ -119,6 +134,5 @@
      */
     public void finish() {
-        if (!prologWritten)
-            throw new IllegalStateException(tr("Prolog of OsmChange document not written yet. Please write first."));
+        checkProlog();
         if (currentMode != null) {
             writer.print("</");
@@ -129,4 +143,8 @@
     }
 
+    /**
+     * Returns XML document.
+     * @return XML document
+     */
     public String getDocument() {
         return swriter.toString();
Index: trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 10179)
@@ -1493,6 +1493,11 @@
 
     private static class UpdatePluginsMessagePanel extends JPanel {
-        private JMultilineLabel lblMessage;
-        private JCheckBox cbDontShowAgain;
+        private final JMultilineLabel lblMessage = new JMultilineLabel("");
+        private final JCheckBox cbDontShowAgain = new JCheckBox(
+                tr("Do not ask again and remember my decision (go to Preferences->Plugins to change it later)"));
+
+        UpdatePluginsMessagePanel() {
+            build();
+        }
 
         protected final void build() {
@@ -1504,5 +1509,5 @@
             gc.weighty = 1.0;
             gc.insets = new Insets(5, 5, 5, 5);
-            add(lblMessage = new JMultilineLabel(""), gc);
+            add(lblMessage, gc);
             lblMessage.setFont(lblMessage.getFont().deriveFont(Font.PLAIN));
 
@@ -1510,11 +1515,6 @@
             gc.fill = GridBagConstraints.HORIZONTAL;
             gc.weighty = 0.0;
-            add(cbDontShowAgain = new JCheckBox(
-                    tr("Do not ask again and remember my decision (go to Preferences->Plugins to change it later)")), gc);
+            add(cbDontShowAgain, gc);
             cbDontShowAgain.setFont(cbDontShowAgain.getFont().deriveFont(Font.PLAIN));
-        }
-
-        UpdatePluginsMessagePanel() {
-            build();
         }
 
Index: trunk/src/org/openstreetmap/josm/tools/Diff.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Diff.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/tools/Diff.java	(revision 10179)
@@ -597,5 +597,5 @@
         public String toString() {
             String s = String.format("%d -%d +%d %d", line0, deleted, inserted, line1);
-            return (link != null) ? s = s + '\n' + link : s;
+            return (link != null) ? s + '\n' + link : s;
         }
     }
@@ -832,5 +832,6 @@
                 Integer ir = h.get(data[i]);
                 if (ir == null) {
-                    h.put(data[i], equivs[i] = equivMax++);
+                    equivs[i] = equivMax++;
+                    h.put(data[i], equivs[i]);
                 } else {
                     equivs[i] = ir.intValue();
Index: trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 10178)
+++ trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 10179)
@@ -58,4 +58,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
@@ -83,5 +84,4 @@
 import com.kitfox.svg.SVGDiagram;
 import com.kitfox.svg.SVGUniverse;
-import org.openstreetmap.josm.data.osm.DataSet;
 
 /**
@@ -1229,5 +1229,6 @@
             Map<Long, ImageResource> cacheByAngle = ROTATE_CACHE.get(img);
             if (cacheByAngle == null) {
-                ROTATE_CACHE.put(img, cacheByAngle = new HashMap<>());
+                cacheByAngle = new HashMap<>();
+                ROTATE_CACHE.put(img, cacheByAngle);
             }
 
@@ -1257,5 +1258,6 @@
                 }
                 Image image = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
-                cacheByAngle.put(originalAngle, imageResource = new ImageResource(image));
+                imageResource = new ImageResource(image);
+                cacheByAngle.put(originalAngle, imageResource);
                 Graphics g = image.getGraphics();
                 Graphics2D g2d = (Graphics2D) g.create();
