Index: /trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java	(revision 6792)
@@ -43,4 +43,7 @@
     }
 
+    /**
+     * Constructs a new {@code AbstractMergeAction}.
+     */
     public AbstractMergeAction() {
         super();
@@ -74,6 +77,5 @@
             return null;
 
-        Layer targetLayer = (Layer) layerList.getSelectedItem();
-        return targetLayer;
+        return (Layer) layerList.getSelectedItem();
     }
 
Index: /trunk/src/org/openstreetmap/josm/actions/ActionParameter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/ActionParameter.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/actions/ActionParameter.java	(revision 6792)
@@ -42,5 +42,4 @@
             return value;
         }
-
     }
 
@@ -58,6 +57,5 @@
         @Override
         public SearchSetting readFromString(String s) {
-            SearchSetting result = SearchSetting.readFromString(s);
-            return result;
+            return SearchSetting.readFromString(s);
         }
 
@@ -68,5 +66,4 @@
             return value.writeToString();
         }
-
     }
 }
Index: /trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java	(revision 6792)
@@ -74,6 +74,6 @@
         return update ? tr("Update multipolygon") : tr("Create multipolygon");
     }
-    
-    private class CreateUpdateMultipolygonTask implements Runnable {
+
+    private static class CreateUpdateMultipolygonTask implements Runnable {
         private final Collection<Way> selectedWays;
         private final Relation multipolygonRelation;
Index: /trunk/src/org/openstreetmap/josm/actions/ExpertToggleAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/ExpertToggleAction.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/actions/ExpertToggleAction.java	(revision 6792)
@@ -26,5 +26,5 @@
     private static final List<WeakReference<Component>> visibilityToggleListeners = new ArrayList<WeakReference<Component>>();
 
-    private static ExpertToggleAction INSTANCE = new ExpertToggleAction();
+    private static final ExpertToggleAction INSTANCE = new ExpertToggleAction();
 
     private synchronized static void fireExpertModeChanged(boolean isExpert) {
@@ -133,4 +133,5 @@
     }
 
+    @Override
     protected void notifySelectedState() {
         super.notifySelectedState();
Index: /trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java	(revision 6792)
@@ -27,8 +27,8 @@
 import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.layer.ImageryLayer;
+import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
-import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
-import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 public class ImageryAdjustAction extends MapMode implements MouseListener, MouseMotionListener, AWTEventListener{
@@ -42,4 +42,8 @@
     private MapMode oldMapMode;
 
+    /**
+     * Constructs a new {@code ImageryAdjustAction} for the given layer.
+     * @param layer The imagery layer
+     */
     public ImageryAdjustAction(ImageryLayer layer) {
         super(tr("New offset"), "adjustimg",
@@ -50,5 +54,6 @@
     }
 
-    @Override public void enterMode() {
+    @Override
+    public void enterMode() {
         super.enterMode();
         if (layer == null)
@@ -63,5 +68,5 @@
         offsetDialog.setVisible(true);
     }
-    
+
     protected void addListeners() {
         Main.map.mapView.addMouseListener(this);
@@ -70,8 +75,10 @@
             Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
         } catch (SecurityException ex) {
-        }
-    }
-
-    @Override public void exitMode() {
+            Main.error(ex);
+        }
+    }
+
+    @Override
+    public void exitMode() {
         super.exitMode();
         if (offsetDialog != null) {
@@ -82,9 +89,10 @@
         removeListeners();
     }
-    
+
     protected void removeListeners() {
         try {
             Toolkit.getDefaultToolkit().removeAWTEventListener(this);
         } catch (SecurityException ex) {
+            Main.error(ex);
         }
         if (Main.isDisplayingMapView()) {
@@ -119,5 +127,6 @@
     }
 
-    @Override public void mousePressed(MouseEvent e) {
+    @Override
+    public void mousePressed(MouseEvent e) {
         if (e.getButton() != MouseEvent.BUTTON1)
             return;
@@ -130,5 +139,6 @@
     }
 
-    @Override public void mouseDragged(MouseEvent e) {
+    @Override
+    public void mouseDragged(MouseEvent e) {
         if (layer == null || prevEastNorth == null) return;
         EastNorth eastNorth =
@@ -144,5 +154,6 @@
     }
 
-    @Override public void mouseReleased(MouseEvent e) {
+    @Override
+    public void mouseReleased(MouseEvent e) {
         Main.map.mapView.repaint();
         Main.map.mapView.resetCursor(this);
Index: /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 6792)
@@ -272,4 +272,5 @@
             Toolkit.getDefaultToolkit().removeAWTEventListener(this);
         } catch (SecurityException ex) {
+            Main.warn(ex);
         }
 
Index: /trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java	(revision 6792)
@@ -136,5 +136,5 @@
     private final Cursor cursorCreateNodes;
 
-    private class ReferenceSegment {
+    private static class ReferenceSegment {
         public final EastNorth en;
         public final EastNorth p1;
Index: /trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java	(revision 6792)
@@ -252,6 +252,5 @@
         boolean oldAlt = alt, oldShift = shift, oldCtrl = ctrl;
         updateKeyModifiers(e);
-        boolean changed = (oldAlt != alt || oldShift != shift || oldCtrl != ctrl);
-        return changed;
+        return (oldAlt != alt || oldShift != shift || oldCtrl != ctrl);
     }
 
Index: /trunk/src/org/openstreetmap/josm/actions/relation/DeleteRelationsAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/relation/DeleteRelationsAction.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/actions/relation/DeleteRelationsAction.java	(revision 6792)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.actions.relation;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import java.awt.event.ActionEvent;
@@ -8,7 +10,4 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-
 /**
  * Action that delete relations
@@ -16,5 +15,5 @@
  */
 public class DeleteRelationsAction extends AbstractRelationAction {
-    class AbortException extends Exception {}
+    static class AbortException extends Exception {}
 
     /**
Index: /trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(revision 6792)
@@ -77,5 +77,4 @@
             addMatchFactory(new CoreUnaryMatchFactory());
         }
-
     }
 
@@ -289,5 +288,6 @@
      */
     public static class Always extends Match {
-        public static Always INSTANCE = new Always();
+        /** The unique instance/ */
+        public static final Always INSTANCE = new Always();
         @Override public boolean match(OsmPrimitive osm) {
             return true;
Index: /trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java	(revision 6792)
@@ -72,5 +72,5 @@
      * Data fix to remove spaces at begin or end of tags
      */
-    public class FixDataSpace implements FixData {
+    public static class FixDataSpace implements FixData {
         @Override
         public boolean fixKeys(Map<String, String> keys, OsmPrimitive osm) {
@@ -105,5 +105,5 @@
      * Data fix to cleanup wrong spelled keys
      */
-    public class FixDataKey implements FixData {
+    public static class FixDataKey implements FixData {
         /** key of wrong data */
         String oldKey;
@@ -136,5 +136,5 @@
      * Data fix to cleanup wrong spelled tags
      */
-    public class FixDataTag implements FixData {
+    public static class FixDataTag implements FixData {
         /** key of wrong data */
         String oldKey;
Index: /trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 6792)
@@ -1033,4 +1033,5 @@
      *  def otherwise
      */
+    @SuppressWarnings("unchecked")
     synchronized public <T extends Setting> T getSetting(String key, T def, Class<T> klass) {
         CheckParameterUtil.ensureParameterNotNull(key);
@@ -1045,7 +1046,5 @@
         Setting prop = settingsMap.get(key);
         if (klass.isInstance(prop)) {
-            @SuppressWarnings("unchecked")
-            T prop_cast = (T) prop;
-            return prop_cast;
+            return (T) prop;
         } else {
             return def;
@@ -1075,9 +1074,8 @@
      * If not a single entry could be found, <code>def</code> is returned.
      */
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     synchronized public Collection<Collection<String>> getArray(String key, Collection<Collection<String>> def) {
         ListListSetting val = getSetting(key, ListListSetting.create(def), ListListSetting.class);
-        @SuppressWarnings({ "unchecked", "rawtypes" })
-        Collection<Collection<String>> val_cast = (Collection) val.getValue();
-        return val_cast;
+        return (Collection) val.getValue();
     }
 
Index: /trunk/src/org/openstreetmap/josm/data/osm/OsmUtils.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/OsmUtils.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/data/osm/OsmUtils.java	(revision 6792)
@@ -8,14 +8,14 @@
 
 public final class OsmUtils {
-    
+
     private OsmUtils() {
         // Hide default constructor for utils classes
     }
 
-    static List<String> TRUE_VALUES = new ArrayList<String>(Arrays
+    static final List<String> TRUE_VALUES = new ArrayList<String>(Arrays
             .asList(new String[] { "true", "yes", "1", "on" }));
-    static List<String> FALSE_VALUES = new ArrayList<String>(Arrays
+    static final List<String> FALSE_VALUES = new ArrayList<String>(Arrays
             .asList(new String[] { "false", "no", "0", "off" }));
-    static List<String> REVERSE_VALUES = new ArrayList<String>(Arrays
+    static final List<String> REVERSE_VALUES = new ArrayList<String>(Arrays
             .asList(new String[] { "reverse", "-1" }));
 
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java	(revision 6792)
@@ -67,5 +67,7 @@
     private void testForError(Way w, Node wayNode, OsmPrimitive p) {
         if (wayNode.isOutsideDownloadArea()) {
+            return;
         } else if (Utils.exists(wayNode.getReferrers(), Predicates.hasTag("route", "ferry"))) {
+            return;
         } else if (isArea(p)) {
             addError(w, wayNode, p);
Index: /trunk/src/org/openstreetmap/josm/gui/MapScaler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapScaler.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/MapScaler.java	(revision 6792)
@@ -1,4 +1,3 @@
 // License: GPL. See LICENSE file for details.
-
 package org.openstreetmap.josm.gui;
 
@@ -19,5 +18,5 @@
     private final NavigatableComponent mv;
 
-    private static int PADDING_RIGHT = 100;
+    private static final int PADDING_RIGHT = 100;
 
     public MapScaler(NavigatableComponent mv) {
@@ -27,5 +26,6 @@
     }
 
-    @Override public void paint(Graphics g) {
+    @Override
+    public void paint(Graphics g) {
         String text = mv.getDist100PixelText();
         Rectangle2D bound = g.getFontMetrics().getStringBounds(text, g);
@@ -41,6 +41,5 @@
     }
 
-    static public Color getColor()
-    {
+    static public Color getColor() {
         return Main.pref.getColor(marktr("scale"), Color.white);
     }
Index: /trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMerger.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMerger.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMerger.java	(revision 6792)
@@ -35,5 +35,5 @@
  */
 public class PropertiesMerger extends JPanel implements Observer, IConflictResolver {
-    private static DecimalFormat COORD_FORMATTER = new DecimalFormat("###0.0000000");
+    private static final DecimalFormat COORD_FORMATTER = new DecimalFormat("###0.0000000");
 
     private JLabel lblMyCoordinates;
Index: /trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueResolutionDecision.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueResolutionDecision.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueResolutionDecision.java	(revision 6792)
@@ -249,7 +249,5 @@
             throw new IllegalStateException(tr("Not decided yet."));
         String key = tags.getKeys().iterator().next();
-        String value = getChosenValue();
-        ChangePropertyCommand cmd = new ChangePropertyCommand(primitive, key,value);
-        return cmd;
+        return new ChangePropertyCommand(primitive, key, getChosenValue());
     }
 
@@ -267,15 +265,11 @@
             throw new IllegalStateException(tr("Not decided yet."));
         String key = tags.getKeys().iterator().next();
-        String value = getChosenValue();
-        ChangePropertyCommand cmd = new ChangePropertyCommand(primitives, key,value);
-        return cmd;
-    }
-
-    /**
-     * Replies a tag representing the current resolution. Null, if this resolution is not resolved
-     * yet.
-     *
-     * @return a tag representing the current resolution. Null, if this resolution is not resolved
-     * yet
+        return new ChangePropertyCommand(primitives, key, getChosenValue());
+    }
+
+    /**
+     * Replies a tag representing the current resolution. Null, if this resolution is not resolved yet.
+     *
+     * @return a tag representing the current resolution. Null, if this resolution is not resolved yet
      */
     public Tag getResolution() {
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java	(revision 6792)
@@ -89,9 +89,8 @@
                 if (canEdit) {
                     Constructor<RelationEditor> con = e.getConstructor(Relation.class, Collection.class);
-                    RelationEditor editor = con.newInstance(layer, r, selectedMembers);
-                    return editor;
+                    return con.newInstance(layer, r, selectedMembers);
                 }
             } catch (Exception ex) {
-                // plod on
+                Main.warn(ex);
             }
         }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationNodeMap.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationNodeMap.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationNodeMap.java	(revision 6792)
@@ -277,6 +277,5 @@
         Set<Integer> adj = nw.nodes.get(n);
         if (adj == null || adj.isEmpty()) return null;
-        Integer j = adj.iterator().next();
-        return j;
+        return adj.iterator().next();
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java	(revision 6792)
@@ -525,6 +525,5 @@
             OsmDataLayer editLayer = Main.main.getEditLayer();
             if (editLayer == null) return null;
-            OsmPrimitive p = editLayer.data.getPrimitiveById(latest.getId(), latest.getType());
-            return p;
+            return editLayer.data.getPrimitiveById(latest.getId(), latest.getType());
         }
 
Index: /trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java	(revision 6792)
@@ -223,6 +223,5 @@
             OsmDataLayer editLayer = Main.main.getEditLayer();
             if (editLayer == null) return null;
-            OsmPrimitive p = editLayer.data.getPrimitiveById(primitiveId);
-            return p;
+            return editLayer.data.getPrimitiveById(primitiveId);
         }
 
Index: /trunk/src/org/openstreetmap/josm/gui/history/RelationMemberListViewer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/history/RelationMemberListViewer.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/history/RelationMemberListViewer.java	(revision 6792)
@@ -21,5 +21,5 @@
 public class RelationMemberListViewer extends HistoryViewerPanel {
 
-    protected class MemberModelChanged implements TableModelListener {
+    protected static class MemberModelChanged implements TableModelListener {
         private final JTable table;
 
@@ -35,4 +35,5 @@
     }
 
+    @Override
     protected JTable buildReferenceTable() {
         JTable table = new JTable(
@@ -47,4 +48,5 @@
     }
 
+    @Override
     protected JTable buildCurrentTable() {
         JTable table = new JTable(
Index: /trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 6792)
@@ -156,5 +156,5 @@
 
     private Set<Tile> tileRequestsOutstanding = new HashSet<Tile>();
-    
+
     @Override
     public synchronized void tileLoadingFinished(Tile tile, boolean success) {
@@ -180,5 +180,5 @@
     }
 
-    private class TmsTileClearController implements TileClearController, CancelListener {
+    private static class TmsTileClearController implements TileClearController, CancelListener {
 
         private final ProgressMonitor monitor;
@@ -797,6 +797,5 @@
         if (x < 0 || x >= max || y < 0 || y >= max)
             return null;
-        Tile tile = tileCache.getTile(tileSource, x, y, zoom);
-        return tile;
+        return tileCache.getTile(tileSource, x, y, zoom);
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 6792)
@@ -90,4 +90,8 @@
     long delta;
 
+    /**
+     * Constructs a new {@code CorrelateGpxWithImages} action.
+     * @param layer The image layer
+     */
     public CorrelateGpxWithImages(GeoImageLayer layer) {
         super(tr("Correlate to GPX"), ImageProvider.get("dialogs/geoimage/gpx2img"));
@@ -1015,5 +1019,7 @@
                             firstGPXDate = dateParser.parse(curDateWpStr).getTime()/1000;
                             break outer;
-                        } catch(Exception e) {}
+                        } catch(Exception e) {
+                            Main.warn(e);
+                        }
                     }
                 }
@@ -1170,5 +1176,5 @@
         return null;
     }
-    
+
     private int matchPoints(List<ImageEntry> images, WayPoint prevWp, long prevWpTime,
             WayPoint curWp, long curWpTime, long offset) {
@@ -1236,5 +1242,5 @@
             }
 
-            if (curImg.tmp.getPos() == null) {
+            if (curImg.tmp.getPos() == null && prevWp != null) {
                 // The values of timeDiff are between 0 and 1, it is not seconds but a dimensionless variable
                 double timeDiff = (double)(imgTime - prevWpTime) / interval;
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(revision 6792)
@@ -568,4 +568,5 @@
             }
         } catch (MetadataException ex) {
+            Main.debug(ex.getMessage());
         }
 
@@ -584,4 +585,5 @@
             e.setElevation(ele);
         } catch (MetadataException ex) {
+            Main.debug(ex.getMessage());
         }
 
@@ -603,5 +605,5 @@
             }
         } catch (Exception ex) { // (CompoundException and other exceptions, e.g. #5271)
-            // Do nothing
+            Main.debug(ex.getMessage());
         }
 
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java	(revision 6792)
@@ -51,6 +51,6 @@
     private String osdText = null;
 
-    private static int DRAG_BUTTON = Main.pref.getBoolean("geoimage.agpifo-style-drag-and-zoom", false) ? 1 : 3;
-    private static int ZOOM_BUTTON = DRAG_BUTTON == 1 ? 3 : 1;
+    private static final int DRAG_BUTTON = Main.pref.getBoolean("geoimage.agpifo-style-drag-and-zoom", false) ? 1 : 3;
+    private static final int ZOOM_BUTTON = DRAG_BUTTON == 1 ? 3 : 1;
 
     /** The thread that reads the images. */
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java	(revision 6792)
@@ -40,6 +40,4 @@
         for (int i = 0; i < data.size(); i++) {
             if (stop) return;
-
-            System.err.print("fetching image "+i);
 
             data.get(i).thumbnail = loadThumb(data.get(i));
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 6792)
@@ -392,6 +392,5 @@
             }
         }
-        T res = mc.getCascade("default").get(key, def, c);
-        return res;
+        return mc.getCascade("default").get(key, def, c);
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/MapListEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/MapListEditor.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/MapListEditor.java	(revision 6792)
@@ -213,9 +213,8 @@
 
     class MapTableModel extends AbstractTableModel {
+        @SuppressWarnings("unchecked")
         private List<List<String>> data() {
             if (entryIdx == null) return Collections.emptyList();
-            @SuppressWarnings("unchecked")
-            List<List<String>> result = Arrays.asList(dataKeys.get(entryIdx), dataValues.get(entryIdx));
-            return result;
+            return Arrays.asList(dataKeys.get(entryIdx), dataValues.get(entryIdx));
         }
 
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java	(revision 6792)
@@ -26,6 +26,6 @@
 import org.openstreetmap.josm.data.projection.Projection;
 import org.openstreetmap.josm.data.projection.Projections;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.GBC;
-import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -43,5 +43,5 @@
     }
 
-    private class CodeSelectionPanel extends JPanel implements ListSelectionListener, DocumentListener {
+    private static class CodeSelectionPanel extends JPanel implements ListSelectionListener, DocumentListener {
 
         public JosmTextField filter;
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java	(revision 6792)
@@ -33,8 +33,8 @@
 import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
 import org.openstreetmap.josm.gui.widgets.HtmlPanel;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Utils;
-import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 public class CustomProjectionChoice extends AbstractProjectionChoice implements SubPrefsOptions {
@@ -189,6 +189,5 @@
             s.append("<b>+bounds=</b>minlon,minlat,maxlon,maxlat - <i>"+tr("Projection bounds (in degrees)")+"</i><br>");
 
-            HtmlPanel info = new HtmlPanel(s.toString());
-            return info;
+            return new HtmlPanel(s.toString());
         }
 
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java	(revision 6792)
@@ -11,4 +11,5 @@
 import javax.swing.JPanel;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -76,5 +77,7 @@
                 if(zoneval >= 0 && zoneval <= 8)
                     return Collections.singleton(String.valueOf(zoneval+1));
-            } catch(NumberFormatException ex) {}
+            } catch(NumberFormatException ex) {
+                Main.warn(ex);
+            }
         }
         return null;
@@ -90,5 +93,7 @@
         try {
             return Integer.parseInt(zone) - 1;
-        } catch(NumberFormatException e) {}
+        } catch(NumberFormatException e) {
+            Main.warn(e);
+        }
         return defaultIndex;
     }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertProjectionChoice.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertProjectionChoice.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertProjectionChoice.java	(revision 6792)
@@ -11,4 +11,5 @@
 import javax.swing.JPanel;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -70,5 +71,7 @@
                 if(zoneval >= 1 && zoneval <= 4)
                     return Collections.singleton(zonestring);
-            } catch(NumberFormatException e) {}
+            } catch(NumberFormatException e) {
+                Main.warn(e);
+            }
         }
         return null;
@@ -84,7 +87,8 @@
         try {
             return Integer.parseInt(zone) - 1;
-        } catch(NumberFormatException e) {}
+        } catch(NumberFormatException e) {
+            Main.warn(e);
+        }
         return defaultIndex;
     }
-
 }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMFranceDOMProjectionChoice.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMFranceDOMProjectionChoice.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMFranceDOMProjectionChoice.java	(revision 6792)
@@ -6,4 +6,6 @@
 import java.util.Collection;
 import java.util.Collections;
+
+import org.openstreetmap.josm.Main;
 
 public class UTMFranceDOMProjectionChoice extends ListProjectionChoice {
@@ -39,5 +41,7 @@
         try {
             return Integer.parseInt(zone) - 1;
-        } catch(NumberFormatException e) {}
+        } catch(NumberFormatException e) {
+            Main.warn(e);
+        }
         return defaultIndex;
     }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java	(revision 6792)
@@ -16,9 +16,16 @@
 import javax.swing.JRadioButton;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.tools.GBC;
 
 public class UTMProjectionChoice extends ListProjectionChoice {
 
-    public enum Hemisphere { North, South }
+    /** Earth emispheres **/
+    public enum Hemisphere {
+        /** North emisphere */
+        North,
+        /** South emisphere */
+        South
+    }
 
     private static final Hemisphere DEFAULT_HEMISPHERE = Hemisphere.North;
@@ -129,5 +136,7 @@
                 if(zoneval > 0 && zoneval <= 60)
                     return Arrays.asList(zonestring, hemisphere.toString());
-            } catch(NumberFormatException e) {}
+            } catch(NumberFormatException e) {
+                Main.warn(e);
+            }
         }
         return null;
@@ -158,5 +167,7 @@
         try {
             return Integer.parseInt(zone) - 1;
-        } catch(NumberFormatException e) {}
+        } catch(NumberFormatException e) {
+            Main.warn(e);
+        }
         return defaultIndex;
     }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java	(revision 6792)
@@ -116,5 +116,5 @@
         filterField.setText(substring);
     }
-    
+
     private static class ScListModel extends AbstractTableModel {
         private String[] columnNames = new String[]{tr("Action"), tr("Shortcut")};
@@ -374,7 +374,9 @@
                 }
                 model.fireTableDataChanged();
-            }
-            catch (PatternSyntaxException ex) { }
-            catch (ClassCastException ex2) { /* eliminate warning */  }
+            } catch (PatternSyntaxException ex) {
+                Main.warn(ex);
+            } catch (ClassCastException ex2) {
+                Main.warn(ex2);
+            }
         }
 
@@ -386,4 +388,3 @@
         public void removeUpdate(DocumentEvent arg0) { filter(); }
     }
-
 }
