Index: /trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java	(revision 4874)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.actions;
 
+import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 
 import java.awt.event.ActionEvent;
@@ -16,5 +16,4 @@
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.actions.ExtensionFileFilter;
 import org.openstreetmap.josm.gui.HelpAwareOptionPane;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
@@ -57,5 +56,5 @@
     }
 
-    public class Loader extends PleaseWaitRunnable {
+    public static class Loader extends PleaseWaitRunnable {
 
         private boolean canceled;
@@ -89,5 +88,7 @@
                     for (Runnable task : postLoadTasks) {
                         if (canceled) return;
-                        if (task == null) continue;
+                        if (task == null) {
+                            continue;
+                        }
                         task.run();
                     }
@@ -112,5 +113,5 @@
                         JOptionPane.ERROR_MESSAGE,
                         null
-                );
+                        );
                 cancel();
             } catch (IOException e) {
@@ -122,5 +123,5 @@
                         JOptionPane.ERROR_MESSAGE,
                         null
-                );
+                        );
                 cancel();
             } catch (RuntimeException e) {
Index: /trunk/src/org/openstreetmap/josm/actions/ValidateAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/ValidateAction.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/actions/ValidateAction.java	(revision 4874)
@@ -34,5 +34,5 @@
  */
 public class ValidateAction extends JosmAction {
-    
+
     /** Serializable ID */
     private static final long serialVersionUID = -2304521273582574603L;
@@ -46,5 +46,5 @@
     public ValidateAction() {
         super(tr("Validation"), "dialogs/validator", tr("Performs the data validation"),
-        Shortcut.registerShortcut("tools:validate", tr("Tool: {0}", tr("Validation")), KeyEvent.VK_V, Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true);
+                Shortcut.registerShortcut("tools:validate", tr("Tool: {0}", tr("Validation")), KeyEvent.VK_V, Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true);
     }
 
@@ -106,5 +106,5 @@
      *
      */
-    class ValidationTask extends PleaseWaitRunnable {
+    static class ValidationTask extends PleaseWaitRunnable {
         private Collection<Test> tests;
         private Collection<OsmPrimitive> validatedPrimitives;
@@ -154,5 +154,5 @@
         @Override
         protected void realRun() throws SAXException, IOException,
-                OsmTransferException {
+        OsmTransferException {
             if (tests == null || tests.isEmpty())
                 return;
Index: /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java	(revision 4874)
@@ -57,5 +57,5 @@
         return Main.worker.submit(downloadTask);
     }
-    
+
     protected class DownloadTask extends DownloadOsmTask.DownloadTask {
 
@@ -114,8 +114,8 @@
      *
      */
-    private class HistoryListener implements HistoryDataSetListener {
+    private static class HistoryListener implements HistoryDataSetListener {
 
         private final List<Pair<OsmPrimitive, Date>> toMonitor;
-        
+
         public HistoryListener(List<Pair<OsmPrimitive, Date>> toMonitor) {
             this.toMonitor = toMonitor;
@@ -133,21 +133,21 @@
                     if (hp != null) {
                         PrimitiveData data = null;
-                        
+
                         switch (pair.a.getType()) {
-                            case NODE:
-                                data = new NodeData();
-                                ((NodeData)data).setCoor(((HistoryNode)hp).getCoords());
-                                break;
-                            case WAY: 
-                                data = new WayData();
-                                ((WayData)data).setNodes(((HistoryWay)hp).getNodes());
-                                break;
-                            case RELATION: 
-                                data = new RelationData();
-                                ((RelationData)data).setMembers(((HistoryRelation)hp).getMembers());
-                                break;
-                            default: throw new AssertionError();
+                        case NODE:
+                            data = new NodeData();
+                            ((NodeData)data).setCoor(((HistoryNode)hp).getCoords());
+                            break;
+                        case WAY:
+                            data = new WayData();
+                            ((WayData)data).setNodes(((HistoryWay)hp).getNodes());
+                            break;
+                        case RELATION:
+                            data = new RelationData();
+                            ((RelationData)data).setMembers(((HistoryRelation)hp).getMembers());
+                            break;
+                        default: throw new AssertionError();
                         }
-                        
+
                         data.setUser(hp.getUser());
                         data.setVisible(hp.isVisible());
@@ -155,5 +155,5 @@
                         data.setKeys(hp.getTags());
                         data.setOsmId(hp.getChangesetId(), (int) hp.getVersion());
-                        
+
                         // Load the history data
                         pair.a.load(data);
Index: /trunk/src/org/openstreetmap/josm/data/APIDataSet.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/APIDataSet.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/data/APIDataSet.java	(revision 4874)
@@ -73,7 +73,7 @@
         OsmPrimitiveComparator c = new OsmPrimitiveComparator();
         c.relationsFirst = true;
-        Collections.sort(toDelete, c); 
-        Collections.sort(toAdd, c); 
-        Collections.sort(toUpdate, c); 
+        Collections.sort(toDelete, c);
+        Collections.sort(toAdd, c);
+        Collections.sort(toUpdate, c);
     }
 
@@ -154,7 +154,7 @@
         OsmPrimitiveComparator c = new OsmPrimitiveComparator();
         c.relationsFirst = true;
-        Collections.sort(toDelete, c); 
-        Collections.sort(toAdd, c); 
-        Collections.sort(toUpdate, c); 
+        Collections.sort(toDelete, c);
+        Collections.sort(toAdd, c);
+        Collections.sort(toUpdate, c);
     }
 
@@ -278,5 +278,5 @@
      *
      */
-    private class RelationUploadDependencyGraph {
+    private static class RelationUploadDependencyGraph {
         private HashMap<Relation, Set<Relation>> children;
         private Collection<Relation> relations;
@@ -353,5 +353,5 @@
                         }
                     }
-            );
+                    );
             return ret;
         }
Index: /trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java	(revision 4874)
@@ -15,9 +15,4 @@
 import java.net.URL;
 import java.net.URLConnection;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.StringTokenizer;
-import java.util.Map.Entry;
 
 import javax.swing.JOptionPane;
@@ -26,5 +21,4 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.io.OsmConnection;
-import org.openstreetmap.josm.io.OsmTransferException;
 import org.openstreetmap.josm.tools.Base64;
 
@@ -36,5 +30,5 @@
  */
 public class ServerSidePreferences extends Preferences {
-    public class MissingPassword extends Exception{
+    public static class MissingPassword extends Exception{
         public String realm;
         public MissingPassword(String r) {
@@ -56,10 +50,11 @@
                 String username = get("applet.username");
                 String password = get("applet.password");
-                if(password.isEmpty() && username.isEmpty())
+                if(password.isEmpty() && username.isEmpty()) {
                     con.addRequestProperty("Authorization", "Basic "+Base64.encode(username+":"+password));
+                }
                 con.connect();
                 if(username.isEmpty() && con instanceof HttpURLConnection
-                    && ((HttpURLConnection) con).getResponseCode()
-                    == HttpURLConnection.HTTP_UNAUTHORIZED) {
+                        && ((HttpURLConnection) con).getResponseCode()
+                        == HttpURLConnection.HTTP_UNAUTHORIZED) {
                     String t = ((HttpURLConnection) con).getHeaderField("WWW-Authenticate");
                     t = t.replace("Basic realm=\"","").replace("\"","");
@@ -88,6 +83,7 @@
                 String username = get("applet.username");
                 String password = get("applet.password");
-                if(password.isEmpty() && username.isEmpty())
+                if(password.isEmpty() && username.isEmpty()) {
                     con.addRequestProperty("Authorization", "Basic "+Base64.encode(username+":"+password));
+                }
                 con.setRequestMethod("POST");
                 con.setDoOutput(true);
@@ -103,5 +99,5 @@
                         tr("Information"),
                         JOptionPane.INFORMATION_MESSAGE
-                );
+                        );
             } catch (Exception e) {
                 e.printStackTrace();
@@ -111,5 +107,5 @@
                         tr("Error"),
                         JOptionPane.ERROR_MESSAGE
-                );
+                        );
             }
         }
@@ -127,5 +123,5 @@
                     tr("Error"),
                     JOptionPane.ERROR_MESSAGE
-            );
+                    );
         }
         this.connection = connection;
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/DeprecatedTags.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/DeprecatedTags.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/DeprecatedTags.java	(revision 4874)
@@ -1,7 +1,4 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import org.openstreetmap.josm.data.osm.Node;
-import org.openstreetmap.josm.data.osm.Relation;
-import org.openstreetmap.josm.data.osm.Way;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
@@ -9,9 +6,13 @@
 import java.util.LinkedList;
 import java.util.List;
+
 import org.openstreetmap.josm.command.ChangePropertyCommand;
 import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.command.SequenceCommand;
+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.Tag;
+import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.validation.Severity;
 import org.openstreetmap.josm.data.validation.Test;
@@ -97,5 +98,5 @@
     }
 
-    private class DeprecationCheck {
+    private static class DeprecationCheck {
 
         int code;
@@ -148,10 +149,8 @@
                 String key = tag.getKey();
                 String value = tag.getValue();
-                if (value.isEmpty() && !p.hasKey(key)) {
+                if (value.isEmpty() && !p.hasKey(key))
                     return false;
-                }
-                if (!value.isEmpty() && !value.equals(p.get(key))) {
+                if (!value.isEmpty() && !value.equals(p.get(key)))
                     return false;
-                }
             }
             return true;
@@ -167,9 +166,8 @@
 
         String getDescription() {
-            if (alternatives.isEmpty()) {
+            if (alternatives.isEmpty())
                 return tr("{0} is deprecated", Utils.join(", ", test));
-            } else {
+            else
                 return tr("{0} is deprecated, use {1} instead", Utils.join(", ", test), Utils.join(tr(" or "), alternatives));
-            }
         }
     }
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 4874)
@@ -39,5 +39,5 @@
 public class DuplicateNode extends Test {
 
-    private class NodeHash implements Hash<Object, Object> {
+    private static class NodeHash implements Hash<Object, Object> {
 
         double precision = Main.pref.getDouble("validator.duplicatenodes.precision", 0.);
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java	(revision 4874)
@@ -34,5 +34,5 @@
 {
 
-    public class RelMember {
+    public static class RelMember {
         private String role;
         private OsmPrimitiveType type;
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java	(revision 4874)
@@ -34,5 +34,5 @@
 {
 
-    private class WayPair {
+    private static class WayPair {
         public List<LatLon> coor;
         public Map<String, String> keys;
@@ -56,5 +56,5 @@
     }
 
-    private class WayPairNoTags {
+    private static class WayPairNoTags {
         public List<LatLon> coor;
         public WayPairNoTags(List<LatLon> _coor) {
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java	(revision 4874)
@@ -70,5 +70,5 @@
     }
 
-    public class RoleInfo {
+    public static class RoleInfo {
         int total = 0;
         Collection<Node> nodes = new LinkedList<Node>();
Index: /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 4874)
@@ -1217,5 +1217,5 @@
     }
 
-    private class CursorInfo {
+    private static class CursorInfo {
         public Cursor cursor;
         public Object object;
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 4874)
@@ -143,8 +143,8 @@
 
         createLayout(p, true, Arrays.asList(new SideButton[] {
-            new SideButton(onoffAction),
-            new SideButton(upAction),
-            new SideButton(downAction),
-            new SideButton(new LaunchMapPaintPreferencesAction())
+                new SideButton(onoffAction),
+                new SideButton(upAction),
+                new SideButton(downAction),
+                new SideButton(new LaunchMapPaintPreferencesAction())
         }));
     }
@@ -359,5 +359,5 @@
      * Opens preferences window and selects the mappaint tab.
      */
-    class LaunchMapPaintPreferencesAction extends AbstractAction {
+    static class LaunchMapPaintPreferencesAction extends AbstractAction {
         public LaunchMapPaintPreferencesAction() {
             putValue(SMALL_ICON, ImageProvider.get("dialogs", "mappaintpreference"));
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationNodeMap.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationNodeMap.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationNodeMap.java	(revision 4874)
@@ -30,5 +30,5 @@
  */
 public class RelationNodeMap {
-    private class NodesWays{
+    private static class NodesWays{
         public Map<Node, Set<Integer>> nodes = new TreeMap<Node, Set<Integer>>();
         public Map<Integer, Set<Node>> ways = new TreeMap<Integer, Set<Node>>();
@@ -108,20 +108,20 @@
          * cannot be used in future. (only for performance)
          */
-//        Iterator<Map.Entry<Node,TreeSet<Integer>>> it = map.nodes.entrySet().iterator();
-//        while (it.hasNext()) {
-//            Map.Entry<Node,TreeSet<Integer>> nodeLinks = it.next();
-//
-//            if (nodeLinks.getValue().size() < 2) {
-//                if (nodeLinks.getValue().size() != 1) throw new AssertionError();
-//
-//                Integer d_way = nodeLinks.getValue().iterator().next();
-//                TreeSet<Node> d_way_nodes = map.ways.get(d_way);
-//                d_way_nodes.remove(nodeLinks.getKey());
-//
-//                it.remove();
-//                continue;
-//            }
-//        }
-            }
+        //        Iterator<Map.Entry<Node,TreeSet<Integer>>> it = map.nodes.entrySet().iterator();
+        //        while (it.hasNext()) {
+        //            Map.Entry<Node,TreeSet<Integer>> nodeLinks = it.next();
+        //
+        //            if (nodeLinks.getValue().size() < 2) {
+        //                if (nodeLinks.getValue().size() != 1) throw new AssertionError();
+        //
+        //                Integer d_way = nodeLinks.getValue().iterator().next();
+        //                TreeSet<Node> d_way_nodes = map.ways.get(d_way);
+        //                d_way_nodes.remove(nodeLinks.getKey());
+        //
+        //                it.remove();
+        //                continue;
+        //            }
+        //        }
+    }
 
     private void addPair(Node n, int i) {
@@ -211,5 +211,5 @@
             }
         }
-        
+
         firstOneway = way;
         return popForwardOnewayPart(way);
@@ -220,10 +220,11 @@
             for (Node n : onewayMap.ways.get(way)) {
                 Integer i = findAdjacentWay(onewayMap, n);
-                if(i == null) continue;
+                if(i == null) {
+                    continue;
+                }
 
                 lastOnewayNode = processBackwardIfEndOfLoopReached(i);
-                if(lastOnewayNode != null){
+                if(lastOnewayNode != null)
                     return popBackwardOnewayPart(firstOneway);
-                }
 
                 deleteWayNode(onewayMap, i, n);
@@ -231,5 +232,5 @@
             }
         }
-        
+
         firstOneway = null;
         return null;
@@ -240,20 +241,22 @@
             for (Node n : onewayReverseMap.ways.get(way)) {
                 if((map.nodes.containsKey(n))
-                        || (onewayMap.nodes.containsKey(n) && onewayMap.nodes.get(n).size() > 1)) {
+                        || (onewayMap.nodes.containsKey(n) && onewayMap.nodes.get(n).size() > 1))
                     return n;
-                }
-                if(firstCircular != null && firstCircular == n) {
+                if(firstCircular != null && firstCircular == n)
                     return firstCircular;
-                }
             }
         }
         return null;
     }
-    
+
     private Integer popBackwardOnewayPart(int way){
         if (lastOnewayNode != null) {
             TreeSet<Node> nodes = new TreeSet<Node>();
-            if (onewayReverseMap.ways.containsKey(way)) nodes.addAll(onewayReverseMap.ways.get(way));
-            if (map.ways.containsKey(way)) nodes.addAll(map.ways.get(way));
+            if (onewayReverseMap.ways.containsKey(way)) {
+                nodes.addAll(onewayReverseMap.ways.get(way));
+            }
+            if (map.ways.containsKey(way)) {
+                nodes.addAll(map.ways.get(way));
+            }
             for (Node n : nodes) {
                 if(n == lastOnewayNode) { //if oneway part ends
@@ -277,5 +280,5 @@
         firstOneway = null;
         lastOnewayNode = null;
-        
+
         return null;
     }
@@ -302,8 +305,9 @@
 
     private void deleteWayNode(NodesWays nw, Integer way, Node n){
-        if(nw.oneWay)
+        if(nw.oneWay) {
             doneOneway(way);
-        else
+        } else {
             done(way);
+        }
         nw.ways.get(way).remove(n);
     }
@@ -343,6 +347,10 @@
         Set<Node> nodesForward = remainingOneway.get(i);
         for (Node n : nodesForward) {
-            if(onewayMap.nodes.containsKey(n)) onewayMap.nodes.get(n).remove(i);
-            if(onewayReverseMap.nodes.containsKey(n)) onewayReverseMap.nodes.get(n).remove(i);
+            if(onewayMap.nodes.containsKey(n)) {
+                onewayMap.nodes.get(n).remove(i);
+            }
+            if(onewayReverseMap.nodes.containsKey(n)) {
+                onewayReverseMap.nodes.get(n).remove(i);
+            }
         }
         remainingOneway.remove(i);
Index: /trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java	(revision 4874)
@@ -6,6 +6,6 @@
 import java.io.BufferedReader;
 import java.io.DataOutputStream;
+import java.io.IOException;
 import java.io.InputStreamReader;
-import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.lang.reflect.Field;
@@ -46,5 +46,5 @@
     private HttpURLConnection connection;
 
-    private class SessionId {
+    private static class SessionId {
         String id;
         String token;
@@ -209,7 +209,6 @@
             while((c = r.readLine()) != null) {
                 Matcher m = p.matcher(c);
-                if(m.find()) {
+                if(m.find())
                     return m.group(1);
-                }
             }
         } catch (IOException e) {
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/AddWMSLayerPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/AddWMSLayerPanel.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/AddWMSLayerPanel.java	(revision 4874)
@@ -147,6 +147,6 @@
                             if(!previouslyShownUnsupportedCrsError) {
                                 JOptionPane.showMessageDialog(null, tr("That layer does not support any of JOSM''s projections,\n" +
-                                "so you can not use it. This message will not show again."),
-                                tr("WMS Error"), JOptionPane.ERROR_MESSAGE);
+                                        "so you can not use it. This message will not show again."),
+                                        tr("WMS Error"), JOptionPane.ERROR_MESSAGE);
                                 previouslyShownUnsupportedCrsError = true;
                             }
@@ -223,5 +223,5 @@
         resultingLayerField = new JTextArea(3, 40);
         resultingLayerField.setLineWrap(true);
-        JScrollPane bottomScrollPane = new JScrollPane(resultingLayerField, 
+        JScrollPane bottomScrollPane = new JScrollPane(resultingLayerField,
                 JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
         bottomScrollPane.setMinimumSize(new Dimension(60, 60));
@@ -250,6 +250,7 @@
         StringBuilder a = new StringBuilder("tms");
         String z = sanitize(tmsZoom.getText());
-        if(!z.isEmpty())
+        if(!z.isEmpty()) {
             a.append("["+z+"]");
+        }
         a.append(":");
         a.append(sanitize(tmsURL.getText()));
@@ -493,11 +494,9 @@
         for (Projection proj : Projections.getProjections()) {
             if (proj instanceof ProjectionSubPrefs) {
-                if (((ProjectionSubPrefs) proj).getPreferencesFromCode(crs) == null) {
+                if (((ProjectionSubPrefs) proj).getPreferencesFromCode(crs) == null)
                     return true;
-                }
             } else {
-                if (proj.toCode().equals(crs)) {
+                if (proj.toCode().equals(crs))
                     return true;
-                }
             }
         }
@@ -511,6 +510,7 @@
         } else if (selectedLayers != null) {
             HashSet<String> proj = new HashSet<String>();
-            for(LayerDetails l : selectedLayers)
+            for(LayerDetails l : selectedLayers) {
                 proj.addAll(l.getProjections());
+            }
             info.setServerProjections(proj);
         }
@@ -520,7 +520,7 @@
     private static String getChildContent(Element parent, String name, String missing, String empty) {
         Element child = getChild(parent, name);
-        if (child == null) {
+        if (child == null)
             return missing;
-        } else {
+        else {
             String content = (String) getContent(child);
             return (content != null) ? content : empty;
@@ -556,16 +556,14 @@
 
     private static Element getChild(Element parent, String name) {
-        if (parent == null) {
+        if (parent == null)
             return null;
-        }
         for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
-            if (child instanceof Element && name.equals(child.getNodeName())) {
+            if (child instanceof Element && name.equals(child.getNodeName()))
                 return (Element) child;
-            }
         }
         return null;
     }
 
-    class LayerDetails {
+    static class LayerDetails {
 
         private String name;
@@ -597,14 +595,13 @@
         @Override
         public String toString() {
-            if(this.name == null || this.name.isEmpty()) {
+            if(this.name == null || this.name.isEmpty())
                 return this.ident;
-            } else {
+            else
                 return this.name;
-            }
-        }
-
-    }
-
-    class LayerTreeCellRenderer extends DefaultTreeCellRenderer {
+        }
+
+    }
+
+    static class LayerTreeCellRenderer extends DefaultTreeCellRenderer {
         @Override
         public Component getTreeCellRendererComponent(JTree tree, Object value,
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/ImageryPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/ImageryPreference.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/ImageryPreference.java	(revision 4874)
@@ -282,5 +282,5 @@
         p.add(pane,GBC.std().fill(GBC.BOTH));
     }
-    
+
     public ImageryProvidersPanel getProvidersPanel() {
         return imageryProviders;
@@ -391,5 +391,5 @@
         public final ImageryLayerTableModel activeModel;
         public final ImageryDefaultLayerTableModel defaultModel;
-        
+
         // Public JToolbars
         public final JToolBar activeToolbar;
@@ -400,18 +400,18 @@
         private final PreferenceTabbedPane gui;
         private final ImageryLayerInfo layerInfo;
-        
-        private class ImageryTableCellRenderer extends DefaultTableCellRenderer {
-            
+
+        private static class ImageryTableCellRenderer extends DefaultTableCellRenderer {
+
             private List<ImageryInfo> layers;
-            
+
             public ImageryTableCellRenderer(List<ImageryInfo> layers) {
                 this.layers = layers;
             }
-            
+
             @Override
             public Component getTableCellRendererComponent(JTable table, Object value, boolean
-            isSelected, boolean hasFocus, int row, int column) {
+                    isSelected, boolean hasFocus, int row, int column) {
                 JLabel label = (JLabel) super.getTableCellRendererComponent(
-                table, value, isSelected, hasFocus, row, column);
+                        table, value, isSelected, hasFocus, row, column);
                 String t = value.toString();
                 label.setBackground(Main.pref.getUIColor("Table.background"));
@@ -423,6 +423,6 @@
                     if(l.getExtendedUrl().equals(t)) {
                         label.setBackground(Main.pref.getColor(
-                        marktr("Imagery Background: Default"),
-                        new Color(200,255,200)));
+                                marktr("Imagery Background: Default"),
+                                new Color(200,255,200)));
                         break;
                     }
@@ -456,20 +456,20 @@
 
             defaultModel.addTableModelListener(
-                new TableModelListener() {
-                    @Override
-                    public void tableChanged(TableModelEvent e) {
-                        activeTable.repaint();
-                    }
-                }
-            );
+                    new TableModelListener() {
+                        @Override
+                        public void tableChanged(TableModelEvent e) {
+                            activeTable.repaint();
+                        }
+                    }
+                    );
 
             activeModel.addTableModelListener(
-                new TableModelListener() {
-                    @Override
-                    public void tableChanged(TableModelEvent e) {
-                        defaultTable.repaint();
-                    }
-                }
-            );
+                    new TableModelListener() {
+                        @Override
+                        public void tableChanged(TableModelEvent e) {
+                            defaultTable.repaint();
+                        }
+                    }
+                    );
 
             TableColumnModel mod = defaultTable.getColumnModel();
@@ -592,5 +592,5 @@
                             mapPolygons.remove(i);
                         }
-                     // Only display bounds when no polygons (shapes) are defined for this provider
+                        // Only display bounds when no polygons (shapes) are defined for this provider
                     } else {
                         if (defaultTable.getSelectionModel().isSelectedIndex(i)) {
@@ -643,7 +643,7 @@
                         activeModel.addRow(p.getImageryInfo());
                     } catch (IllegalArgumentException ex) {
-                        if (ex.getMessage() == null || ex.getMessage().isEmpty()) {
+                        if (ex.getMessage() == null || ex.getMessage().isEmpty())
                             throw ex;
-                        } else {
+                        else {
                             JOptionPane.showMessageDialog(Main.parent,
                                     ex.getMessage(), tr("Error"),
@@ -709,5 +709,5 @@
                     return;
                 }
-                
+
                 Set<String> acceptedEulas = new HashSet<String>();
 
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/MapPaintPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/MapPaintPreference.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/MapPaintPreference.java	(revision 4874)
@@ -32,10 +32,9 @@
 
     public static final boolean registerSourceProvider(SourceProvider provider) {
-        if (provider != null) {
+        if (provider != null)
             return styleSourceProviders.add(provider);
-        }
         return false;
     }
-    
+
     public static class Factory implements PreferenceSettingFactory {
         public PreferenceSetting createPreferenceSetting() {
@@ -69,8 +68,8 @@
                     }
                 }
-        );
-    }
-
-    class MapPaintSourceEditor extends SourceEditor {
+                );
+    }
+
+    static class MapPaintSourceEditor extends SourceEditor {
 
         final private String iconpref = "mappaint.icon.sources";
@@ -118,32 +117,32 @@
         public String getStr(I18nString ident) {
             switch (ident) {
-                case AVAILABLE_SOURCES:
-                    return tr("Available styles:");
-                case ACTIVE_SOURCES:
-                    return tr("Active styles:");
-                case NEW_SOURCE_ENTRY_TOOLTIP:
-                     return tr("Add a new style by entering filename or URL");
-                case NEW_SOURCE_ENTRY:
-                    return tr("New style entry:");
-                case REMOVE_SOURCE_TOOLTIP:
-                    return tr("Remove the selected styles from the list of active styles");
-                case EDIT_SOURCE_TOOLTIP:
-                    return tr("Edit the filename or URL for the selected active style");
-                case ACTIVATE_TOOLTIP:
-                    return tr("Add the selected available styles to the list of active styles");
-                case RELOAD_ALL_AVAILABLE:
-                    return marktr("Reloads the list of available styles from ''{0}''");
-                case LOADING_SOURCES_FROM:
-                    return marktr("Loading style sources from ''{0}''");
-                case FAILED_TO_LOAD_SOURCES_FROM:
-                    return marktr("<html>Failed to load the list of style sources from<br>"
-                            + "''{0}''.<br>"
-                            + "<br>"
-                            + "Details (untranslated):<br>{1}</html>");
-                case FAILED_TO_LOAD_SOURCES_FROM_HELP_TOPIC:
-                    return "/Preferences/Styles#FailedToLoadStyleSources";
-                case ILLEGAL_FORMAT_OF_ENTRY:
-                    return marktr("Warning: illegal format of entry in style list ''{0}''. Got ''{1}''");
-                default: throw new AssertionError();
+            case AVAILABLE_SOURCES:
+                return tr("Available styles:");
+            case ACTIVE_SOURCES:
+                return tr("Active styles:");
+            case NEW_SOURCE_ENTRY_TOOLTIP:
+                return tr("Add a new style by entering filename or URL");
+            case NEW_SOURCE_ENTRY:
+                return tr("New style entry:");
+            case REMOVE_SOURCE_TOOLTIP:
+                return tr("Remove the selected styles from the list of active styles");
+            case EDIT_SOURCE_TOOLTIP:
+                return tr("Edit the filename or URL for the selected active style");
+            case ACTIVATE_TOOLTIP:
+                return tr("Add the selected available styles to the list of active styles");
+            case RELOAD_ALL_AVAILABLE:
+                return marktr("Reloads the list of available styles from ''{0}''");
+            case LOADING_SOURCES_FROM:
+                return marktr("Loading style sources from ''{0}''");
+            case FAILED_TO_LOAD_SOURCES_FROM:
+                return marktr("<html>Failed to load the list of style sources from<br>"
+                        + "''{0}''.<br>"
+                        + "<br>"
+                        + "Details (untranslated):<br>{1}</html>");
+            case FAILED_TO_LOAD_SOURCES_FROM_HELP_TOPIC:
+                return "/Preferences/Styles#FailedToLoadStyleSources";
+            case ILLEGAL_FORMAT_OF_ENTRY:
+                return marktr("Warning: illegal format of entry in style list ''{0}''. Got ''{1}''");
+            default: throw new AssertionError();
             }
         }
@@ -177,6 +176,6 @@
         public MapPaintPrefMigration() {
             super("mappaint.style.sources",
-                  "mappaint.style.enable-defaults",
-                  "mappaint.style.sources-list");
+                    "mappaint.style.enable-defaults",
+                    "mappaint.style.sources-list");
         }
 
@@ -215,5 +214,5 @@
         private boolean insertNewDefaults(List<SourceEntry> list) {
             boolean changed = false;
-            
+
             Collection<String> knownDefaults = new TreeSet<String>(Main.pref.getCollection("mappaint.style.known-defaults"));
 
@@ -223,9 +222,9 @@
                 int i = Utils.indexOf(list,
                         new Predicate<SourceEntry>() {
-                            @Override
-                            public boolean evaluate(SourceEntry se) {
-                                return Utils.equal(def.url, se.url);
-                            }
-                        });
+                    @Override
+                    public boolean evaluate(SourceEntry se) {
+                        return Utils.equal(def.url, se.url);
+                    }
+                });
                 if (i == -1 && !knownDefaults.contains(def.url)) {
                     list.add(insertionIdx, def);
@@ -268,6 +267,6 @@
                     entry.url,
                     entry.name == null ? "" : entry.name,
-                    entry.title == null ? "" : entry.title,
-                    Boolean.toString(entry.active)
+                            entry.title == null ? "" : entry.title,
+                                    Boolean.toString(entry.active)
             });
         }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java	(revision 4874)
@@ -12,9 +12,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Map;
 
 import javax.swing.BorderFactory;
@@ -58,5 +56,5 @@
     }
 
-    private class TabData {
+    private static class TabData {
         public String icon;
         public JComponent tab;
@@ -217,5 +215,5 @@
                             tr("Warning"),
                             JOptionPane.WARNING_MESSAGE
-                    );
+                            );
                 }
                 Main.parent.repaint();
@@ -234,5 +232,5 @@
                         }
                     }
-            );
+                    );
         } else {
             // no need for asynchronous activities. Simply run the remaining "save preference"
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 4874)
@@ -1146,5 +1146,5 @@
             try {
                 sources.addAll(getDefault());
-                
+
                 for (SourceProvider provider : sourceProviders) {
                     for (SourceEntry src : provider.getSources()) {
@@ -1154,5 +1154,5 @@
                     }
                 }
-                
+
                 MirroredInputStream stream = new MirroredInputStream(url);
                 InputStreamReader r;
@@ -1233,5 +1233,5 @@
     }
 
-    class SourceEntryTableCellRenderer extends DefaultTableCellRenderer {
+    static class SourceEntryTableCellRenderer extends DefaultTableCellRenderer {
         @Override
         public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/TaggingPresetPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/TaggingPresetPreference.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/TaggingPresetPreference.java	(revision 4874)
@@ -50,9 +50,8 @@
     private SourceEditor sources;
     private JCheckBox sortMenu;
-    
+
     public static final boolean registerSourceProvider(SourceProvider provider) {
-        if (provider != null) {
+        if (provider != null)
             return presetSourceProviders.add(provider);
-        }
         return false;
     }
@@ -166,9 +165,9 @@
                     }
                 }
-        );
+                );
         gui.addValidationListener(validationListener);
     }
 
-    class TaggingPresetSourceEditor extends SourceEditor {
+    static class TaggingPresetSourceEditor extends SourceEditor {
 
         final private String iconpref = "taggingpreset.icon.sources";
@@ -216,32 +215,32 @@
         public String getStr(I18nString ident) {
             switch (ident) {
-                case AVAILABLE_SOURCES:
-                    return tr("Available presets:");
-                case ACTIVE_SOURCES:
-                    return tr("Active presets:");
-                case NEW_SOURCE_ENTRY_TOOLTIP:
-                     return tr("Add a new preset by entering filename or URL");
-                case NEW_SOURCE_ENTRY:
-                    return tr("New preset entry:");
-                case REMOVE_SOURCE_TOOLTIP:
-                    return tr("Remove the selected presets from the list of active presets");
-                case EDIT_SOURCE_TOOLTIP:
-                    return tr("Edit the filename or URL for the selected active preset");
-                case ACTIVATE_TOOLTIP:
-                    return tr("Add the selected available presets to the list of active presets");
-                case RELOAD_ALL_AVAILABLE:
-                    return marktr("Reloads the list of available presets from ''{0}''");
-                case LOADING_SOURCES_FROM:
-                    return marktr("Loading preset sources from ''{0}''");
-                case FAILED_TO_LOAD_SOURCES_FROM:
-                    return marktr("<html>Failed to load the list of preset sources from<br>"
-                            + "''{0}''.<br>"
-                            + "<br>"
-                            + "Details (untranslated):<br>{1}</html>");
-                case FAILED_TO_LOAD_SOURCES_FROM_HELP_TOPIC:
-                    return "/Preferences/Presets#FailedToLoadPresetSources";
-                case ILLEGAL_FORMAT_OF_ENTRY:
-                    return marktr("Warning: illegal format of entry in preset list ''{0}''. Got ''{1}''");
-                default: throw new AssertionError();
+            case AVAILABLE_SOURCES:
+                return tr("Available presets:");
+            case ACTIVE_SOURCES:
+                return tr("Active presets:");
+            case NEW_SOURCE_ENTRY_TOOLTIP:
+                return tr("Add a new preset by entering filename or URL");
+            case NEW_SOURCE_ENTRY:
+                return tr("New preset entry:");
+            case REMOVE_SOURCE_TOOLTIP:
+                return tr("Remove the selected presets from the list of active presets");
+            case EDIT_SOURCE_TOOLTIP:
+                return tr("Edit the filename or URL for the selected active preset");
+            case ACTIVATE_TOOLTIP:
+                return tr("Add the selected available presets to the list of active presets");
+            case RELOAD_ALL_AVAILABLE:
+                return marktr("Reloads the list of available presets from ''{0}''");
+            case LOADING_SOURCES_FROM:
+                return marktr("Loading preset sources from ''{0}''");
+            case FAILED_TO_LOAD_SOURCES_FROM:
+                return marktr("<html>Failed to load the list of preset sources from<br>"
+                        + "''{0}''.<br>"
+                        + "<br>"
+                        + "Details (untranslated):<br>{1}</html>");
+            case FAILED_TO_LOAD_SOURCES_FROM_HELP_TOPIC:
+                return "/Preferences/Presets#FailedToLoadPresetSources";
+            case ILLEGAL_FORMAT_OF_ENTRY:
+                return marktr("Warning: illegal format of entry in preset list ''{0}''. Got ''{1}''");
+            default: throw new AssertionError();
             }
         }
@@ -304,6 +303,6 @@
         public PresetPrefMigration() {
             super("taggingpreset.sources",
-                  "taggingpreset.enable-defaults",
-                  "taggingpreset.sources-list");
+                    "taggingpreset.enable-defaults",
+                    "taggingpreset.sources-list");
         }
 
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java	(revision 4874)
@@ -13,12 +13,13 @@
 import java.awt.event.MouseEvent;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-import java.util.Collection;
-import java.util.Collections;
 
 import javax.swing.Box;
 import javax.swing.ButtonGroup;
+import javax.swing.DefaultCellEditor;
 import javax.swing.JButton;
 import javax.swing.JLabel;
@@ -33,11 +34,6 @@
 import javax.swing.table.DefaultTableCellRenderer;
 import javax.swing.table.DefaultTableModel;
-import javax.swing.DefaultCellEditor;
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.ExtendedDialog;
-import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
-import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
-import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.data.Preferences.ListListSetting;
@@ -46,4 +42,8 @@
 import org.openstreetmap.josm.data.Preferences.Setting;
 import org.openstreetmap.josm.data.Preferences.StringSetting;
+import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
+import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
+import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.GBC;
@@ -244,5 +244,5 @@
     }
 
-    private class SettingCellRenderer extends DefaultTableCellRenderer {
+    private static class SettingCellRenderer extends DefaultTableCellRenderer {
         @Override
         public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
@@ -264,9 +264,10 @@
     }
 
-    private class SettingCellEditor extends DefaultCellEditor {
+    private static class SettingCellEditor extends DefaultCellEditor {
         public SettingCellEditor() {
             super(new JTextField());
         }
 
+        @Override
         public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
             PrefEntry pe = (PrefEntry) value;
@@ -322,5 +323,5 @@
                     tr("Warning"),
                     JOptionPane.WARNING_MESSAGE
-            );
+                    );
             return;
         }
@@ -430,5 +431,5 @@
                     tr("Warning"),
                     JOptionPane.WARNING_MESSAGE
-            );
+                    );
             return;
         }
