Index: trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 2675)
+++ trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 2676)
@@ -329,4 +329,9 @@
                     && o.text.equals(this.text));
         }
+
+        @Override
+        public int hashCode() {
+            return text.hashCode();
+        }
     }
 
Index: trunk/src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java
===================================================================
--- trunk/src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java	(revision 2675)
+++ trunk/src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java	(revision 2676)
@@ -23,10 +23,10 @@
     private static class PrefixSuffixSwitcher {
 
+        private static final String SEPARATOR = "[:_]?";
+
         private final String a;
         private final String b;
         private final Pattern startPattern;
         private final Pattern endPattern;
-
-        private final String SEPARATOR = "[:_]?";
 
         public PrefixSuffixSwitcher(String a, String b) {
Index: trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java
===================================================================
--- trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java	(revision 2675)
+++ trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java	(revision 2676)
@@ -13,4 +13,5 @@
 import java.util.Map;
 import java.util.Set;
+import java.util.Map.Entry;
 
 import javax.swing.JLabel;
@@ -151,7 +152,7 @@
 
             if (answer == JOptionPane.YES_OPTION) {
-                for (OsmPrimitive primitive : tagCorrectionsMap.keySet()) {
-                    List<TagCorrection> tagCorrections =
-                        tagCorrectionsMap.get(primitive);
+                for (Entry<OsmPrimitive, List<TagCorrection>> entry : tagCorrectionsMap.entrySet()) {
+                    List<TagCorrection> tagCorrections = entry.getValue();
+                    OsmPrimitive primitive = entry.getKey();
 
                     // create the clone
@@ -186,7 +187,7 @@
                     }
                 }
-                for (OsmPrimitive primitive : roleCorrectionMap.keySet()) {
-                    List<RoleCorrection> roleCorrections = roleCorrectionMap
-                    .get(primitive);
+                for (Entry<OsmPrimitive, List<RoleCorrection>> entry : roleCorrectionMap.entrySet()) {
+                    OsmPrimitive primitive = entry.getKey();
+                    List<RoleCorrection> roleCorrections = entry.getValue();
 
                     for (int i = 0; i < roleCorrections.size(); i++) {
Index: trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Changeset.java	(revision 2675)
+++ trunk/src/org/openstreetmap/josm/data/osm/Changeset.java	(revision 2676)
@@ -230,9 +230,6 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + (id ^ (id >>> 32));
         if (id > 0)
-            return prime * result + getClass().hashCode();
+            return id;
         else
             return super.hashCode();
Index: trunk/src/org/openstreetmap/josm/data/osm/Filter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Filter.java	(revision 2675)
+++ trunk/src/org/openstreetmap/josm/data/osm/Filter.java	(revision 2676)
@@ -1,7 +1,6 @@
 package org.openstreetmap.josm.data.osm;
 
-import org.openstreetmap.josm.actions.search.SearchAction;
+import org.openstreetmap.josm.actions.search.SearchAction.SearchMode;
 import org.openstreetmap.josm.actions.search.SearchAction.SearchSetting;
-import org.openstreetmap.josm.actions.search.SearchAction.SearchMode;
 
 /**
@@ -10,40 +9,49 @@
  */
 public class Filter extends SearchSetting {
-   private final String version = "1";
-   public Boolean enable = true;
-   public Boolean hide = false;
-   public Boolean inverted = false;
-   public Boolean applyForChildren = true;
-   public Filter() {
-       super("", SearchMode.add, false, false);
-   }
-   public Filter(String text, SearchMode mode, boolean caseSensitive, boolean regexSearch) {
-       super(text, mode, caseSensitive, regexSearch);
-   }
+    private static final String version = "1";
 
-   public Filter(String prefText){
-      super("", SearchMode.add, false, false);
-      String[] prfs = prefText.split(";");
-      if(prfs.length != 10 && !prfs[0].equals(version))
-         throw new Error("Incompatible filter preferences");
-      text = prfs[1];
-      if(prfs[2].equals("replace")) mode = SearchMode.replace;
-      if(prfs[2].equals("add")) mode = SearchMode.add;
-      if(prfs[2].equals("remove")) mode = SearchMode.remove;
-      if(prfs[2].equals("in_selection")) mode = SearchMode.in_selection;
-      caseSensitive = Boolean.parseBoolean(prfs[3]);
-      regexSearch = Boolean.parseBoolean(prfs[4]);
-      enable = Boolean.parseBoolean(prfs[6]);
-      hide = Boolean.parseBoolean(prfs[7]);
-      inverted = Boolean.parseBoolean(prfs[8]);
-      applyForChildren = Boolean.parseBoolean(prfs[9]);
+    public Boolean enable = true;
+    public Boolean hide = false;
+    public Boolean inverted = false;
+    public Boolean applyForChildren = true;
+    public Filter() {
+        super("", SearchMode.add, false, false);
+    }
+    public Filter(String text, SearchMode mode, boolean caseSensitive, boolean regexSearch) {
+        super(text, mode, caseSensitive, regexSearch);
+    }
 
-   }
+    public Filter(String prefText){
+        super("", SearchMode.add, false, false);
+        String[] prfs = prefText.split(";");
+        if(prfs.length != 10 && !prfs[0].equals(version))
+            throw new Error("Incompatible filter preferences");
+        text = prfs[1];
+        if(prfs[2].equals("replace")) {
+            mode = SearchMode.replace;
+        }
+        if(prfs[2].equals("add")) {
+            mode = SearchMode.add;
+        }
+        if(prfs[2].equals("remove")) {
+            mode = SearchMode.remove;
+        }
+        if(prfs[2].equals("in_selection")) {
+            mode = SearchMode.in_selection;
+        }
+        caseSensitive = Boolean.parseBoolean(prfs[3]);
+        regexSearch = Boolean.parseBoolean(prfs[4]);
+        enable = Boolean.parseBoolean(prfs[6]);
+        hide = Boolean.parseBoolean(prfs[7]);
+        inverted = Boolean.parseBoolean(prfs[8]);
+        applyForChildren = Boolean.parseBoolean(prfs[9]);
 
-   public String getPrefString(){
-      return version + ";" +
-          text + ";" + mode + ";" + caseSensitive + ";" + regexSearch + ";" +
-          "legacy" + ";" + enable + ";" + hide + ";" +
-          inverted + ";" + applyForChildren;
-   }
+    }
+
+    public String getPrefString(){
+        return version + ";" +
+        text + ";" + mode + ";" + caseSensitive + ";" + regexSearch + ";" +
+        "legacy" + ";" + enable + ";" + hide + ";" +
+        inverted + ";" + applyForChildren;
+    }
 }
Index: trunk/src/org/openstreetmap/josm/data/projection/Puwg.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/Puwg.java	(revision 2675)
+++ trunk/src/org/openstreetmap/josm/data/projection/Puwg.java	(revision 2676)
@@ -3,9 +3,8 @@
 package org.openstreetmap.josm.data.projection;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.GridBagLayout;
 import java.text.DecimalFormat;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.awt.GridBagLayout;
 import java.util.Collection;
 import java.util.Collections;
@@ -40,4 +39,5 @@
     private static DecimalFormat decFormatter = new DecimalFormat("###0");
 
+    @Override
     public EastNorth latlon2eastNorth(LatLon p) {
         PuwgData z = Zones[zone];
@@ -50,4 +50,5 @@
     }
 
+    @Override
     public LatLon eastNorth2latlon(EastNorth p) {
         PuwgData z = Zones[zone];
@@ -63,4 +64,5 @@
     }
 
+    @Override
     public String toCode() {
         return Zones[zone].toCode();
@@ -72,12 +74,15 @@
     }
 
+    @Override
     public String getCacheDirectoryName() {
         return Zones[zone].getCacheDirectoryName();
     }
 
+    @Override
     public Bounds getWorldBoundsLatLon() {
         return Zones[zone].getWorldBoundsLatLon();
     }
 
+    @Override
     public double getDefaultZoomInPPD() {
         // This will set the scale bar to about 100 km
@@ -93,4 +98,5 @@
     }
 
+    @Override
     public void setupPreferencePanel(JPanel p) {
         JComboBox prefcb = new JComboBox(Puwg.Zones);
@@ -105,6 +111,7 @@
     }
 
+    @Override
     public Collection<String> getPreferences(JPanel p) {
-    Object prefcb = p.getComponent(2);
+        Object prefcb = p.getComponent(2);
         if(!(prefcb instanceof JComboBox))
             return null;
@@ -113,4 +120,5 @@
     }
 
+    @Override
     public Collection<String> getPreferencesFromCode(String code)
     {
@@ -118,9 +126,10 @@
         {
             if(code.equals(p.toCode()))
-            return Collections.singleton(code);
+                return Collections.singleton(code);
         }
         return null;
     }
 
+    @Override
     public void setPreferences(Collection<String> args)
     {
@@ -131,10 +140,11 @@
                 for(String s : args)
                 {
-                for (int i=0; i < Puwg.Zones.length; ++i)
-                    if(s.equals(Zones[i].toCode()))
-                    zone = i;
-                break;
+                    for (int i=0; i < Puwg.Zones.length; ++i)
+                        if(s.equals(Zones[i].toCode())) {
+                            zone = i;
+                        }
+                    break;
                 }
-            } catch (NullPointerException e) {};
+            } catch (NullPointerException e) {}
         }
     }
@@ -151,8 +161,8 @@
 class Epsg2180 implements PuwgData {
 
-    final private double Epsg2180FalseEasting = 500000.0; /* y */
-    final private double Epsg2180FalseNorthing = -5300000.0; /* x */
-    final private double Epsg2180ScaleFactor = 0.9993;
-    final private double Epsg2180CentralMeridian = 19.0;
+    private static final double Epsg2180FalseEasting = 500000.0; /* y */
+    private static final double Epsg2180FalseNorthing = -5300000.0; /* x */
+    private static final double Epsg2180ScaleFactor = 0.9993;
+    private static final double Epsg2180CentralMeridian = 19.0;
     private static DecimalFormat decFormatter = new DecimalFormat("###0");
 
@@ -202,8 +212,8 @@
 abstract class Puwg2000 implements PuwgData {
 
-    final private double PuwgFalseEasting = 500000.0;
-    final private double PuwgFalseNorthing = 0;
-    final private double PuwgScaleFactor = 0.999923;
-    final private double[] Puwg2000CentralMeridian = {15.0, 18.0, 21.0, 24.0};
+    private static final double PuwgFalseEasting = 500000.0;
+    private static final double PuwgFalseNorthing = 0;
+    private static final double PuwgScaleFactor = 0.999923;
+    //final private double[] Puwg2000CentralMeridian = {15.0, 18.0, 21.0, 24.0};
     final private String[] Puwg2000Code = { "EPSG:2176",  "EPSG:2177", "EPSG:2178", "EPSG:2179"};
     final private String[] Puwg2000CDName = { "epsg2176",  "epsg2177", "epsg2178", "epsg2179"};
@@ -258,24 +268,28 @@
 
 class Epsg2176 extends Puwg2000 implements Projection {
-    final private int PuwgZone = 5;
-
+    private static final int PuwgZone = 5;
+
+    @Override
     public int getZone() { return PuwgZone; }
 }
 
 class Epsg2177 extends Puwg2000 implements Projection {
-    final private int PuwgZone = 6;
-
+    private static final int PuwgZone = 6;
+
+    @Override
     public int getZone() { return PuwgZone; }
 }
 
 class Epsg2178 extends Puwg2000 implements Projection {
-    final private int PuwgZone = 7;
-
+    private static final int PuwgZone = 7;
+
+    @Override
     public int getZone() { return PuwgZone; }
 }
 
 class Epsg2179 extends Puwg2000 implements Projection {
-    final private int PuwgZone = 8;
-
-    public int getZone() { return PuwgZone; }
-}
+    private static final int PuwgZone = 8;
+
+    @Override
+    public int getZone() { return PuwgZone; }
+}
Index: trunk/src/org/openstreetmap/josm/gui/FileDrop.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/FileDrop.java	(revision 2675)
+++ trunk/src/org/openstreetmap/josm/gui/FileDrop.java	(revision 2676)
@@ -320,6 +320,5 @@
 
                     // Get a useful list
-                    List fileList = (java.util.List)
-                    tr.getTransferData(java.awt.datatransfer.DataFlavor.javaFileListFlavor);
+                    List<?> fileList = (List<?>)tr.getTransferData(java.awt.datatransfer.DataFlavor.javaFileListFlavor);
 
                     // Convert list to array
@@ -429,11 +428,10 @@
         {
             boolean support = false;
-            try
-            {   Class arbitraryDndClass = Class.forName( "java.awt.dnd.DnDConstants" );
-            support = true;
-            }   // end try
-            catch( Exception e )
-            {   support = false;
-            }   // end catch
+            try {
+                Class.forName( "java.awt.dnd.DnDConstants" );
+                support = true;
+            } catch( Exception e ) {
+                support = false;
+            }
             supportsDnD = support;
         }   // end if: first time through
Index: trunk/src/org/openstreetmap/josm/gui/ScrollViewport.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/ScrollViewport.java	(revision 2675)
+++ trunk/src/org/openstreetmap/josm/gui/ScrollViewport.java	(revision 2676)
@@ -13,5 +13,4 @@
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
-
 import java.util.ArrayList;
 import java.util.List;
@@ -145,9 +144,7 @@
         int direction = scrollDirection;
 
-        if (component == null || direction == NO_SCROLL) {
+        if (component == null || direction == NO_SCROLL)
             return;
-        }
-
-        Dimension compSize = component.getSize();
+
         Rectangle viewRect = vp.getViewRect();
 
@@ -162,10 +159,10 @@
 
         switch (direction) {
-            case UP_DIRECTION :
-                deltaY *= -1;
-                break;
-            case LEFT_DIRECTION :
-                deltaX *= -1;
-                break;
+        case UP_DIRECTION :
+            deltaY *= -1;
+            break;
+        case LEFT_DIRECTION :
+            deltaX *= -1;
+            break;
         }
 
@@ -173,7 +170,6 @@
     }
     public synchronized void scroll(int deltaX, int deltaY) {
-        if (component == null) {
+        if (component == null)
             return;
-        }
         Dimension compSize = component.getSize();
         Rectangle viewRect = vp.getViewRect();
@@ -204,5 +200,5 @@
     public void showOrHideButtons() {
         boolean needButtons = vp.getViewSize().height > vp.getViewRect().height ||
-                              vp.getViewSize().width > vp.getViewRect().width;
+        vp.getViewSize().width > vp.getViewRect().width;
         for (JButton b : buttons) {
             b.setVisible(needButtons);
Index: trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java	(revision 2675)
+++ trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java	(revision 2676)
@@ -47,5 +47,4 @@
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.gui.ExceptionDialogUtil;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
@@ -158,6 +157,4 @@
         public double lon;
         public int zoom;
-        public int osmId;
-        public OsmPrimitiveType type;
 
         public Bounds getDownloadArea() {
@@ -200,6 +197,6 @@
                     currentResult.lon = Double.parseDouble(atts.getValue("lon"));
                     currentResult.zoom = Integer.parseInt(atts.getValue("zoom"));
-                    currentResult.osmId = Integer.parseInt(atts.getValue("id"));
-                    currentResult.type = OsmPrimitiveType.from(atts.getValue("type"));
+                    //currentResult.osmId = Integer.parseInt(atts.getValue("id"));
+                    //currentResult.type = OsmPrimitiveType.from(atts.getValue("type"));
                     data.add(currentResult);
                 } else if (qName.equals("description") && (depth == 3)) {
@@ -383,5 +380,5 @@
     }
 
-    class NamedResultTableColumnModel extends DefaultTableColumnModel {
+    static class NamedResultTableColumnModel extends DefaultTableColumnModel {
         protected void createColumns() {
             TableColumn col = null;
Index: trunk/src/org/openstreetmap/josm/gui/help/HelpApplication.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/HelpApplication.java	(revision 2675)
+++ trunk/src/org/openstreetmap/josm/gui/help/HelpApplication.java	(revision 2676)
@@ -6,21 +6,13 @@
 import java.awt.Rectangle;
 import java.awt.Toolkit;
-import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.lang.Thread.UncaughtExceptionHandler;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.LinkedList;
-import java.util.List;
 import java.util.Map;
-import java.util.logging.FileHandler;
 import java.util.logging.Level;
-import java.util.logging.LogManager;
 import java.util.logging.Logger;
-import java.util.logging.SimpleFormatter;
-
-import javax.swing.JOptionPane;
 
 import org.openstreetmap.josm.Main;
@@ -66,5 +58,4 @@
 
         // construct argument table
-        List<String> argList = Arrays.asList(argArray);
         final Map<String, Collection<String>> args = new HashMap<String, Collection<String>>();
         for (String arg : argArray) {
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadedObjectsSummaryPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadedObjectsSummaryPanel.java	(revision 2675)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadedObjectsSummaryPanel.java	(revision 2676)
@@ -140,5 +140,5 @@
      *
      */
-    class PrimitiveList extends JList {
+    static class PrimitiveList extends JList {
         public PrimitiveList() {
             super(new PrimitiveListModel());
Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 2675)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 2676)
@@ -40,5 +40,4 @@
 import javax.swing.AbstractListModel;
 import javax.swing.BorderFactory;
-import javax.swing.ButtonGroup;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
@@ -49,5 +48,4 @@
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
-import javax.swing.JRadioButton;
 import javax.swing.JScrollPane;
 import javax.swing.JSeparator;
@@ -90,5 +88,5 @@
     double timezone;
     long delta;
-    
+
     public CorrelateGpxWithImages(GeoImageLayer layer) {
         this.yLayer = layer;
@@ -123,5 +121,5 @@
     JLabel statusBarText;
     StatusBarListener statusBarListener;
-    
+
     // remember the last number of matched photos
     int lastNumMatched = 0;
@@ -440,5 +438,5 @@
     public void actionPerformed(ActionEvent arg0) {
         // Construct the list of loaded GPX tracks
-        Collection<Layer> layerLst = Main.main.map.mapView.getAllLayers();
+        Collection<Layer> layerLst = Main.map.mapView.getAllLayers();
         GpxDataWrapper defaultItem = null;
         Iterator<Layer> iterLayer = layerLst.iterator();
@@ -491,20 +489,18 @@
             timezone = 0;
         }
-        
+
         tfTimezone = new JTextField(10);
         tfTimezone.setText(formatTimezone(timezone));
 
         try {
-        delta = parseOffset(Main.pref.get("geoimage.delta", "0"));
+            delta = parseOffset(Main.pref.get("geoimage.delta", "0"));
         } catch (ParseException e) {
             delta = 0;
         }
         delta = delta / 1000;
-        
+
         tfOffset = new JTextField(10);
         tfOffset.setText(Long.toString(delta));
-        
-        JPanel panelBtn = new JPanel();
-        
+
         JButton buttonViewGpsPhoto = new JButton(tr("<html>Use photo of an accurate clock,<br>"
                 + "e.g. GPS receiver display</html>"));
@@ -519,5 +515,5 @@
 
         JLabel labelPosition = new JLabel(tr("Override position for: "));
- 
+
         int numAll = getSortedImgList(true, true).size();
         int numExif = numAll - getSortedImgList(false, true).size();
@@ -529,5 +525,5 @@
         cbTaggedImg = new JCheckBox(tr("Images that are already tagged ({0}/{1})", numTagged, numAll), true);
         cbTaggedImg.setEnabled(numTagged != 0);
-        
+
         labelPosition.setEnabled(cbExifImg.isEnabled() || cbTaggedImg.isEnabled());
 
@@ -540,5 +536,5 @@
                     yLayer.loadThumbs();
                 } else {
-                }        
+                }
             }
         });*/
@@ -549,6 +545,6 @@
         gbc.gridy = y++;
         panelTf.add(panelCb, gbc);
-        
-        
+
+
         gbc = GBC.eol().fill(GBC.HORIZONTAL).insets(0,0,0,12);
         gbc.gridx = 0;
@@ -578,5 +574,5 @@
         gbc.weightx = 1.;
         panelTf.add(tfOffset, gbc);
-        
+
         gbc = GBC.std().insets(5,5,5,5);
         gbc.gridx = 2;
@@ -593,5 +589,5 @@
         gbc.weightx = 0.5;
         panelTf.add(buttonAutoGuess, gbc);
-        
+
         gbc.gridx = 3;
         panelTf.add(buttonAdjust, gbc);
@@ -628,5 +624,5 @@
         statusBarText.setFont(statusBarText.getFont().deriveFont(8));
         statusBar.add(statusBarText);
-        
+
         statusBarListener = new StatusBarListener() {
             @Override
@@ -639,7 +635,7 @@
                     delta = parseOffset(tfOffset.getText().trim());
                 } catch (ParseException e) {
-                     return e.getMessage();
-                }
-                
+                    return e.getMessage();
+                }
+
                 // Construct a list of images that have a date, and sort them on the date.
                 ArrayList<ImageEntry> dateImgLst = getSortedImgList();
@@ -647,9 +643,9 @@
                     ie.cleanTmp();
                 }
-                
+
                 GpxDataWrapper selGpx = selectedGPX(false);
                 if (selGpx == null)
                     return tr("No gpx selected");
-                    
+
                 lastNumMatched = matchGpxTrack(dateImgLst, selGpx.data, (long) (timezone * 3600) + delta);
 
@@ -657,10 +653,10 @@
             }
         };
-        
+
         tfTimezone.getDocument().addDocumentListener(statusBarListener);
         tfOffset.getDocument().addDocumentListener(statusBarListener);
         cbExifImg.addItemListener(statusBarListener);
         cbTaggedImg.addItemListener(statusBarListener);
-        
+
         statusBarListener.updateStatusBar();
 
@@ -683,13 +679,12 @@
         syncDialog.pack();
         syncDialog.addWindowListener(new WindowAdapter() {
-            final int CANCEL = -1;
-            final int DONE = 0;
-            final int AGAIN = 1;
-            final int NOTHING = 2;
+            final static int CANCEL = -1;
+            final static int DONE = 0;
+            final static int AGAIN = 1;
+            final static int NOTHING = 2;
             private int checkAndSave() {
-                if (syncDialog.isVisible()) {
+                if (syncDialog.isVisible())
                     // nothing happened: JOSM was minimized or similar
-                    return NOTHING;             
-                }
+                    return NOTHING;
                 int answer = syncDialog.getValue();
                 if(answer != 1)
@@ -704,13 +699,13 @@
                     return AGAIN;
                 }
-                
+
                 try {
                     delta = parseOffset(tfOffset.getText().trim());
                 } catch (ParseException e) {
-                        JOptionPane.showMessageDialog(Main.parent, e.getMessage(),
-                                tr("Invalid offset"), JOptionPane.ERROR_MESSAGE);
+                    JOptionPane.showMessageDialog(Main.parent, e.getMessage(),
+                            tr("Invalid offset"), JOptionPane.ERROR_MESSAGE);
                     return AGAIN;
                 }
-                
+
                 if (lastNumMatched == 0) {
                     if (new ExtendedDialog(
@@ -718,68 +713,69 @@
                             tr("Correlate images with GPX track"),
                             new String[] { tr("OK"), tr("Try Again") }).
-                        setContent(tr("No images could be matched!")).
-                        setButtonIcons(new String[] { "ok.png", "dialogs/refresh.png"}).
-                        showDialog().getValue() == 2)
-                            return AGAIN;
+                            setContent(tr("No images could be matched!")).
+                            setButtonIcons(new String[] { "ok.png", "dialogs/refresh.png"}).
+                            showDialog().getValue() == 2)
+                        return AGAIN;
                 }
                 return DONE;
             }
-            
+
+            @Override
             public void windowDeactivated(WindowEvent e) {
                 int result = checkAndSave();
                 switch (result) {
-                    case NOTHING:
-                        break;
-                    case CANCEL:
-                    {
-                        for (ImageEntry ie : yLayer.data) {
-                            ie.tmp = null;
-                        }
-                        yLayer.updateBufferAndRepaint();
-                        break;
+                case NOTHING:
+                    break;
+                case CANCEL:
+                {
+                    for (ImageEntry ie : yLayer.data) {
+                        ie.tmp = null;
                     }
-                    case AGAIN:
-                        actionPerformed(null);
-                        break;
-                    case DONE:
-                    {
-                        Main.pref.put("geoimage.timezone", formatTimezone(timezone));
-                        Main.pref.put("geoimage.delta", Long.toString(delta * 1000));
-                        Main.pref.put("geoimage.showThumbs", yLayer.useThumbs);
-
-                        yLayer.useThumbs = cbShowThumbs.isSelected();//FIXME
-                        yLayer.loadThumbs();
-                        
-                        // Search whether an other layer has yet defined some bounding box.
-                        // If none, we'll zoom to the bounding box of the layer with the photos.
-                        boolean boundingBoxedLayerFound = false;
-                        for (Layer l: Main.map.mapView.getAllLayers()) {
-                            if (l != yLayer) {
-                                BoundingXYVisitor bbox = new BoundingXYVisitor();
-                                l.visitBoundingBox(bbox);
-                                if (bbox.getBounds() != null) {
-                                    boundingBoxedLayerFound = true;
-                                    break;
-                                }
+                    yLayer.updateBufferAndRepaint();
+                    break;
+                }
+                case AGAIN:
+                    actionPerformed(null);
+                    break;
+                case DONE:
+                {
+                    Main.pref.put("geoimage.timezone", formatTimezone(timezone));
+                    Main.pref.put("geoimage.delta", Long.toString(delta * 1000));
+                    Main.pref.put("geoimage.showThumbs", yLayer.useThumbs);
+
+                    yLayer.useThumbs = cbShowThumbs.isSelected();//FIXME
+                    yLayer.loadThumbs();
+
+                    // Search whether an other layer has yet defined some bounding box.
+                    // If none, we'll zoom to the bounding box of the layer with the photos.
+                    boolean boundingBoxedLayerFound = false;
+                    for (Layer l: Main.map.mapView.getAllLayers()) {
+                        if (l != yLayer) {
+                            BoundingXYVisitor bbox = new BoundingXYVisitor();
+                            l.visitBoundingBox(bbox);
+                            if (bbox.getBounds() != null) {
+                                boundingBoxedLayerFound = true;
+                                break;
                             }
                         }
-                        if (! boundingBoxedLayerFound) {
-                            BoundingXYVisitor bbox = new BoundingXYVisitor();
-                            yLayer.visitBoundingBox(bbox);
-                            Main.map.mapView.recalculateCenterScale(bbox);
-                        }
-
-
-                        for (ImageEntry ie : yLayer.data) {
-                            ie.applyTmp();
-                        }
-
-                        yLayer.updateBufferAndRepaint();
-
-
-                        break;
                     }
-                    default:
-                        throw new IllegalStateException();
+                    if (! boundingBoxedLayerFound) {
+                        BoundingXYVisitor bbox = new BoundingXYVisitor();
+                        yLayer.visitBoundingBox(bbox);
+                        Main.map.mapView.recalculateCenterScale(bbox);
+                    }
+
+
+                    for (ImageEntry ie : yLayer.data) {
+                        ie.applyTmp();
+                    }
+
+                    yLayer.updateBufferAndRepaint();
+
+
+                    break;
+                }
+                default:
+                    throw new IllegalStateException();
                 }
             }
@@ -807,14 +803,14 @@
      */
     private class AdjustActionListener implements ActionListener {
-    
+
         public void actionPerformed(ActionEvent arg0) {
 
             long diff = delta + Math.round(timezone*60*60);
-            
+
             double diffInH = (double)diff/(60*60);    // hours
 
             // Find day difference
             final int dayOffset = (int)Math.round(diffInH / 24); // days
-            double tmz = diff - dayOffset*24*60*60;  // seconds
+            double tmz = diff - dayOffset*24*60*60l;  // seconds
 
             // In hours, rounded to two decimal places
@@ -881,7 +877,7 @@
                     tfTimezone.getDocument().removeDocumentListener(statusBarListener);
                     tfOffset.getDocument().removeDocumentListener(statusBarListener);
-                    
+
                     tfTimezone.setText(formatTimezone(timezone));
-                    tfOffset.setText(Long.toString(delta + dayOffset*24*60*60));    // add the day offset to the offset field
+                    tfOffset.setText(Long.toString(delta + dayOffset*24*60*60l));    // add the day offset to the offset field
 
                     tfTimezone.getDocument().addDocumentListener(statusBarListener);
@@ -937,10 +933,10 @@
                     tr("Adjust timezone and offset"),
                     new String[] { tr("Close")}).
-                setContent(p).setButtonIcons(new String[] {"ok.png"}).showDialog();
+                    setContent(p).setButtonIcons(new String[] {"ok.png"}).showDialog();
         }
     }
 
     private class AutoGuessActionListener implements ActionListener {
-    
+
         public void actionPerformed(ActionEvent arg0) {
             GpxDataWrapper gpxW = selectedGPX(true);
@@ -948,5 +944,5 @@
                 return;
             GpxData gpx = gpxW.data;
-            
+
             ArrayList<ImageEntry> imgs = getSortedImgList();
             PrimaryDateParser dateParser = new PrimaryDateParser();
@@ -996,5 +992,5 @@
             // Find day difference
             int dayOffset = (int)Math.round(diffInH / 24); // days
-            double tz = diff - dayOffset*24*60*60;  // seconds
+            double tz = diff - dayOffset*24*60*60l;  // seconds
 
             // In hours, rounded to two decimal places
@@ -1004,5 +1000,5 @@
             // -2 minutes offset. This determines the real timezone and finds offset.
             timezone = (double)Math.round(tz * 2)/2; // hours, rounded to one decimal place
-            delta = (long)Math.round(diff - timezone*60*60); // seconds
+            delta = Math.round(diff - timezone*60*60); // seconds
 
             /*System.out.println("phto " + firstExifDate);
@@ -1017,5 +1013,5 @@
             tfTimezone.getDocument().removeDocumentListener(statusBarListener);
             tfOffset.getDocument().removeDocumentListener(statusBarListener);
-            
+
             tfTimezone.setText(formatTimezone(timezone));
             tfOffset.setText(Long.toString(delta));
@@ -1024,5 +1020,5 @@
             tfTimezone.getDocument().addDocumentListener(statusBarListener);
             tfOffset.getDocument().addDocumentListener(statusBarListener);
-            
+
             statusBarListener.updateStatusBar();
             yLayer.updateBufferAndRepaint();
@@ -1033,10 +1029,10 @@
         return getSortedImgList(cbExifImg.isSelected(), cbTaggedImg.isSelected());
     }
-    
+
     /**
      * Returns a list of images that fulfill the given criteria.
      * Default setting is to return untagged images, but may be overwritten.
      * @param boolean all -- returns all available images
-     * @param boolean noexif -- returns untagged images without EXIF-GPS coords 
+     * @param boolean noexif -- returns untagged images without EXIF-GPS coords
      *                          this parameter is irrelevant if <code>all</code> is true
      * @param boolean exif -- also returns images with exif-gps info
@@ -1047,20 +1043,23 @@
         ArrayList<ImageEntry> dateImgLst = new ArrayList<ImageEntry>(yLayer.data.size());
         for (ImageEntry e : yLayer.data) {
-            if (e.time == null)
+            if (e.time == null) {
                 continue;
-                
+            }
+
             if (e.exifCoor != null) {
-                if (!exif)
+                if (!exif) {
                     continue;
-            }
-                
+                }
+            }
+
             if (e.isTagged() && e.exifCoor == null) {
-                if (!tagged)
+                if (!tagged) {
                     continue;
-            }
-                
+                }
+            }
+
             dateImgLst.add(e);
         }
-        
+
         Collections.sort(dateImgLst, new Comparator<ImageEntry>() {
             public int compare(ImageEntry arg0, ImageEntry arg1) {
@@ -1251,8 +1250,8 @@
 
     private double parseTimezone(String timezone) throws ParseException {
- 
+
         String error = tr("Error while parsing timezone.\nExpected format: {0}", "+H:MM");
- 
- 
+
+
         if (timezone.length() == 0)
             return 0;
@@ -1324,5 +1323,5 @@
     private long parseOffset(String offset) throws ParseException {
         String error = tr("Error while parsing offset.\nExpected format: {0}", "number");
-    
+
         if (offset.length() > 0) {
             try {
@@ -1334,7 +1333,6 @@
                 throw new ParseException(error,0);
             }
-        } else {
+        } else
             return 0;
-        }
     }
 }
Index: trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java	(revision 2675)
+++ trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java	(revision 2676)
@@ -77,10 +77,8 @@
         } catch (OsmTransferException e) {
             throw e;
-        } catch (Exception e) {
+        } catch (RuntimeException e) {
             if (cancel)
                 return null;
-            if (e instanceof RuntimeException)
-                throw (RuntimeException)e;
-            throw new RuntimeException(e);
+            throw e;
         } finally {
             progressMonitor.finishTask();
Index: trunk/src/org/openstreetmap/josm/io/NmeaReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/NmeaReader.java	(revision 2675)
+++ trunk/src/org/openstreetmap/josm/io/NmeaReader.java	(revision 2676)
@@ -233,5 +233,6 @@
     private boolean ParseNMEASentence(String s, NMEAParserState ps) {
         try {
-            if(s.equals("")) throw(null);
+            if (s.equals(""))
+                throw new NullPointerException();
 
             // checksum check:
@@ -444,5 +445,5 @@
             return true;
 
-        } catch(Exception x) {
+        } catch(RuntimeException x) {
             // out of bounds and such
             // x.printStackTrace();
Index: trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java	(revision 2675)
+++ trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java	(revision 2676)
@@ -31,5 +31,5 @@
  */
 public class XmlObjectParser implements Iterable<Object> {
-    public class PresetParsingException extends SAXException {
+    public static class PresetParsingException extends SAXException {
         private int columnNumber;
         private int lineNumber;
@@ -110,8 +110,4 @@
         public void setDocumentLocator(Locator locator) {
             this.locator = locator;
-        }
-
-        protected void throwException(String msg) throws PresetParsingException{
-            throw new PresetParsingException(msg).rememberLocation(locator);
         }
 