Index: /trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java	(revision 6792)
@@ -238,9 +238,9 @@
     public TagModel get(int idx) {
         if (idx >= tags.size()) return null;
-        TagModel tagModel = tags.get(idx);
-        return tagModel;
-    }
-
-    @Override public boolean isCellEditable(int row, int col) {
+        return tags.get(idx);
+    }
+
+    @Override
+    public boolean isCellEditable(int row, int col) {
         // all cells are editable
         return true;
@@ -484,9 +484,5 @@
             return null;
 
-        String newkey = tag.getName();
-        String newvalue = tag.getValue();
-
-        ChangePropertyCommand command = new ChangePropertyCommand(primitives,newkey, newvalue);
-        return command;
+        return new ChangePropertyCommand(primitives, tag.getName(), tag.getValue());
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java	(revision 6792)
@@ -70,5 +70,5 @@
 public final class TaggingPresetItems {
     private TaggingPresetItems() {    }
-    
+
     private static int auto_increment_selected = 0;
     public static final String DIFFERENT = tr("<different>");
@@ -79,5 +79,5 @@
     private static final Map<String,EnumSet<TaggingPresetType>> typeCache =
             new LinkedHashMap<String, EnumSet<TaggingPresetType>>(16, 1.1f, true);
-    
+
     /**
      * Last value of each key used in presets, used for prefilling corresponding fields
@@ -279,5 +279,5 @@
         }
     }
-    
+
     public static class Usage {
         TreeSet<String> values;
@@ -310,10 +310,10 @@
          */
         public String text;
-        
+
         /**
          * The context used for translating {@link #text}
          */
         public String text_context;
-        
+
         /**
          * The localized version of {@link #text}
@@ -342,5 +342,5 @@
                     + (locale_text != null ? "locale_text=" + locale_text : "");
         }
-        
+
         @Override
         public String toString() {
@@ -365,5 +365,5 @@
          */
         public String href;
-        
+
         /**
          * The localized version of {@link #href}
@@ -421,5 +421,5 @@
         }
     }
-    
+
     public static class Roles extends TaggingPresetItem {
 
@@ -526,5 +526,5 @@
             }
         }
-        
+
         @Override
         public String toString() {
@@ -566,5 +566,5 @@
         }
     }
-    
+
     public static class Text extends KeyedItem {
 
@@ -670,6 +670,6 @@
                 clearbutton.setFocusable(false);
                 bg.add(clearbutton);
-                // and its visible counterpart. - this mechanism allows us to 
-                // have *no* button selected after the X is clicked, instead 
+                // and its visible counterpart. - this mechanism allows us to
+                // have *no* button selected after the X is clicked, instead
                 // of the X remaining selected
                 JButton releasebutton = new JButton("X");
@@ -703,5 +703,5 @@
             }
         }
-        
+
         @Override
         public void addCommands(List<Tag> changedTags) {
@@ -713,5 +713,5 @@
                 return;
             }
-            
+
             v = Tag.removeWhiteSpaces(v);
 
@@ -748,10 +748,10 @@
      */
     public static class CheckGroup extends TaggingPresetItem {
-        
+
         /**
          * Number of columns (positive integer)
          */
         public String columns;
-        
+
         /**
          * List of checkboxes
@@ -764,9 +764,9 @@
             int rows = (int) Math.ceil(checks.size()/cols.doubleValue());
             JPanel panel = new JPanel(new GridLayout(rows, cols));
-            
+
             for (Check check : checks) {
                 check.addToPanel(panel, sel);
             }
-            
+
             p.add(panel, GBC.eol());
             return false;
@@ -990,5 +990,5 @@
 
             String[] value_array = null;
-            
+
             if (values_from != null) {
                 String[] class_method = values_from.split("#");
@@ -998,5 +998,5 @@
                         // Check method is public static String[] methodName()
                         int mod = method.getModifiers();
-                        if (Modifier.isPublic(mod) && Modifier.isStatic(mod) 
+                        if (Modifier.isPublic(mod) && Modifier.isStatic(mod)
                                 && method.getReturnType().equals(String[].class) && method.getParameterTypes().length == 0) {
                             value_array = (String[]) method.invoke(null);
@@ -1011,5 +1011,5 @@
                 }
             }
-            
+
             if (value_array == null) {
                 value_array = splitEscaped(delChar, values);
@@ -1106,5 +1106,5 @@
         }
 
-        private static ListCellRenderer RENDERER = new ListCellRenderer() {
+        private static final ListCellRenderer RENDERER = new ListCellRenderer() {
 
             JLabel lbl = new JLabel();
@@ -1368,9 +1368,9 @@
         return result;
     }
-    
+
     static String fixPresetString(String s) {
         return s == null ? s : s.replaceAll("'","''");
     }
-    
+
     /**
      * allow escaped comma in comma separated list:
@@ -1406,5 +1406,5 @@
     }
 
-    
+
     static Usage determineTextUsage(Collection<OsmPrimitive> sel, String key) {
         Usage returnValue = new Usage();
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java	(revision 6792)
@@ -39,5 +39,5 @@
     protected JTextComponent component = null;
     protected UndoAction undoAction = null;
-    
+
     protected final PropertyChangeListener propertyChangeListener = new PropertyChangeListener() {
         @Override public void propertyChange(PropertyChangeEvent evt) {
@@ -48,5 +48,5 @@
         }
     };
-    
+
     /**
      * Creates a new {@link TextContextualPopupMenu}.
@@ -74,5 +74,5 @@
         return this;
     }
-    
+
     private void addMenuEntries() {
         if (component.isEditable()) {
@@ -89,5 +89,5 @@
         addMenuEntry(component, tr("Select All"), DefaultEditorKit.selectAllAction, null);
     }
-    
+
     /**
      * Detaches this contextual menu from its text component.
@@ -107,9 +107,9 @@
         return this;
     }
-    
+
     /**
      * Creates a new {@link TextContextualPopupMenu} and enables it for the given text component.
      * @param component The component that will display the menu and handle its actions.
-     * @return The {@link PopupMenuLauncher} responsible of displaying the popup menu. 
+     * @return The {@link PopupMenuLauncher} responsible of displaying the popup menu.
      *         Call {@link #disableMenuFor} with this object if you want to disable the menu later.
      * @see #disableMenuFor(JTextComponent, PopupMenuLauncher)
@@ -122,5 +122,5 @@
 
     /**
-     * Disables the {@link TextContextualPopupMenu} attached to the given popup menu launcher and text component. 
+     * Disables the {@link TextContextualPopupMenu} attached to the given popup menu launcher and text component.
      * @param component The component that currently displays the menu and handles its actions.
      * @param launcher The {@link PopupMenuLauncher} obtained via {@link #enableMenuFor}.
@@ -156,9 +156,9 @@
         }
     }
-    
-    protected class UndoAction extends AbstractAction implements UndoableEditListener {
-        
+
+    protected static class UndoAction extends AbstractAction implements UndoableEditListener {
+
         private final UndoManager undoManager = new UndoManager();
-        
+
         public UndoAction() {
             super(tr("Undo"));
Index: /trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java	(revision 6792)
@@ -63,5 +63,5 @@
      * <a href="http://www.boutell.com/newfaq/misc/urllength.html">WWW FAQ</a>.
      */
-    static private int MAX_IDS_PER_REQUEST = 200;
+    private static final int MAX_IDS_PER_REQUEST = 200;
 
     private Set<Long> nodes;
Index: /trunk/src/org/openstreetmap/josm/io/OsmApi.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmApi.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/io/OsmApi.java	(revision 6792)
@@ -172,4 +172,5 @@
             host = (new URL(serverUrl)).getHost();
         } catch (MalformedURLException e) {
+            Main.warn(e);
         }
         return host;
Index: /trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java	(revision 6792)
@@ -63,6 +63,5 @@
                 return null;
             monitor.indeterminateSubTask(tr("Downloading changesets ..."));
-            List<Changeset> changesets = OsmChangesetParser.parse(in, monitor.createSubTaskMonitor(1, true));
-            return changesets;
+            return OsmChangesetParser.parse(in, monitor.createSubTaskMonitor(1, true));
         } catch(OsmTransferException e) {
             throw e;
@@ -182,6 +181,5 @@
             monitor.setCustomText(tr("Downloading content for changeset {0} ...", id));
             OsmChangesetContentParser parser = new OsmChangesetContentParser(in);
-            ChangesetDataSet ds = parser.parse(monitor.createSubTaskMonitor(1, true));
-            return ds;
+            return parser.parse(monitor.createSubTaskMonitor(1, true));
         } catch(OsmDataParsingException e) {
             throw new OsmTransferException(e);
Index: /trunk/src/org/openstreetmap/josm/io/OsmServerHistoryReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmServerHistoryReader.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/io/OsmServerHistoryReader.java	(revision 6792)
@@ -69,6 +69,5 @@
             progressMonitor.indeterminateSubTask(tr("Downloading history..."));
             final OsmHistoryReader reader = new OsmHistoryReader(in);
-            HistoryDataSet data = reader.parse(progressMonitor.createSubTaskMonitor(1, true));
-            return data;
+            return reader.parse(progressMonitor.createSubTaskMonitor(1, true));
         } catch(OsmTransferException e) {
             throw e;
Index: /trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java	(revision 6792)
@@ -132,6 +132,5 @@
             if (in == null)
                 return null;
-            final DataSet data = OsmReader.parseDataSet(in, progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
-            return data;
+            return OsmReader.parseDataSet(in, progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
         } catch(OsmTransferException e) {
             if (cancel) return null;
Index: /trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java	(revision 6792)
@@ -105,6 +105,5 @@
     private static void addRequestHandlerClass(String command,
                 Class<? extends RequestHandler> handler, boolean silent) {
-        if(command.charAt(0) == '/')
-        {
+        if(command.charAt(0) == '/') {
             command = command.substring(1);
         }
@@ -246,4 +245,5 @@
                 sendError(out);
             } catch (IOException e1) {
+                Main.warn(e1);
             }
         } finally {
@@ -363,10 +363,10 @@
             out.write("\r\n");
     }
-    
+
     public static String getHandlersInfoAsJSON() {
         StringBuilder r = new StringBuilder();
         boolean first = true;
         r.append("[");
-        
+
         for (Entry<String, Class<? extends RequestHandler>> p : handlers.entrySet()) {
             if (first) {
@@ -424,5 +424,5 @@
             }
         }
-        
+
         r.append("], \"examples\" : [");
         String[] examples = handler.getUsageExamples(cmd.substring(1));
@@ -444,4 +444,5 @@
                 w.close();
             } catch (IOException ex) {
+                Main.warn(ex);
             }
         }
Index: /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java	(revision 6792)
@@ -19,9 +19,7 @@
 import org.openstreetmap.josm.data.osm.BBox;
 import org.openstreetmap.josm.data.osm.DataSet;
-import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
-import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
 import org.openstreetmap.josm.gui.util.GuiHelper;
@@ -35,5 +33,5 @@
  */
 public class LoadAndZoomHandler extends RequestHandler {
-    
+
     /**
      * The remote control command name used to load data and zoom.
@@ -53,5 +51,5 @@
 
     // Optional argument 'select'
-    private final HashSet<SimplePrimitiveId> toSelect = new HashSet<SimplePrimitiveId>();
+    private final Set<SimplePrimitiveId> toSelect = new HashSet<SimplePrimitiveId>();
 
     @Override
@@ -84,5 +82,5 @@
         return getUsageExamples(myCommand);
     }
-    
+
     @Override
     public String[] getUsageExamples(String cmd) {
@@ -163,5 +161,5 @@
                 @Override
                 public void run() {
-                    HashSet<OsmPrimitive> newSel = new HashSet<OsmPrimitive>();
+                    Set<OsmPrimitive> newSel = new HashSet<OsmPrimitive>();
                     DataSet ds = Main.main.getCurrentDataSet();
                     if(ds == null) // e.g. download failed
@@ -249,5 +247,5 @@
             throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+")");
         }
-        
+
         // Current API 0.6 check: "The latitudes must be between -90 and 90"
         if (!LatLon.isValidLat(minlat) || !LatLon.isValidLat(maxlat)) {
Index: /trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java	(revision 6792)
@@ -8,8 +8,4 @@
 import java.util.Map;
 
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
@@ -20,4 +16,7 @@
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.session.SessionReader.ImportSupport;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 /**
@@ -45,7 +44,5 @@
         ImageryPreferenceEntry prefEntry = Preferences.deserializeStruct(attributes, ImageryPreferenceEntry.class);
         ImageryInfo i = new ImageryInfo(prefEntry);
-        final ImageryLayer layer = ImageryLayer.create(i);
-        return layer;
+        return ImageryLayer.create(i);
     }
-
 }
Index: /trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/session/SessionReader.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/io/session/SessionReader.java	(revision 6792)
@@ -185,6 +185,5 @@
                 ZipEntry entry = zipFile.getEntry(inZipPath);
                 if (entry != null) {
-                    InputStream is = zipFile.getInputStream(entry);
-                    return is;
+                    return zipFile.getInputStream(entry);
                 }
             }
@@ -311,5 +310,7 @@
                     LatLon centerLL = new LatLon(Double.parseDouble(centerEl.getAttribute("lat")), Double.parseDouble(centerEl.getAttribute("lon")));
                     center = Projections.project(centerLL);
-                } catch (NumberFormatException ex) {}
+                } catch (NumberFormatException ex) {
+                    Main.warn(ex);
+                }
             }
             if (center != null) {
@@ -329,5 +330,7 @@
                         double scale = meterPerPixel / meterPerEasting; // unit: easting per pixel
                         viewport = new ViewportData(center, scale);
-                    } catch (NumberFormatException ex) {}
+                    } catch (NumberFormatException ex) {
+                        Main.warn(ex);
+                    }
                 }
             }
@@ -344,5 +347,5 @@
             active = -1;
         }
-        
+
         MultiMap<Integer, Integer> deps = new MultiMap<Integer, Integer>();
         Map<Integer, Element> elems = new HashMap<Integer, Element>();
@@ -362,5 +365,7 @@
                     try {
                         idx = Integer.parseInt(e.getAttribute("index"));
-                    } catch (NumberFormatException ex) {}
+                    } catch (NumberFormatException ex) {
+                        Main.warn(ex);
+                    }
                     if (idx == null) {
                         error(tr("unexpected format of attribute ''index'' for element ''layer''"));
@@ -591,8 +596,8 @@
 
     private void loadSession(InputStream josIS, URI sessionFileURI, boolean zip, ProgressMonitor progressMonitor) throws IOException, IllegalDataException {
-        
+
         this.sessionFileURI = sessionFileURI;
         this.zip = zip;
-        
+
         try {
             DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 6792)
@@ -322,7 +322,6 @@
         if (className == null)
             return null;
-        try{
-            Class<?> realClass = Class.forName(className, true, classLoader);
-            return realClass;
+        try {
+            return Class.forName(className, true, classLoader);
         } catch (ClassNotFoundException e) {
             throw new PluginException(name, e);
@@ -381,6 +380,5 @@
             File pluginFile = new File(s, pluginName + ".jar");
             if (pluginFile.exists()) {
-                PluginInformation info = new PluginInformation(pluginFile);
-                return info;
+                return new PluginInformation(pluginFile);
             }
         }
Index: /trunk/src/org/openstreetmap/josm/tools/SubclassFilteredCollection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/SubclassFilteredCollection.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/tools/SubclassFilteredCollection.java	(revision 6792)
@@ -47,4 +47,5 @@
         }
 
+        @SuppressWarnings("unchecked")
         @Override
         public T next() {
@@ -53,6 +54,5 @@
             current = null;
             // we are save because predicate only accepts objects of type T
-            @SuppressWarnings("unchecked") T res = (T) old;
-            return res;
+            return (T) old;
         }
 
Index: /trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 6791)
+++ /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 6792)
@@ -294,5 +294,5 @@
         return null;
     }
-    
+
     /**
      * Copies the given array. Unlike {@link Arrays#copyOf}, this method is null-safe.
@@ -307,5 +307,5 @@
         return null;
     }
-    
+
     /**
      * Simple file copy function that will overwrite the target file.<br/>
@@ -386,5 +386,5 @@
         }
     }
-    
+
     /**
      * Converts the given file to its URL.
@@ -457,6 +457,5 @@
         try {
             if (t != null && t.isDataFlavorSupported(DataFlavor.stringFlavor)) {
-                String text = (String) t.getTransferData(DataFlavor.stringFlavor);
-                return text;
+                return (String) t.getTransferData(DataFlavor.stringFlavor);
             }
         } catch (UnsupportedFlavorException ex) {
@@ -780,7 +779,7 @@
     /**
      * Runs an external command and returns the standard output.
-     * 
+     *
      * The program is expected to execute fast.
-     * 
+     *
      * @param command the command with arguments
      * @return the output
@@ -945,5 +944,5 @@
         return result;
     }
-    
+
     /**
      * Adds the given item at the end of a new copy of given array.