Index: /trunk/src/org/openstreetmap/josm/io/GpxImporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/GpxImporter.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/io/GpxImporter.java	(revision 4874)
@@ -6,5 +6,4 @@
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
@@ -12,5 +11,4 @@
 
 import javax.swing.JOptionPane;
-import javax.swing.SwingUtilities;
 
 import org.openstreetmap.josm.Main;
@@ -24,5 +22,5 @@
 public class GpxImporter extends FileImporter {
 
-    protected class GpxImporterData {
+    protected static class GpxImporterData {
         public GpxLayer gpxLayer;
         public MarkerLayer markerLayer;
@@ -59,5 +57,5 @@
 
     public GpxImporterData loadLayers(InputStream is, final File associatedFile,
-                    final String gpxLayerName, String markerLayerName, ProgressMonitor progressMonitor) throws IOException {
+            final String gpxLayerName, String markerLayerName, ProgressMonitor progressMonitor) throws IOException {
         final GpxImporterData data = new GpxImporterData();
         try {
Index: /trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java	(revision 4874)
@@ -30,5 +30,5 @@
     private String source;
 
-    private enum State { 
+    private enum State {
         INIT,               // initial state, should always be at the bottom of the stack
         IMAGERY,            // inside the imagery element
@@ -63,5 +63,5 @@
     }
 
-    private class Parser extends DefaultHandler {
+    private static class Parser extends DefaultHandler {
         private StringBuffer accumulator = new StringBuffer();
 
@@ -97,18 +97,18 @@
             State newState = null;
             switch (states.peek()) {
-                case INIT:
-                    if (qName.equals("imagery")) {
-                        newState = State.IMAGERY;
-                    }
-                    break;
-                case IMAGERY:
-                    if (qName.equals("entry")) {
-                        entry = new ImageryInfo();
-                        skipEntry = false;
-                        newState = State.ENTRY;
-                    }
-                    break;
-                case ENTRY:
-                    if (Arrays.asList(new String[] {
+            case INIT:
+                if (qName.equals("imagery")) {
+                    newState = State.IMAGERY;
+                }
+                break;
+            case IMAGERY:
+                if (qName.equals("entry")) {
+                    entry = new ImageryInfo();
+                    skipEntry = false;
+                    newState = State.ENTRY;
+                }
+                break;
+            case ENTRY:
+                if (Arrays.asList(new String[] {
                         "name",
                         "type",
@@ -126,42 +126,42 @@
                         "country-code",
                         "icon",
-                    }).contains(qName)) {
-                        newState = State.ENTRY_ATTRIBUTE;
-                    } else if (qName.equals("bounds")) {
-                        try {
-                            bounds = new ImageryBounds(
-                                    atts.getValue("min-lat") + "," +
-                                    atts.getValue("min-lon") + "," +
-                                    atts.getValue("max-lat") + "," +
-                                    atts.getValue("max-lon"), ",");
-                        } catch (IllegalArgumentException e) {
-                            break;
-                        }
-                        newState = State.BOUNDS;
-                    } else if (qName.equals("projections")) {
-                        projections = new ArrayList<String>();
-                        newState = State.PROJECTIONS;
-                    }
-                    break;
-                case BOUNDS:
-                    if (qName.equals("shape")) {
-                        shape = new Shape();
-                        newState = State.SHAPE;
-                    }
-                    break;
-                case SHAPE:
-                    if (qName.equals("point")) {
-                        try {
-                            shape.addPoint(atts.getValue("lat"), atts.getValue("lon"));
-                        } catch (IllegalArgumentException e) {
-                            break;
-                        }
-                    }
-                    break;
-                case PROJECTIONS:
-                    if (qName.equals("code")) {
-                        newState = State.CODE;
-                    }
-                    break;
+                }).contains(qName)) {
+                    newState = State.ENTRY_ATTRIBUTE;
+                } else if (qName.equals("bounds")) {
+                    try {
+                        bounds = new ImageryBounds(
+                                atts.getValue("min-lat") + "," +
+                                        atts.getValue("min-lon") + "," +
+                                        atts.getValue("max-lat") + "," +
+                                        atts.getValue("max-lon"), ",");
+                    } catch (IllegalArgumentException e) {
+                        break;
+                    }
+                    newState = State.BOUNDS;
+                } else if (qName.equals("projections")) {
+                    projections = new ArrayList<String>();
+                    newState = State.PROJECTIONS;
+                }
+                break;
+            case BOUNDS:
+                if (qName.equals("shape")) {
+                    shape = new Shape();
+                    newState = State.SHAPE;
+                }
+                break;
+            case SHAPE:
+                if (qName.equals("point")) {
+                    try {
+                        shape.addPoint(atts.getValue("lat"), atts.getValue("lon"));
+                    } catch (IllegalArgumentException e) {
+                        break;
+                    }
+                }
+                break;
+            case PROJECTIONS:
+                if (qName.equals("code")) {
+                    newState = State.CODE;
+                }
+                break;
             }
             /**
@@ -189,91 +189,91 @@
         public void endElement(String namespaceURI, String qName, String rqName) {
             switch (states.pop()) {
-                case INIT:
-                    throw new RuntimeException("parsing error: more closing than opening elements");
-                case ENTRY:
-                    if (qName.equals("entry")) {
-                        if (!skipEntry) {
-                            entries.add(entry);
+            case INIT:
+                throw new RuntimeException("parsing error: more closing than opening elements");
+            case ENTRY:
+                if (qName.equals("entry")) {
+                    if (!skipEntry) {
+                        entries.add(entry);
+                    }
+                    entry = null;
+                }
+                break;
+            case ENTRY_ATTRIBUTE:
+                if (qName.equals("name")) {
+                    entry.setName(tr(accumulator.toString()));
+                } else if (qName.equals("type")) {
+                    boolean found = false;
+                    for (ImageryType type : ImageryType.values()) {
+                        if (equal(accumulator.toString(), type.getUrlString())) {
+                            entry.setImageryType(type);
+                            found = true;
+                            break;
                         }
-                        entry = null;
-                    }
-                    break;
-                case ENTRY_ATTRIBUTE:
-                    if (qName.equals("name")) {
-                        entry.setName(tr(accumulator.toString()));
-                    } else if (qName.equals("type")) {
-                        boolean found = false;
-                        for (ImageryType type : ImageryType.values()) {
-                            if (equal(accumulator.toString(), type.getUrlString())) {
-                                entry.setImageryType(type);
-                                found = true;
-                                break;
-                            }
+                    }
+                    if (!found) {
+                        skipEntry = true;
+                    }
+                } else if (qName.equals("default")) {
+                    if (accumulator.toString().equals("true")) {
+                        entry.setDefaultEntry(true);
+                    } else if (accumulator.toString().equals("false")) {
+                        entry.setDefaultEntry(false);
+                    } else {
+                        skipEntry = true;
+                    }
+                } else if (qName.equals("url")) {
+                    entry.setUrl(accumulator.toString());
+                } else if (qName.equals("eula")) {
+                    entry.setEulaAcceptanceRequired(accumulator.toString());
+                } else if (qName.equals("min-zoom") || qName.equals("max-zoom")) {
+                    Integer val = null;
+                    try {
+                        val = Integer.parseInt(accumulator.toString());
+                    } catch(NumberFormatException e) {
+                        val = null;
+                    }
+                    if (val == null) {
+                        skipEntry = true;
+                    } else {
+                        if (qName.equals("min-zoom")) {
+                            entry.setDefaultMinZoom(val);
+                        } else {
+                            entry.setDefaultMaxZoom(val);
                         }
-                        if (!found) {
-                            skipEntry = true;
-                        }
-                    } else if (qName.equals("default")) {
-                        if (accumulator.toString().equals("true")) {
-                            entry.setDefaultEntry(true);
-                        } else if (accumulator.toString().equals("false")) {
-                            entry.setDefaultEntry(false);
-                        } else {
-                            skipEntry = true;
-                        }
-                    } else if (qName.equals("url")) {
-                        entry.setUrl(accumulator.toString());
-                    } else if (qName.equals("eula")) {
-                        entry.setEulaAcceptanceRequired(accumulator.toString());
-                    } else if (qName.equals("min-zoom") || qName.equals("max-zoom")) {
-                        Integer val = null;
-                        try {
-                            val = Integer.parseInt(accumulator.toString());
-                        } catch(NumberFormatException e) {
-                            val = null;
-                        }
-                        if (val == null) {
-                            skipEntry = true;
-                        } else {
-                            if (qName.equals("min-zoom")) {
-                                entry.setDefaultMinZoom(val);
-                            } else {
-                                entry.setDefaultMaxZoom(val);
-                            }
-                        }
-                    } else if (qName.equals("attribution-text")) {
-                        entry.setAttributionText(accumulator.toString());
-                    } else if (qName.equals("attribution-url")) {
-                        entry.setAttributionLinkURL(accumulator.toString());
-                    } else if (qName.equals("logo-image")) {
-                        entry.setAttributionImage(accumulator.toString());
-                    } else if (qName.equals("logo-url")) {
-                        entry.setAttributionImageURL(accumulator.toString());
-                    } else if (qName.equals("terms-of-use-text")) {
-                        entry.setTermsOfUseText(accumulator.toString());
-                    } else if (qName.equals("terms-of-use-url")) {
-                        entry.setTermsOfUseURL(accumulator.toString());
-                    } else if (qName.equals("country-code")) {
-                        entry.setCountryCode(accumulator.toString());
-                    } else if (qName.equals("icon")) {
-                        entry.setIcon(accumulator.toString());
-                    } else {
-                    }
-                    break;
-                case BOUNDS:
-                    entry.setBounds(bounds);
-                    bounds = null;
-                    break;
-                case SHAPE:
-                    bounds.addShape(shape);
-                    shape = null;
-                    break;
-                case CODE:
-                    projections.add(accumulator.toString());
-                    break;
-                case PROJECTIONS:
-                    entry.setServerProjections(projections);
-                    projections = null;
-                    break;
+                    }
+                } else if (qName.equals("attribution-text")) {
+                    entry.setAttributionText(accumulator.toString());
+                } else if (qName.equals("attribution-url")) {
+                    entry.setAttributionLinkURL(accumulator.toString());
+                } else if (qName.equals("logo-image")) {
+                    entry.setAttributionImage(accumulator.toString());
+                } else if (qName.equals("logo-url")) {
+                    entry.setAttributionImageURL(accumulator.toString());
+                } else if (qName.equals("terms-of-use-text")) {
+                    entry.setTermsOfUseText(accumulator.toString());
+                } else if (qName.equals("terms-of-use-url")) {
+                    entry.setTermsOfUseURL(accumulator.toString());
+                } else if (qName.equals("country-code")) {
+                    entry.setCountryCode(accumulator.toString());
+                } else if (qName.equals("icon")) {
+                    entry.setIcon(accumulator.toString());
+                } else {
+                }
+                break;
+            case BOUNDS:
+                entry.setBounds(bounds);
+                bounds = null;
+                break;
+            case SHAPE:
+                bounds.addShape(shape);
+                shape = null;
+                break;
+            case CODE:
+                projections.add(accumulator.toString());
+                break;
+            case PROJECTIONS:
+                entry.setServerProjections(projections);
+                projections = null;
+                break;
             }
         }
Index: /trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/session/SessionReader.java	(revision 4873)
+++ /trunk/src/org/openstreetmap/josm/io/session/SessionReader.java	(revision 4874)
@@ -407,5 +407,5 @@
      * needed to block the current thread and wait for the result of the modal dialog from EDT.
      */
-    private class CancelOrContinueDialog {
+    private static class CancelOrContinueDialog {
 
         private boolean cancel;
