Index: trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 10611)
@@ -256,5 +256,5 @@
      * @see #FLAG_HAS_DIRECTIONS
      */
-    public static final Predicate<Tag> directionalKeyPredicate = tag -> directionKeys.match(tag);
+    public static final Predicate<Tag> directionalKeyPredicate = directionKeys::match;
 
     /**
Index: trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java	(revision 10611)
@@ -194,10 +194,5 @@
     }
 
-    private final Comparator<Node> nodeComparator = new Comparator<Node>() {
-        @Override
-        public int compare(Node n1, Node n2) {
-            return format(n1).compareTo(format(n2));
-        }
-    };
+    private final Comparator<Node> nodeComparator = (n1, n2) -> format(n1).compareTo(format(n2));
 
     @Override
@@ -289,10 +284,5 @@
     }
 
-    private final Comparator<Way> wayComparator = new Comparator<Way>() {
-        @Override
-        public int compare(Way w1, Way w2) {
-            return format(w1).compareTo(format(w2));
-        }
-    };
+    private final Comparator<Way> wayComparator = (w1, w2) -> format(w1).compareTo(format(w2));
 
     @Override
@@ -349,47 +339,44 @@
     }
 
-    private final Comparator<Relation> relationComparator = new Comparator<Relation>() {
-        @Override
-        public int compare(Relation r1, Relation r2) {
-            //TODO This doesn't work correctly with formatHooks
-
-            TaggingPreset preset1 = TaggingPresetNameTemplateList.getInstance().findPresetTemplate(r1);
-            TaggingPreset preset2 = TaggingPresetNameTemplateList.getInstance().findPresetTemplate(r2);
-
-            if (preset1 != null || preset2 != null) {
-                String name1 = formatRelationNameAndType(r1, new StringBuilder(), preset1).toString();
-                String name2 = formatRelationNameAndType(r2, new StringBuilder(), preset2).toString();
-
-                int comp = AlphanumComparator.getInstance().compare(name1, name2);
-                if (comp != 0)
-                    return comp;
-            } else {
-
-                String type1 = getRelationTypeName(r1);
-                String type2 = getRelationTypeName(r2);
-
-                int comp = AlphanumComparator.getInstance().compare(type1, type2);
-                if (comp != 0)
-                    return comp;
-
-                String name1 = getRelationName(r1);
-                String name2 = getRelationName(r2);
-
-                comp = AlphanumComparator.getInstance().compare(name1, name2);
-                if (comp != 0)
-                    return comp;
-            }
-
-            int comp = Integer.compare(r1.getMembersCount(), r2.getMembersCount());
-            if (comp != 0)
-                return comp;
-
-
-            comp = Boolean.compare(r1.hasIncompleteMembers(), r2.hasIncompleteMembers());
-            if (comp != 0)
-                return comp;
-
-            return Long.compare(r1.getUniqueId(), r2.getUniqueId());
-        }
+    private final Comparator<Relation> relationComparator = (r1, r2) -> {
+        //TODO This doesn't work correctly with formatHooks
+
+        TaggingPreset preset1 = TaggingPresetNameTemplateList.getInstance().findPresetTemplate(r1);
+        TaggingPreset preset2 = TaggingPresetNameTemplateList.getInstance().findPresetTemplate(r2);
+
+        if (preset1 != null || preset2 != null) {
+            String name11 = formatRelationNameAndType(r1, new StringBuilder(), preset1).toString();
+            String name21 = formatRelationNameAndType(r2, new StringBuilder(), preset2).toString();
+
+            int comp1 = AlphanumComparator.getInstance().compare(name11, name21);
+            if (comp1 != 0)
+                return comp1;
+        } else {
+
+            String type1 = getRelationTypeName(r1);
+            String type2 = getRelationTypeName(r2);
+
+            int comp2 = AlphanumComparator.getInstance().compare(type1, type2);
+            if (comp2 != 0)
+                return comp2;
+
+            String name12 = getRelationName(r1);
+            String name22 = getRelationName(r2);
+
+            comp2 = AlphanumComparator.getInstance().compare(name12, name22);
+            if (comp2 != 0)
+                return comp2;
+        }
+
+        int comp3 = Integer.compare(r1.getMembersCount(), r2.getMembersCount());
+        if (comp3 != 0)
+            return comp3;
+
+
+        comp3 = Boolean.compare(r1.hasIncompleteMembers(), r2.hasIncompleteMembers());
+        if (comp3 != 0)
+            return comp3;
+
+        return Long.compare(r1.getUniqueId(), r2.getUniqueId());
     };
 
@@ -644,11 +631,6 @@
      */
     public String formatAsHtmlUnorderedList(Collection<? extends OsmPrimitive> primitives, int maxElements) {
-        final Collection<String> displayNames = Utils.transform(primitives, new Function<OsmPrimitive, String>() {
-
-            @Override
-            public String apply(OsmPrimitive x) {
-                return x.getDisplayName(DefaultNameFormatter.this);
-            }
-        });
+        final Collection<String> displayNames = Utils.transform(primitives,
+                (Function<OsmPrimitive, String>) x -> x.getDisplayName(DefaultNameFormatter.this));
         return Utils.joinAsHtmlUnorderedList(Utils.limit(displayNames, maxElements, "..."));
     }
Index: trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 10611)
@@ -576,10 +576,5 @@
     private void requestFocusToDefaultButton() {
         if (defaultButton != null) {
-            GuiHelper.runInEDT(new Runnable() {
-                @Override
-                public void run() {
-                    defaultButton.requestFocusInWindow();
-                }
-            });
+            GuiHelper.runInEDT(() -> defaultButton.requestFocusInWindow());
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/FileDrop.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/FileDrop.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/FileDrop.java	(revision 10611)
@@ -16,6 +16,4 @@
 import java.awt.dnd.DropTargetListener;
 import java.awt.dnd.InvalidDnDOperationException;
-import java.awt.event.HierarchyEvent;
-import java.awt.event.HierarchyListener;
 import java.io.BufferedReader;
 import java.io.File;
@@ -97,12 +95,9 @@
                 BorderFactory.createMatteBorder(2, 2, 2, 2, defaultBorderColor), // Drag border
                 true, // Recursive
-                new FileDrop.Listener() {
-                    @Override
-                    public void filesDropped(File[] files) {
-                        // start asynchronous loading of files
-                        OpenFileAction.OpenFileTask task = new OpenFileAction.OpenFileTask(Arrays.asList(files), null);
-                        task.setRecordHistory(true);
-                        Main.worker.submit(task);
-                    }
+                files -> {
+                    // start asynchronous loading of files
+                    OpenFileAction.OpenFileTask task = new OpenFileAction.OpenFileTask(Arrays.asList(files), null);
+                    task.setRecordHistory(true);
+                    Main.worker.submit(task);
                 }
         );
@@ -173,16 +168,13 @@
 
         // Listen for hierarchy changes and remove the drop target when the parent gets cleared out.
-        c.addHierarchyListener(new HierarchyListener() {
-            @Override
-            public void hierarchyChanged(HierarchyEvent evt) {
-                Main.trace("FileDrop: Hierarchy changed.");
-                Component parent = c.getParent();
-                if (parent == null) {
-                    c.setDropTarget(null);
-                    Main.trace("FileDrop: Drop target cleared from component.");
-                } else {
-                    new DropTarget(c, dropListener);
-                    Main.trace("FileDrop: Drop target added to component.");
-                }
+        c.addHierarchyListener(evt -> {
+            Main.trace("FileDrop: Hierarchy changed.");
+            Component parent = c.getParent();
+            if (parent == null) {
+                c.setDropTarget(null);
+                Main.trace("FileDrop: Drop target cleared from component.");
+            } else {
+                new DropTarget(c, dropListener);
+                Main.trace("FileDrop: Drop target added to component.");
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/GettingStarted.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/GettingStarted.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/GettingStarted.java	(revision 10611)
@@ -139,29 +139,21 @@
     private void getMOTD() {
         // Asynchronously get MOTD to speed-up JOSM startup
-        Thread t = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                if (!contentInitialized && Main.pref.getBoolean("help.displaymotd", true)) {
-                    try {
-                        content = new MotdContent().updateIfRequiredString();
-                        contentInitialized = true;
-                        ProxyPreference.removeProxyPreferenceListener(GettingStarted.this);
-                    } catch (IOException ex) {
-                        Main.warn(tr("Failed to read MOTD. Exception was: {0}", ex.toString()));
-                        content = "<html>" + STYLE + "<h1>" + "JOSM - " + tr("Java OpenStreetMap Editor")
-                                + "</h1>\n<h2 align=\"center\">(" + tr("Message of the day not available") + ")</h2></html>";
-                        // In case of MOTD not loaded because of proxy error, listen to preference changes to retry after update
-                        ProxyPreference.addProxyPreferenceListener(GettingStarted.this);
-                    }
+        Thread t = new Thread((Runnable) () -> {
+            if (!contentInitialized && Main.pref.getBoolean("help.displaymotd", true)) {
+                try {
+                    content = new MotdContent().updateIfRequiredString();
+                    contentInitialized = true;
+                    ProxyPreference.removeProxyPreferenceListener(GettingStarted.this);
+                } catch (IOException ex) {
+                    Main.warn(tr("Failed to read MOTD. Exception was: {0}", ex.toString()));
+                    content = "<html>" + STYLE + "<h1>" + "JOSM - " + tr("Java OpenStreetMap Editor")
+                            + "</h1>\n<h2 align=\"center\">(" + tr("Message of the day not available") + ")</h2></html>";
+                    // In case of MOTD not loaded because of proxy error, listen to preference changes to retry after update
+                    ProxyPreference.addProxyPreferenceListener(GettingStarted.this);
                 }
+            }
 
-                if (content != null) {
-                    EventQueue.invokeLater(new Runnable() {
-                        @Override
-                        public void run() {
-                            lg.setText(fixImageLinks(content));
-                        }
-                    });
-                }
+            if (content != null) {
+                EventQueue.invokeLater(() -> lg.setText(fixImageLinks(content)));
             }
         }, "MOTD-Loader");
Index: trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java	(revision 10611)
@@ -152,9 +152,5 @@
                 b.setFocusable(true);
                 b.setEnabled(spec.isEnabled());
-                spec.addChangeListener(new ChangeListener() {
-                    @Override public void stateChanged(ChangeEvent e) {
-                        b.setEnabled(spec.isEnabled());
-                    }
-                });
+                spec.addChangeListener(e -> b.setEnabled(spec.isEnabled()));
                 buttons.add(b);
             }
@@ -353,10 +349,5 @@
     public static void showMessageDialogInEDT(final Component parentComponent, final Object msg, final String title,
             final int messageType, final String helpTopic) {
-        GuiHelper.runInEDT(new Runnable() {
-            @Override
-            public void run() {
-                showOptionDialog(parentComponent, msg, title, messageType, null, null, null, helpTopic);
-            }
-        });
+        GuiHelper.runInEDT(() -> showOptionDialog(parentComponent, msg, title, messageType, null, null, null, helpTopic));
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java	(revision 10611)
@@ -54,10 +54,6 @@
      * (for the preferences). We don't want this in the imagery menu.
      */
-    public static final Comparator<ImageryInfo> alphabeticImageryComparator = new Comparator<ImageryInfo>() {
-        @Override
-        public int compare(ImageryInfo ii1, ImageryInfo ii2) {
-            return ii1.getName().toLowerCase(Locale.ENGLISH).compareTo(ii2.getName().toLowerCase(Locale.ENGLISH));
-        }
-    };
+    public static final Comparator<ImageryInfo> alphabeticImageryComparator =
+            (ii1, ii2) -> ii1.getName().toLowerCase(Locale.ENGLISH).compareTo(ii2.getName().toLowerCase(Locale.ENGLISH));
 
     private final transient Action offsetAction = new JosmAction(
Index: trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 10611)
@@ -34,5 +34,4 @@
 import java.util.Set;
 import java.util.TreeSet;
-import java.util.concurrent.Callable;
 
 import javax.swing.JOptionPane;
@@ -426,18 +425,8 @@
         OAuthAccessTokenHolder.getInstance().init(Main.pref, CredentialsManager.getInstance());
 
-        final SplashScreen splash = GuiHelper.runInEDTAndWaitAndReturn(new Callable<SplashScreen>() {
-            @Override
-            public SplashScreen call() {
-                return new SplashScreen();
-            }
-        });
+        final SplashScreen splash = GuiHelper.runInEDTAndWaitAndReturn(SplashScreen::new);
         final SplashScreen.SplashProgressMonitor monitor = splash.getProgressMonitor();
         monitor.beginTask(tr("Initializing"));
-        GuiHelper.runInEDT(new Runnable() {
-            @Override
-            public void run() {
-                splash.setVisible(Main.pref.getBoolean("draw.splashscreen", true));
-            }
-        });
+        GuiHelper.runInEDT(() -> splash.setVisible(Main.pref.getBoolean("draw.splashscreen", true)));
         Main.setInitStatusListener(new InitStatusListener() {
 
@@ -474,11 +463,8 @@
 
         // Wait for splash disappearance (fix #9714)
-        GuiHelper.runInEDTAndWait(new Runnable() {
-            @Override
-            public void run() {
-                splash.setVisible(false);
-                splash.dispose();
-                mainFrame.setVisible(true);
-            }
+        GuiHelper.runInEDTAndWait(() -> {
+            splash.setVisible(false);
+            splash.dispose();
+            mainFrame.setVisible(true);
         });
 
@@ -571,45 +557,42 @@
     private static void checkIPv6() {
         if ("auto".equals(Main.pref.get("prefer.ipv6", "auto"))) {
-             new Thread(new Runnable() { /* this may take some time (DNS, Connect) */
-                @Override
-                public void run() {
-                    boolean hasv6 = false;
-                    boolean wasv6 = Main.pref.getBoolean("validated.ipv6", false);
-                    try {
-                        /* Use the check result from last run of the software, as after the test, value
-                           changes have no effect anymore */
-                        if (wasv6) {
-                            Utils.updateSystemProperty("java.net.preferIPv6Addresses", "true");
-                        }
-                        for (InetAddress a : InetAddress.getAllByName("josm.openstreetmap.de")) {
-                            if (a instanceof Inet6Address) {
-                                if (a.isReachable(1000)) {
-                                    /* be sure it REALLY works */
-                                    Socket s = new Socket();
-                                    s.connect(new InetSocketAddress(a, 80), 1000);
-                                    s.close();
-                                    Utils.updateSystemProperty("java.net.preferIPv6Addresses", "true");
-                                    if (!wasv6) {
-                                        Main.info(tr("Detected useable IPv6 network, prefering IPv6 over IPv4 after next restart."));
-                                    } else {
-                                        Main.info(tr("Detected useable IPv6 network, prefering IPv6 over IPv4."));
-                                    }
-                                    hasv6 = true;
+            new Thread((Runnable) () -> { /* this may take some time (DNS, Connect) */
+                boolean hasv6 = false;
+                boolean wasv6 = Main.pref.getBoolean("validated.ipv6", false);
+                try {
+                    /* Use the check result from last run of the software, as after the test, value
+                       changes have no effect anymore */
+                    if (wasv6) {
+                        Utils.updateSystemProperty("java.net.preferIPv6Addresses", "true");
+                    }
+                    for (InetAddress a : InetAddress.getAllByName("josm.openstreetmap.de")) {
+                        if (a instanceof Inet6Address) {
+                            if (a.isReachable(1000)) {
+                                /* be sure it REALLY works */
+                                Socket s = new Socket();
+                                s.connect(new InetSocketAddress(a, 80), 1000);
+                                s.close();
+                                Utils.updateSystemProperty("java.net.preferIPv6Addresses", "true");
+                                if (!wasv6) {
+                                    Main.info(tr("Detected useable IPv6 network, prefering IPv6 over IPv4 after next restart."));
+                                } else {
+                                    Main.info(tr("Detected useable IPv6 network, prefering IPv6 over IPv4."));
                                 }
-                                break; /* we're done */
+                                hasv6 = true;
                             }
-                        }
-                    } catch (IOException | SecurityException e) {
-                        if (Main.isDebugEnabled()) {
-                            Main.debug("Exception while checking IPv6 connectivity: "+e);
+                            break; /* we're done */
                         }
                     }
-                    if (wasv6 && !hasv6) {
-                        Main.info(tr("Detected no useable IPv6 network, prefering IPv4 over IPv6 after next restart."));
-                        Main.pref.put("validated.ipv6", hasv6); // be sure it is stored before the restart!
-                        new RestartAction().actionPerformed(null);
+                } catch (IOException | SecurityException e) {
+                    if (Main.isDebugEnabled()) {
+                        Main.debug("Exception while checking IPv6 connectivity: "+e);
                     }
-                    Main.pref.put("validated.ipv6", hasv6);
-                }
+                }
+                if (wasv6 && !hasv6) {
+                    Main.info(tr("Detected no useable IPv6 network, prefering IPv4 over IPv6 after next restart."));
+                    Main.pref.put("validated.ipv6", hasv6); // be sure it is stored before the restart!
+                    new RestartAction().actionPerformed(null);
+                }
+                Main.pref.put("validated.ipv6", hasv6);
             }, "IPv6-checker").start();
         }
Index: trunk/src/org/openstreetmap/josm/gui/MainFrame.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainFrame.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/MainFrame.java	(revision 10611)
@@ -14,5 +14,4 @@
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
-import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.util.LinkedList;
@@ -27,6 +26,4 @@
 import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent;
 import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
-import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
-import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer.LayerStateChangeListener;
@@ -40,19 +37,11 @@
  */
 public class MainFrame extends JFrame {
-    private final transient LayerStateChangeListener updateTitleOnLayerStateChange = new LayerStateChangeListener() {
-        @Override
-        public void uploadDiscouragedChanged(OsmDataLayer layer, boolean newValue) {
+    private final transient LayerStateChangeListener updateTitleOnLayerStateChange = (layer, newValue) -> onLayerChange(layer);
+
+    private final transient PropertyChangeListener updateTitleOnSaveChange = evt -> {
+        if (evt.getPropertyName().equals(OsmDataLayer.REQUIRES_SAVE_TO_DISK_PROP)
+                || evt.getPropertyName().equals(OsmDataLayer.REQUIRES_UPLOAD_TO_SERVER_PROP)) {
+            OsmDataLayer layer = (OsmDataLayer) evt.getSource();
             onLayerChange(layer);
-        }
-    };
-
-    private final transient PropertyChangeListener updateTitleOnSaveChange = new PropertyChangeListener() {
-        @Override
-        public void propertyChange(PropertyChangeEvent evt) {
-            if (evt.getPropertyName().equals(OsmDataLayer.REQUIRES_SAVE_TO_DISK_PROP)
-                    || evt.getPropertyName().equals(OsmDataLayer.REQUIRES_UPLOAD_TO_SERVER_PROP)) {
-                OsmDataLayer layer = (OsmDataLayer) evt.getSource();
-                onLayerChange(layer);
-            }
         }
     };
@@ -102,5 +91,5 @@
         addWindowListener(new WindowAdapter() {
             @Override
-            public void windowClosing(final WindowEvent arg0) {
+            public void windowClosing(final WindowEvent evt) {
                 Main.exitJosm(true, 0);
             }
@@ -109,10 +98,5 @@
 
         // This listener is never removed, since the main frame exists forever.
-        Main.getLayerManager().addActiveLayerChangeListener(new ActiveLayerChangeListener() {
-            @Override
-            public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
-                refreshTitle();
-            }
-        });
+        Main.getLayerManager().addActiveLayerChangeListener(e -> refreshTitle());
         Main.getLayerManager().addLayerChangeListener(new ManageLayerListeners(), true);
 
Index: trunk/src/org/openstreetmap/josm/gui/MainMenu.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainMenu.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/MainMenu.java	(revision 10611)
@@ -113,6 +113,4 @@
 import org.openstreetmap.josm.actions.audio.AudioSlowerAction;
 import org.openstreetmap.josm.actions.search.SearchAction;
-import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
-import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
 import org.openstreetmap.josm.gui.dialogs.MenuItemSearchDialog;
 import org.openstreetmap.josm.gui.io.RecentlyOpenedFilesMenu;
@@ -803,10 +801,7 @@
         }
 
-        Main.pref.addPreferenceChangeListener(new PreferenceChangedListener() {
-            @Override
-            public void preferenceChanged(PreferenceChangeEvent e) {
-                if ("audio.menuinvisible".equals(e.getKey())) {
-                    showAudioMenu(!Boolean.parseBoolean(e.getNewValue().toString()));
-                }
+        Main.pref.addPreferenceChangeListener(e -> {
+            if ("audio.menuinvisible".equals(e.getKey())) {
+                showAudioMenu(!Boolean.parseBoolean(e.getNewValue().toString()));
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/MainPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/MainPanel.java	(revision 10611)
@@ -163,10 +163,5 @@
             }
         });
-        GuiHelper.runInEDTAndWait(new Runnable() {
-            @Override
-            public void run() {
-                updateContent(!layerManager.getLayers().isEmpty());
-            }
-        });
+        GuiHelper.runInEDTAndWait(() -> updateContent(!layerManager.getLayers().isEmpty()));
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 10611)
@@ -13,6 +13,4 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
-import java.awt.event.MouseWheelEvent;
-import java.awt.event.MouseWheelListener;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -53,6 +51,4 @@
 import org.openstreetmap.josm.actions.mapmode.SelectAction;
 import org.openstreetmap.josm.actions.mapmode.ZoomAction;
-import org.openstreetmap.josm.data.Preferences;
-import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
 import org.openstreetmap.josm.data.ViewportData;
@@ -497,19 +493,11 @@
         if (Main.pref.getBoolean("sidetoolbar.scrollable", true)) {
             final ScrollViewport svp = new ScrollViewport(sideToolBar, ScrollViewport.VERTICAL_DIRECTION);
-            svp.addMouseWheelListener(new MouseWheelListener() {
-                @Override
-                public void mouseWheelMoved(MouseWheelEvent e) {
-                    svp.scroll(0, e.getUnitsToScroll() * 5);
-                }
-            });
+            svp.addMouseWheelListener(e -> svp.scroll(0, e.getUnitsToScroll() * 5));
             sideToolBar = svp;
         }
         sideToolBar.setVisible(Main.pref.getBoolean("sidetoolbar.visible", true));
-        sidetoolbarPreferencesChangedListener = new Preferences.PreferenceChangedListener() {
-            @Override
-            public void preferenceChanged(PreferenceChangeEvent e) {
-                if ("sidetoolbar.visible".equals(e.getKey())) {
-                    sideToolBar.setVisible(Main.pref.getBoolean("sidetoolbar.visible"));
-                }
+        sidetoolbarPreferencesChangedListener = e -> {
+            if ("sidetoolbar.visible".equals(e.getKey())) {
+                sideToolBar.setVisible(Main.pref.getBoolean("sidetoolbar.visible"));
             }
         };
Index: trunk/src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 10611)
@@ -78,5 +78,4 @@
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
-import org.openstreetmap.josm.tools.Predicate;
 
 /**
@@ -294,10 +293,6 @@
                     // display them if the middle mouse button is pressed and keep them until the mouse is moved
                     if (middleMouseDown || isAtOldPosition) {
-                        Collection<OsmPrimitive> osms = mv.getAllNearest(ms.mousePos, new Predicate<OsmPrimitive>() {
-                            @Override
-                            public boolean evaluate(OsmPrimitive o) {
-                                return isUsablePredicate.evaluate(o) && isSelectablePredicate.evaluate(o);
-                            }
-                        });
+                        Collection<OsmPrimitive> osms = mv.getAllNearest(ms.mousePos,
+                                o -> isUsablePredicate.evaluate(o) && isSelectablePredicate.evaluate(o));
 
                         final JPanel c = new JPanel(new GridBagLayout());
@@ -505,10 +500,5 @@
             final Popup staticPopup = popup;
             popup = null;
-            EventQueue.invokeLater(new Runnable() {
-               @Override
-               public void run() {
-                    staticPopup.hide();
-                }
-            });
+            EventQueue.invokeLater(() -> staticPopup.hide());
         }
 
@@ -524,19 +514,11 @@
                 // If an old popup exists, remove it when the new popup has been drawn to keep flickering to a minimum
                 final Popup staticOldPopup = this.popup;
-                EventQueue.invokeLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        staticPopup.show();
-                        staticOldPopup.hide();
-                    }
+                EventQueue.invokeLater(() -> {
+                    staticPopup.show();
+                    staticOldPopup.hide();
                 });
             } else {
                 // There is no old popup
-                EventQueue.invokeLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        staticPopup.show();
-                    }
-                });
+                EventQueue.invokeLater(() -> staticPopup.show());
             }
             this.popupLabels = lbls;
@@ -1010,10 +992,7 @@
         statusText.add(entry);
 
-        GuiHelper.runInEDT(new Runnable() {
-            @Override
-            public void run() {
-                helpText.setText(text);
-                helpText.setToolTipText(text);
-            }
+        GuiHelper.runInEDT(() -> {
+            helpText.setText(text);
+            helpText.setToolTipText(text);
         });
     }
Index: trunk/src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 10611)
@@ -48,5 +48,4 @@
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.osm.DataSet;
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;
 import org.openstreetmap.josm.data.osm.visitor.paint.Rendering;
@@ -1267,10 +1266,5 @@
     }
 
-    private final transient SelectionChangedListener repaintSelectionChangedListener = new SelectionChangedListener() {
-        @Override
-        public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
-            repaint();
-        }
-    };
+    private final transient SelectionChangedListener repaintSelectionChangedListener = newSelection -> repaint();
 
     /**
Index: trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 10611)
@@ -51,5 +51,4 @@
 import org.openstreetmap.josm.data.preferences.IntegerProperty;
 import org.openstreetmap.josm.data.projection.Projection;
-import org.openstreetmap.josm.data.projection.ProjectionChangeListener;
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.gui.help.Helpful;
@@ -84,15 +83,12 @@
     }
 
-    public transient Predicate<OsmPrimitive> isSelectablePredicate = new Predicate<OsmPrimitive>() {
-        @Override
-        public boolean evaluate(OsmPrimitive prim) {
-            if (!prim.isSelectable()) return false;
-            // if it isn't displayed on screen, you cannot click on it
-            MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().lock();
-            try {
-                return !MapPaintStyles.getStyles().get(prim, getDist100Pixel(), NavigatableComponent.this).isEmpty();
-            } finally {
-                MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().unlock();
-            }
+    public transient Predicate<OsmPrimitive> isSelectablePredicate = prim -> {
+        if (!prim.isSelectable()) return false;
+        // if it isn't displayed on screen, you cannot click on it
+        MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().lock();
+        try {
+            return !MapPaintStyles.getStyles().get(prim, getDist100Pixel(), NavigatableComponent.this).isEmpty();
+        } finally {
+            MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().unlock();
         }
     };
@@ -143,11 +139,8 @@
     // The only events that may move/resize this map view are window movements or changes to the map view size.
     // We can clean this up more by only recalculating the state on repaint.
-    private final transient HierarchyListener hierarchyListener = new HierarchyListener() {
-        @Override
-        public void hierarchyChanged(HierarchyEvent e) {
-            long interestingFlags = HierarchyEvent.ANCESTOR_MOVED | HierarchyEvent.SHOWING_CHANGED;
-            if ((e.getChangeFlags() & interestingFlags) != 0) {
-                updateLocationState();
-            }
+    private final transient HierarchyListener hierarchyListener = e -> {
+        long interestingFlags = HierarchyEvent.ANCESTOR_MOVED | HierarchyEvent.SHOWING_CHANGED;
+        if ((e.getChangeFlags() & interestingFlags) != 0) {
+            updateLocationState();
         }
     };
@@ -181,10 +174,5 @@
         state = MapViewState.createDefaultState(getWidth(), getHeight());
         // uses weak link.
-        Main.addProjectionChangeListener(new ProjectionChangeListener() {
-            @Override
-            public void projectionChanged(Projection oldValue, Projection newValue) {
-                fixProjection();
-            }
-        });
+        Main.addProjectionChangeListener((oldValue, newValue) -> fixProjection());
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/NotificationManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/NotificationManager.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/NotificationManager.java	(revision 10611)
@@ -218,10 +218,5 @@
                     @Override
                     public void actionPerformed(ActionEvent e) {
-                        SwingUtilities.invokeLater(new Runnable() {
-                            @Override
-                            public void run() {
-                                HelpBrowser.setUrlForHelpTopic(note.getHelpTopic());
-                            }
-                        });
+                        SwingUtilities.invokeLater(() -> HelpBrowser.setUrlForHelpTopic(note.getHelpTopic()));
                     }
                 });
Index: trunk/src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java	(revision 10611)
@@ -96,10 +96,5 @@
                         finish();
                     } else {
-                        EventQueue.invokeAndWait(new Runnable() {
-                            @Override
-                            public void run() {
-                                finish();
-                            }
-                        });
+                        EventQueue.invokeAndWait(this::finish);
                     }
                 }
@@ -114,10 +109,5 @@
                     afterFinish();
                 } else {
-                    EventQueue.invokeAndWait(new Runnable() {
-                        @Override
-                        public void run() {
-                            afterFinish();
-                        }
-                    });
+                    EventQueue.invokeAndWait(this::afterFinish);
                 }
             }
@@ -126,12 +116,9 @@
             if (!ignoreException) {
                 // Exception has to thrown in EDT to be shown to user
-                SwingUtilities.invokeLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        if (e instanceof RuntimeException) {
-                            BugReportExceptionHandler.handleException(e);
-                        } else {
-                            ExceptionDialogUtil.explainException(e);
-                        }
+                SwingUtilities.invokeLater(() -> {
+                    if (e instanceof RuntimeException) {
+                        BugReportExceptionHandler.handleException(e);
+                    } else {
+                        ExceptionDialogUtil.explainException(e);
                     }
                 });
@@ -150,10 +137,5 @@
     public final void run() {
         if (EventQueue.isDispatchThread()) {
-            new Thread(new Runnable() {
-                @Override
-                public void run() {
-                    doRealRun();
-                }
-            }, getClass().getName()).start();
+            new Thread((Runnable) this::doRealRun, getClass().getName()).start();
         } else {
             doRealRun();
Index: trunk/src/org/openstreetmap/josm/gui/ScrollViewport.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/ScrollViewport.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/ScrollViewport.java	(revision 10611)
@@ -6,6 +6,4 @@
 import java.awt.Point;
 import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.ComponentAdapter;
 import java.awt.event.ComponentEvent;
@@ -70,10 +68,5 @@
     private final List<JButton> buttons = new ArrayList<>();
 
-    private final Timer timer = new Timer(100, new ActionListener() {
-        @Override
-        public void actionPerformed(ActionEvent arg0) {
-            ScrollViewport.this.scroll();
-        }
-    });
+    private final Timer timer = new Timer(100, evt -> ScrollViewport.this.scroll());
 
     private int scrollDirection = NO_SCROLL;
Index: trunk/src/org/openstreetmap/josm/gui/SelectionManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/SelectionManager.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/SelectionManager.java	(revision 10611)
@@ -172,10 +172,5 @@
         eventSource.addMouseMotionListener(this);
         selectionEndedListener.addPropertyChangeListener(this);
-        eventSource.addPropertyChangeListener("scale", new PropertyChangeListener() {
-            @Override
-            public void propertyChange(PropertyChangeEvent evt) {
-                abortSelecting();
-            }
-        });
+        eventSource.addPropertyChangeListener("scale", evt -> abortSelecting());
         eventSource.addTemporaryLayer(selectionHintLayer);
     }
Index: trunk/src/org/openstreetmap/josm/gui/SideButton.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/SideButton.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/SideButton.java	(revision 10611)
@@ -7,5 +7,4 @@
 import java.awt.Insets;
 import java.awt.event.ActionListener;
-import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 
@@ -85,10 +84,7 @@
         // SideButton is constructed get the proper icon size
         if (action != null) {
-            propertyChangeListener = new PropertyChangeListener() {
-                @Override
-                public void propertyChange(PropertyChangeEvent evt) {
-                    if (javax.swing.Action.SMALL_ICON.equals(evt.getPropertyName())) {
-                        fixIcon(null);
-                    }
+            propertyChangeListener = evt -> {
+                if (javax.swing.Action.SMALL_ICON.equals(evt.getPropertyName())) {
+                    fixIcon(null);
                 }
             };
Index: trunk/src/org/openstreetmap/josm/gui/SplashScreen.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/SplashScreen.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/SplashScreen.java	(revision 10611)
@@ -119,10 +119,5 @@
     @Override
     public void stateChanged(ChangeEvent ignore) {
-        GuiHelper.runInEDT(new Runnable() {
-            @Override
-            public void run() {
-                progressRenderer.setTasks(progressMonitor.toString());
-            }
-        });
+        GuiHelper.runInEDT(() -> progressRenderer.setTasks(progressMonitor.toString()));
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java	(revision 10611)
@@ -96,12 +96,7 @@
     private static CopyOnWriteArrayList<TileSourceProvider> providers = new CopyOnWriteArrayList<>();
     static {
-        addTileSourceProvider(new TileSourceProvider() {
-            @Override
-            public List<TileSource> getTileSources() {
-                return Arrays.<TileSource>asList(
-                        new OsmTileSource.Mapnik(),
-                        new OsmTileSource.CycleMap());
-            }
-        });
+        addTileSourceProvider(() -> Arrays.<TileSource>asList(
+                new OsmTileSource.Mapnik(),
+                new OsmTileSource.CycleMap()));
         addTileSourceProvider(new TMSTileSourceProvider());
     }
Index: trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java	(revision 10611)
@@ -806,14 +806,9 @@
         public void adapt(final JToggleButton btn) {
             btn.addItemListener(this);
-            addPropertyChangeListener(
-                    new PropertyChangeListener() {
-                        @Override
-                        public void propertyChange(PropertyChangeEvent evt) {
-                            if (evt.getPropertyName().equals(PROP_SELECTED)) {
-                                btn.setSelected((Boolean) evt.getNewValue());
-                            }
-                        }
+            addPropertyChangeListener(evt -> {
+                    if (evt.getPropertyName().equals(PROP_SELECTED)) {
+                        btn.setSelected((Boolean) evt.getNewValue());
                     }
-            );
+                });
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java	(revision 10611)
@@ -98,9 +98,5 @@
     public static synchronized CombinePrimitiveResolverDialog getInstance() {
         if (instance == null) {
-            GuiHelper.runInEDTAndWait(new Runnable() {
-                @Override public void run() {
-                    instance = new CombinePrimitiveResolverDialog(Main.parent);
-                }
-            });
+            GuiHelper.runInEDTAndWait(() -> instance = new CombinePrimitiveResolverDialog(Main.parent));
         }
         return instance;
@@ -136,12 +132,10 @@
     public void setTargetPrimitive(final OsmPrimitive primitive) {
         this.targetPrimitive = primitive;
-        GuiHelper.runInEDTAndWait(new Runnable() {
-            @Override public void run() {
-                updateTitle();
-                if (primitive instanceof Way) {
-                    pnlRelationMemberConflictResolver.initForWayCombining();
-                } else if (primitive instanceof Node) {
-                    pnlRelationMemberConflictResolver.initForNodeMerging();
-                }
+        GuiHelper.runInEDTAndWait(() -> {
+            updateTitle();
+            if (primitive instanceof Way) {
+                pnlRelationMemberConflictResolver.initForWayCombining();
+            } else if (primitive instanceof Node) {
+                pnlRelationMemberConflictResolver.initForNodeMerging();
             }
         });
@@ -576,16 +570,6 @@
             final TagCollection normalizedTags) throws UserCancelException {
         String conflicts = Utils.joinAsHtmlUnorderedList(Utils.transform(normalizedTags.getKeysWithMultipleValues(),
-                new Function<String, String>() {
-            @Override
-            public String apply(String key) {
-                return tr("{0} ({1})", key, Utils.join(tr(", "), Utils.transform(normalizedTags.getValues(key),
-                        new Function<String, String>() {
-                    @Override
-                    public String apply(String x) {
-                        return x == null || x.isEmpty() ? tr("<i>missing</i>") : x;
-                    }
-                })));
-            }
-        }));
+                (Function<String, String>) key -> tr("{0} ({1})", key, Utils.join(tr(", "), Utils.transform(normalizedTags.getValues(key),
+                        (Function<String, String>) x -> x == null || x.isEmpty() ? tr("<i>missing</i>") : x)))));
         String msg = /* for correct i18n of plural forms - see #9110 */ trn("You are about to combine {0} objects, "
                 + "but the following tags are used conflictingly:<br/>{1}"
Index: trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java	(revision 10611)
@@ -9,5 +9,4 @@
 import java.awt.event.FocusEvent;
 import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 import java.awt.event.KeyEvent;
 import java.util.concurrent.CopyOnWriteArrayList;
@@ -120,13 +119,8 @@
                 }
         );
-        editor.addItemListener(
-                new ItemListener() {
-                    @Override
-                    public void itemStateChanged(ItemEvent e) {
-                        if (e.getStateChange() == ItemEvent.SELECTED)
-                            fireEditingStopped();
-                    }
-                }
-        );
+        editor.addItemListener(e -> {
+            if (e.getStateChange() == ItemEvent.SELECTED)
+                fireEditingStopped();
+        });
         editor.setRenderer(new EditorCellRenderer());
         listeners = new CopyOnWriteArrayList<>();
Index: trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionEditor.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionEditor.java	(revision 10611)
@@ -3,6 +3,4 @@
 
 import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.util.EventObject;
 
@@ -38,10 +36,5 @@
     @Override
     public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
-        addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                stopCellEditing();
-            }
-        });
+        addActionListener(e -> stopCellEditing());
         setSelectedItem(value);
         this.originalValue = (RelationMemberConflictDecisionType) value;
Index: trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverColumnModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverColumnModel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverColumnModel.java	(revision 10611)
@@ -29,12 +29,7 @@
     };
 
-    private final transient TableCellRenderer tableRenderer = new TableCellRenderer() {
-        @Override
-        public Component getTableCellRendererComponent(JTable table, Object value,
-                boolean isSelected, boolean hasFocus, int row, int column) {
-            return setColors(defaultTableCellRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column),
-                    table, isSelected, row);
-        }
-    };
+    private final transient TableCellRenderer tableRenderer = (table, value, isSelected, hasFocus, row, column)
+            -> setColors(defaultTableCellRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column),
+            table, isSelected, row);
 
     private static Component setColors(Component comp, JTable table, boolean isSelected, int row) {
Index: trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModel.java	(revision 10611)
@@ -25,5 +25,4 @@
 import org.openstreetmap.josm.data.osm.RelationToChildReference;
 import org.openstreetmap.josm.gui.util.GuiHelper;
-import org.openstreetmap.josm.tools.Predicate;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -235,10 +234,5 @@
                     iterators.add(i.iterator());
                 }
-                while (Utils.forAll(iterators, new Predicate<Iterator<RelationMemberConflictDecision>>() {
-                    @Override
-                    public boolean evaluate(Iterator<RelationMemberConflictDecision> it) {
-                        return it.hasNext();
-                    }
-                })) {
+                while (Utils.forAll(iterators, it -> it.hasNext())) {
                     final List<RelationMemberConflictDecision> decisions = new ArrayList<>();
                     final Collection<String> roles = new HashSet<>();
@@ -310,9 +304,5 @@
     public void refresh() {
         updateNumConflicts();
-        GuiHelper.runInEDTAndWait(new Runnable() {
-            @Override public void run() {
-                fireTableDataChanged();
-            }
-        });
+        GuiHelper.runInEDTAndWait(this::fireTableDataChanged);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolver.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolver.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolver.java	(revision 10611)
@@ -13,6 +13,4 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
 
 import org.openstreetmap.josm.Main;
@@ -56,23 +54,13 @@
         pnl.add(cbShowTagsWithConflictsOnly, gc);
         pnl.add(cbShowTagsWithMultiValuesOnly, gc);
-        cbShowTagsWithConflictsOnly.addChangeListener(
-                new ChangeListener() {
-                    @Override
-                    public void stateChanged(ChangeEvent e) {
-                        model.setShowTagsWithConflictsOnly(cbShowTagsWithConflictsOnly.isSelected());
-                        cbShowTagsWithMultiValuesOnly.setEnabled(cbShowTagsWithConflictsOnly.isSelected());
-                    }
-                }
-        );
+        cbShowTagsWithConflictsOnly.addChangeListener(e -> {
+                model.setShowTagsWithConflictsOnly(cbShowTagsWithConflictsOnly.isSelected());
+                cbShowTagsWithMultiValuesOnly.setEnabled(cbShowTagsWithConflictsOnly.isSelected());
+        });
         cbShowTagsWithConflictsOnly.setSelected(
                 Main.pref.getBoolean(getClass().getName() + ".showTagsWithConflictsOnly", false)
         );
         cbShowTagsWithMultiValuesOnly.addChangeListener(
-                new ChangeListener() {
-                    @Override
-                    public void stateChanged(ChangeEvent e) {
-                        model.setShowTagsWithMultiValuesOnly(cbShowTagsWithMultiValuesOnly.isSelected());
-                    }
-                }
+                e -> model.setShowTagsWithMultiValuesOnly(cbShowTagsWithMultiValuesOnly.isSelected())
         );
         cbShowTagsWithMultiValuesOnly.setSelected(
Index: trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java	(revision 10611)
@@ -6,5 +6,4 @@
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -68,13 +67,10 @@
         Collections.sort(
                 displayedKeys,
-                new Comparator<String>() {
-                    @Override
-                    public int compare(String key1, String key2) {
-                        if (decisions.get(key1).isDecided() && !decisions.get(key2).isDecided())
-                            return 1;
-                        else if (!decisions.get(key1).isDecided() && decisions.get(key2).isDecided())
-                            return -1;
-                        return key1.compareTo(key2);
-                    }
+                (key1, key2) -> {
+                    if (decisions.get(key1).isDecided() && !decisions.get(key2).isDecided())
+                        return 1;
+                    else if (!decisions.get(key1).isDecided() && decisions.get(key2).isDecided())
+                        return -1;
+                    return key1.compareTo(key2);
                 }
         );
@@ -115,9 +111,5 @@
         refreshNumConflicts();
         sort();
-        GuiHelper.runInEDTAndWait(new Runnable() {
-            @Override public void run() {
-                fireTableDataChanged();
-            }
-        });
+        GuiHelper.runInEDTAndWait(this::fireTableDataChanged);
     }
 
@@ -184,9 +176,5 @@
             }
         }
-        GuiHelper.runInEDTAndWait(new Runnable() {
-            @Override public void run() {
-                fireTableDataChanged();
-            }
-        });
+        GuiHelper.runInEDTAndWait(this::fireTableDataChanged);
         refreshNumConflicts();
     }
Index: trunk/src/org/openstreetmap/josm/gui/datatransfer/ClipboardUtils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/datatransfer/ClipboardUtils.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/datatransfer/ClipboardUtils.java	(revision 10611)
@@ -12,5 +12,4 @@
 import java.awt.datatransfer.UnsupportedFlavorException;
 import java.io.IOException;
-import java.util.concurrent.Callable;
 
 import org.openstreetmap.josm.Main;
@@ -139,14 +138,11 @@
      */
     public static boolean copy(final Transferable transferable) {
-        return GuiHelper.runInEDTAndWaitAndReturn(new Callable<Boolean>() {
-            @Override
-            public Boolean call() throws Exception {
-                try {
-                    getClipboard().setContents(transferable, new DoNothingClipboardOwner());
-                    return true;
-                } catch (IllegalStateException ex) {
-                    Main.error(ex);
-                    return false;
-                }
+        return GuiHelper.runInEDTAndWaitAndReturn(() -> {
+            try {
+                getClipboard().setContents(transferable, new DoNothingClipboardOwner());
+                return true;
+            } catch (IllegalStateException ex) {
+                Main.error(ex);
+                return false;
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java	(revision 10611)
@@ -522,35 +522,27 @@
             }
 
-            Runnable r = new Runnable() {
-                @Override
-                public void run() {
-                    // first, wait for the download task to finish, if a download task was launched
-                    if (future != null) {
-                        try {
-                            future.get();
-                        } catch (InterruptedException e) {
-                            Main.warn("InterruptedException in "+getClass().getSimpleName()+" while downloading changeset header");
-                        } catch (ExecutionException e) {
-                            Main.error(e);
-                            BugReportExceptionHandler.handleException(e.getCause());
-                            return;
-                        }
+            Runnable r = () -> {
+                // first, wait for the download task to finish, if a download task was launched
+                if (future != null) {
+                    try {
+                        future.get();
+                    } catch (InterruptedException e1) {
+                        Main.warn(e1, "InterruptedException in ChangesetDialog while downloading changeset header");
+                    } catch (ExecutionException e2) {
+                        Main.error(e2);
+                        BugReportExceptionHandler.handleException(e2.getCause());
+                        return;
                     }
-                    if (task != null) {
-                        if (task.isCanceled())
-                            // don't launch the changeset manager if the download task was canceled
-                            return;
-                        if (task.isFailed()) {
-                            toDownload.clear();
-                        }
+                }
+                if (task != null) {
+                    if (task.isCanceled())
+                        // don't launch the changeset manager if the download task was canceled
+                        return;
+                    if (task.isFailed()) {
+                        toDownload.clear();
                     }
-                    // launch the task
-                    GuiHelper.runInEDT(new Runnable() {
-                        @Override
-                        public void run() {
-                            launchChangesetManager(sel);
-                        }
-                    });
                 }
+                // launch the task
+                GuiHelper.runInEDT(() -> launchChangesetManager(sel));
             };
             Main.worker.submit(r);
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java	(revision 10611)
@@ -49,5 +49,4 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.InputMapUtils;
-import org.openstreetmap.josm.tools.Predicate;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -197,10 +196,5 @@
         addShowNotifyListener(updater);
 
-        tree.addTreeSelectionListener(new TreeSelectionListener() {
-            @Override
-            public void valueChanged(TreeSelectionEvent e) {
-                updater.updateEnabledState();
-            }
-        });
+        tree.addTreeSelectionListener(e -> updater.updateEnabledState());
 
         tree.getModel().addTreeModelListener(new TreeModelListener() {
@@ -342,10 +336,7 @@
         return new FilteredCollection<>(
                 c.getParticipatingPrimitives(),
-                new Predicate<OsmPrimitive>() {
-                    @Override
-                    public boolean evaluate(OsmPrimitive o) {
-                        OsmPrimitive p = currentLayer.data.getPrimitiveById(o);
-                        return p != null && p.isUsable();
-                    }
+                o -> {
+                    OsmPrimitive p = currentLayer.data.getPrimitiveById(o);
+                    return p != null && p.isUsable();
                 }
         );
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java	(revision 10611)
@@ -123,10 +123,5 @@
         lstConflicts.setCellRenderer(new OsmPrimitivRenderer());
         lstConflicts.addMouseListener(new MouseEventHandler());
-        addListSelectionListener(new ListSelectionListener() {
-            @Override
-            public void valueChanged(ListSelectionEvent e) {
-                Main.map.mapView.repaint();
-            }
-        });
+        addListSelectionListener(e -> Main.map.mapView.repaint());
 
         SideButton btnResolve = new SideButton(actResolve);
@@ -236,10 +231,7 @@
         OsmDataLayer editLayer = Main.getLayerManager().getEditLayer();
         conflicts = editLayer == null ? new ConflictCollection() : editLayer.getConflicts();
-        GuiHelper.runInEDT(new Runnable() {
-            @Override
-            public void run() {
-                model.fireContentChanged();
-                updateTitle();
-            }
+        GuiHelper.runInEDT(() -> {
+            model.fireContentChanged();
+            updateTitle();
         });
     }
@@ -597,20 +589,17 @@
                     )
             };
-            GuiHelper.runInEDT(new Runnable() {
-                @Override
-                public void run() {
-                    HelpAwareOptionPane.showOptionDialog(
-                            Main.parent,
-                            sb.toString(),
-                            tr("Conflicts detected"),
-                            JOptionPane.WARNING_MESSAGE,
-                            null, /* no icon */
-                            options,
-                            options[0],
-                            ht("/Concepts/Conflict#WarningAboutDetectedConflicts")
-                    );
-                    unfurlDialog();
-                    Main.map.repaint();
-                }
+            GuiHelper.runInEDT(() -> {
+                HelpAwareOptionPane.showOptionDialog(
+                        Main.parent,
+                        sb.toString(),
+                        tr("Conflicts detected"),
+                        JOptionPane.WARNING_MESSAGE,
+                        null, /* no icon */
+                        options,
+                        options[0],
+                        ht("/Concepts/Conflict#WarningAboutDetectedConflicts")
+                );
+                unfurlDialog();
+                Main.map.repaint();
             });
         }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java	(revision 10611)
@@ -276,10 +276,6 @@
 
     public void updateDialogHeader() {
-        SwingUtilities.invokeLater(new Runnable() {
-            @Override
-            public void run() {
-                setTitle(tr("Filter Hidden:{0} Disabled:{1}", filterModel.disabledAndHiddenCount, filterModel.disabledCount));
-            }
-        });
+        SwingUtilities.invokeLater(() -> setTitle(
+                tr("Filter Hidden:{0} Disabled:{1}", filterModel.disabledAndHiddenCount, filterModel.disabledCount)));
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java	(revision 10611)
@@ -21,6 +21,4 @@
 import javax.swing.JTabbedPane;
 import javax.swing.SingleSelectionModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
 
 import org.openstreetmap.josm.Main;
@@ -78,12 +76,8 @@
         final JPanel pMapPaint = new JPanel();
         tabs.addTab(tr("map style"), pMapPaint);
-        tabs.getModel().addChangeListener(new ChangeListener() {
-
-            @Override
-            public void stateChanged(ChangeEvent e) {
-                if (!mappaintTabLoaded && ((SingleSelectionModel) e.getSource()).getSelectedIndex() == 1) {
-                    mappaintTabLoaded = true;
-                    genericMonospacePanel(pMapPaint, buildMapPaintText());
-                }
+        tabs.getModel().addChangeListener(e -> {
+            if (!mappaintTabLoaded && ((SingleSelectionModel) e.getSource()).getSelectedIndex() == 1) {
+                mappaintTabLoaded = true;
+                genericMonospacePanel(pMapPaint, buildMapPaintText());
             }
         });
@@ -91,12 +85,8 @@
         final JPanel pEditCounts = new JPanel();
         tabs.addTab(tr("edit counts"), pEditCounts);
-        tabs.getModel().addChangeListener(new ChangeListener() {
-
-            @Override
-            public void stateChanged(ChangeEvent e) {
-                if (!editcountTabLoaded && ((SingleSelectionModel) e.getSource()).getSelectedIndex() == 2) {
-                    editcountTabLoaded = true;
-                    genericMonospacePanel(pEditCounts, buildListOfEditorsText(primitives));
-                }
+        tabs.getModel().addChangeListener(e -> {
+            if (!editcountTabLoaded && ((SingleSelectionModel) e.getSource()).getSelectedIndex() == 2) {
+                editcountTabLoaded = true;
+                genericMonospacePanel(pEditCounts, buildListOfEditorsText(primitives));
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java	(revision 10611)
@@ -22,6 +22,4 @@
 import javax.swing.JTabbedPane;
 import javax.swing.UIManager;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
@@ -167,12 +165,9 @@
         tabs.addTab(tr("Lat/Lon"), buildLatLon());
         tabs.addTab(tr("East/North"), buildEastNorth());
-        tabs.getModel().addChangeListener(new ChangeListener() {
-            @Override
-            public void stateChanged(ChangeEvent e) {
-                switch (tabs.getModel().getSelectedIndex()) {
-                    case 0: parseLatLonUserInput(); break;
-                    case 1: parseEastNorthUserInput(); break;
-                    default: throw new AssertionError();
-                }
+        tabs.getModel().addChangeListener(e -> {
+            switch (tabs.getModel().getSelectedIndex()) {
+                case 0: parseLatLonUserInput(); break;
+                case 1: parseEastNorthUserInput(); break;
+                default: throw new AssertionError();
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 10611)
@@ -37,7 +37,4 @@
 import javax.swing.event.ListDataEvent;
 import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
 import javax.swing.table.AbstractTableModel;
 import javax.swing.table.DefaultTableCellRenderer;
@@ -362,12 +359,5 @@
      */
     protected void adaptTo(final IEnabledStateUpdating listener, ListSelectionModel listSelectionModel) {
-        listSelectionModel.addListSelectionListener(
-                new ListSelectionListener() {
-                    @Override
-                    public void valueChanged(ListSelectionEvent e) {
-                        listener.updateEnabledState();
-                    }
-                }
-                );
+        listSelectionModel.addListSelectionListener(e -> listener.updateEnabledState());
     }
 
@@ -381,12 +371,5 @@
      */
     protected void adaptTo(final IEnabledStateUpdating listener, LayerListModel listModel) {
-        listModel.addTableModelListener(
-                new TableModelListener() {
-                    @Override
-                    public void tableChanged(TableModelEvent e) {
-                        listener.updateEnabledState();
-                    }
-                }
-                );
+        listModel.addTableModelListener(e -> listener.updateEnabledState());
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 10611)
@@ -13,5 +13,4 @@
 import java.awt.Rectangle;
 import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
@@ -50,6 +49,4 @@
 import javax.swing.UIManager;
 import javax.swing.border.EmptyBorder;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
@@ -139,10 +136,5 @@
             }
         });
-        cbWireframe.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                Main.main.menu.wireFrameToggleAction.actionPerformed(null);
-            }
-        });
+        cbWireframe.addActionListener(e -> Main.main.menu.wireFrameToggleAction.actionPerformed(null));
         cbWireframe.setBorder(new EmptyBorder(new Insets(1, 1, 1, 1)));
 
@@ -441,18 +433,10 @@
             final int[] rows = tblStyles.getSelectedRows();
             MapPaintStyles.reloadStyles(rows);
-            Main.worker.submit(new Runnable() {
-                @Override
-                public void run() {
-                    SwingUtilities.invokeLater(new Runnable() {
-                        @Override
-                        public void run() {
-                            selectionModel.clearSelection();
-                            for (int r: rows) {
-                                selectionModel.addSelectionInterval(r, r);
-                            }
-                        }
-                    });
+            Main.worker.submit(() -> SwingUtilities.invokeLater(() -> {
+                selectionModel.clearSelection();
+                for (int r: rows) {
+                    selectionModel.addSelectionInterval(r, r);
                 }
-            });
+            }));
         }
     }
@@ -531,14 +515,11 @@
             @Override
             protected void finish() {
-                SwingUtilities.invokeLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        if (!error && !canceled) {
-                            SourceEntry se = new SourceEntry(s);
-                            se.url = file.getPath();
-                            MapPaintStyles.addStyle(se);
-                            tblStyles.getSelectionModel().setSelectionInterval(model.getRowCount() - 1, model.getRowCount() - 1);
-                            model.ensureSelectedIsVisible();
-                        }
+                SwingUtilities.invokeLater(() -> {
+                    if (!error && !canceled) {
+                        SourceEntry se = new SourceEntry(s);
+                        se.url = file.getPath();
+                        MapPaintStyles.addStyle(se);
+                        tblStyles.getSelectionModel().setSelectionInterval(model.getRowCount() - 1, model.getRowCount() - 1);
+                        model.ensureSelectedIsVisible();
                     }
                 });
@@ -594,19 +575,16 @@
             tabs.setTabComponentAt(3, lblSource);
 
-            tabs.getModel().addChangeListener(new ChangeListener() {
-                @Override
-                public void stateChanged(ChangeEvent e) {
-                    if (!errorsTabLoaded && ((SingleSelectionModel) e.getSource()).getSelectedIndex() == 1) {
-                        errorsTabLoaded = true;
-                        buildErrorsOrWarningPanel(s.getErrors(), pErrors);
-                    }
-                    if (!warningsTabLoaded && ((SingleSelectionModel) e.getSource()).getSelectedIndex() == 2) {
-                        warningsTabLoaded = true;
-                        buildErrorsOrWarningPanel(s.getWarnings(), pWarnings);
-                    }
-                    if (!sourceTabLoaded && ((SingleSelectionModel) e.getSource()).getSelectedIndex() == 3) {
-                        sourceTabLoaded = true;
-                        buildSourcePanel(s, pSource);
-                    }
+            tabs.getModel().addChangeListener(e1 -> {
+                if (!errorsTabLoaded && ((SingleSelectionModel) e1.getSource()).getSelectedIndex() == 1) {
+                    errorsTabLoaded = true;
+                    buildErrorsOrWarningPanel(s.getErrors(), pErrors);
+                }
+                if (!warningsTabLoaded && ((SingleSelectionModel) e1.getSource()).getSelectedIndex() == 2) {
+                    warningsTabLoaded = true;
+                    buildErrorsOrWarningPanel(s.getWarnings(), pWarnings);
+                }
+                if (!sourceTabLoaded && ((SingleSelectionModel) e1.getSource()).getSelectedIndex() == 3) {
+                    sourceTabLoaded = true;
+                    buildSourcePanel(s, pSource);
                 }
             });
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/MenuItemSearchDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/MenuItemSearchDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/MenuItemSearchDialog.java	(revision 10611)
@@ -7,5 +7,4 @@
 import java.awt.Dimension;
 import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
 
@@ -31,10 +30,5 @@
         super(Main.parent, tr("Search menu items"), new String[]{tr("Select"), tr("Cancel")});
         this.selector = new Selector(menu);
-        this.selector.setDblClickListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                buttonAction(0, null);
-            }
-        });
+        this.selector.setDblClickListener(e -> buttonAction(0, null));
         setContent(selector, false);
         setPreferredSize(new Dimension(600, 300));
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java	(revision 10611)
@@ -27,6 +27,4 @@
 import javax.swing.ListSelectionModel;
 import javax.swing.SwingUtilities;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
 
 import org.openstreetmap.josm.Main;
@@ -87,12 +85,9 @@
         displayList.setCellRenderer(new NoteRenderer());
         displayList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-        displayList.addListSelectionListener(new ListSelectionListener() {
-            @Override
-            public void valueChanged(ListSelectionEvent e) {
-                if (noteData != null) { //happens when layer is deleted while note selected
-                    noteData.setSelectedNote(displayList.getSelectedValue());
-                }
-                updateButtonStates();
-            }
+        displayList.addListSelectionListener(e -> {
+            if (noteData != null) { //happens when layer is deleted while note selected
+                noteData.setSelectedNote(displayList.getSelectedValue());
+            }
+            updateButtonStates();
         });
         displayList.addMouseListener(new MouseAdapter() {
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/OsmIdSelectionDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/OsmIdSelectionDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/OsmIdSelectionDialog.java	(revision 10611)
@@ -7,6 +7,4 @@
 import java.awt.Component;
 import java.awt.Dimension;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 import java.awt.event.KeyEvent;
 import java.awt.event.WindowEvent;
@@ -41,4 +39,5 @@
 import org.openstreetmap.josm.gui.widgets.OsmPrimitiveTypesComboBox;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.tools.Utils.Function;
 
 /**
@@ -105,10 +104,7 @@
         help.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
 
-        cbType.addItemListener(new ItemListener() {
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                tfId.setType(cbType.getType());
-                tfId.performValidation();
-            }
+        cbType.addItemListener(e -> {
+            tfId.setType(cbType.getType());
+            tfId.performValidation();
         });
 
@@ -208,17 +204,9 @@
         final List<SimplePrimitiveId> ids = SimplePrimitiveId.fuzzyParse(buf);
         if (!ids.isEmpty()) {
-            final String parsedText = Utils.join(", ", Utils.transform(ids, new Utils.Function<SimplePrimitiveId, String>() {
-                @Override
-                public String apply(SimplePrimitiveId x) {
-                    return x.getType().getAPIName().charAt(0) + String.valueOf(x.getUniqueId());
-                }
-            }));
+            final String parsedText = Utils.join(", ", Utils.transform(ids,
+                    (Function<SimplePrimitiveId, String>) x -> x.getType().getAPIName().charAt(0) + String.valueOf(x.getUniqueId())));
             tfId.tryToPasteFrom(parsedText);
-            final Set<OsmPrimitiveType> types = EnumSet.copyOf(Utils.transform(ids, new Utils.Function<SimplePrimitiveId, OsmPrimitiveType>() {
-                @Override
-                public OsmPrimitiveType apply(SimplePrimitiveId x) {
-                    return x.getType();
-                }
-            }));
+            final Set<OsmPrimitiveType> types = EnumSet.copyOf(Utils.transform(ids,
+                    (Function<SimplePrimitiveId, OsmPrimitiveType>) x -> x.getType()));
             if (types.size() == 1) {
                 // select corresponding type
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 10611)
@@ -9,6 +9,4 @@
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -31,6 +29,4 @@
 import javax.swing.KeyStroke;
 import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
 
 import org.openstreetmap.josm.Main;
@@ -83,5 +79,4 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.InputMapUtils;
-import org.openstreetmap.josm.tools.Predicate;
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.Utils;
@@ -162,10 +157,5 @@
         filter = setupFilter();
 
-        displaylist.addListSelectionListener(new ListSelectionListener() {
-            @Override
-            public void valueChanged(ListSelectionEvent e) {
-                updateActionsRelationLists();
-            }
-        });
+        displaylist.addListSelectionListener(e -> updateActionsRelationLists());
 
         // Setup popup menu handler
@@ -309,10 +299,5 @@
         f.setToolTipText(tr("Relation list filter"));
         final CompileSearchTextDecorator decorator = CompileSearchTextDecorator.decorate(f);
-        f.addPropertyChangeListener("filter", new PropertyChangeListener() {
-            @Override
-            public void propertyChange(PropertyChangeEvent evt) {
-                model.setFilter(decorator.getMatch());
-            }
-        });
+        f.addPropertyChangeListener("filter", evt -> model.setFilter(decorator.getMatch()));
         return f;
     }
@@ -506,10 +491,5 @@
         private void updateFilteredRelations() {
             if (filter != null) {
-                filteredRelations = new ArrayList<>(Utils.filter(relations, new Predicate<Relation>() {
-                    @Override
-                    public boolean evaluate(Relation r) {
-                        return filter.match(r);
-                    }
-                }));
+                filteredRelations = new ArrayList<>(Utils.filter(relations, filter::match));
             } else if (filteredRelations != null) {
                 filteredRelations = null;
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 10611)
@@ -125,19 +125,9 @@
         // the select action
         final SideButton selectButton = new SideButton(actSelect);
-        selectButton.createArrow(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                SelectionHistoryPopup.launch(selectButton, model.getSelectionHistory());
-            }
-        });
+        selectButton.createArrow(e -> SelectionHistoryPopup.launch(selectButton, model.getSelectionHistory()));
 
         // the search button
         final SideButton searchButton = new SideButton(actSearch);
-        searchButton.createArrow(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                SearchPopupMenu.launch(searchButton);
-            }
-        });
+        searchButton.createArrow(e -> SearchPopupMenu.launch(searchButton));
 
         createLayout(lstPrimitives, true, Arrays.asList(new SideButton[] {
@@ -164,10 +154,7 @@
         popupMenuHandler = setupPopupMenuHandler();
 
-        lstPrimitives.addListSelectionListener(new ListSelectionListener() {
-            @Override
-            public void valueChanged(ListSelectionEvent e) {
-                actZoomToListSelection.valueChanged(e);
-                popupMenuHandler.setPrimitives(model.getSelected());
-            }
+        lstPrimitives.addListSelectionListener(e -> {
+            actZoomToListSelection.valueChanged(e);
+            popupMenuHandler.setPrimitives(model.getSelected());
         });
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 10611)
@@ -18,5 +18,4 @@
 import java.awt.event.AWTEventListener;
 import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.ComponentAdapter;
 import java.awt.event.ComponentEvent;
@@ -513,4 +512,5 @@
         private DialogPopupMenu popupMenu;
 
+        @SuppressWarnings("unchecked")
         public TitleBar(String toggleDialogName, String iconName) {
             setLayout(new GridBagLayout());
@@ -544,14 +544,9 @@
             buttonsHide.setToolTipText(tr("Toggle dynamic buttons"));
             buttonsHide.setBorder(BorderFactory.createEmptyBorder());
-            buttonsHide.addActionListener(
-                    new ActionListener() {
-                        @Override
-                        public void actionPerformed(ActionEvent e) {
-                            JRadioButtonMenuItem item = (buttonHiding == ButtonHidingType.DYNAMIC) ? alwaysShown : dynamic;
-                            item.setSelected(true);
-                            item.getAction().actionPerformed(null);
-                        }
-                    }
-                    );
+            buttonsHide.addActionListener(e -> {
+                JRadioButtonMenuItem item = (buttonHiding == ButtonHidingType.DYNAMIC) ? alwaysShown : dynamic;
+                item.setSelected(true);
+                item.getAction().actionPerformed(null);
+            });
             add(buttonsHide);
 
@@ -561,19 +556,13 @@
                 pref.setToolTipText(tr("Open preferences for this panel"));
                 pref.setBorder(BorderFactory.createEmptyBorder());
-                pref.addActionListener(
-                        new ActionListener() {
-                            @Override
-                            @SuppressWarnings("unchecked")
-                            public void actionPerformed(ActionEvent e) {
-                                final PreferenceDialog p = new PreferenceDialog(Main.parent);
-                                if (TabPreferenceSetting.class.isAssignableFrom(preferenceClass)) {
-                                    p.selectPreferencesTabByClass((Class<? extends TabPreferenceSetting>) preferenceClass);
-                                } else if (SubPreferenceSetting.class.isAssignableFrom(preferenceClass)) {
-                                    p.selectSubPreferencesTabByClass((Class<? extends SubPreferenceSetting>) preferenceClass);
-                                }
-                                p.setVisible(true);
-                            }
-                        }
-                        );
+                pref.addActionListener(e -> {
+                    final PreferenceDialog p = new PreferenceDialog(Main.parent);
+                    if (TabPreferenceSetting.class.isAssignableFrom(preferenceClass)) {
+                        p.selectPreferencesTabByClass((Class<? extends TabPreferenceSetting>) preferenceClass);
+                    } else if (SubPreferenceSetting.class.isAssignableFrom(preferenceClass)) {
+                        p.selectSubPreferencesTabByClass((Class<? extends SubPreferenceSetting>) preferenceClass);
+                    }
+                    p.setVisible(true);
+                });
                 add(pref);
             }
@@ -583,13 +572,8 @@
             sticky.setToolTipText(tr("Undock the panel"));
             sticky.setBorder(BorderFactory.createEmptyBorder());
-            sticky.addActionListener(
-                    new ActionListener() {
-                        @Override
-                        public void actionPerformed(ActionEvent e) {
-                            detach();
-                            dialogsPanel.reconstruct(Action.ELEMENT_SHRINKS, null);
-                        }
-                    }
-                    );
+            sticky.addActionListener(e -> {
+                detach();
+                dialogsPanel.reconstruct(Action.ELEMENT_SHRINKS, null);
+            });
             add(sticky);
 
@@ -598,14 +582,9 @@
             close.setToolTipText(tr("Close this panel. You can reopen it with the buttons in the left toolbar."));
             close.setBorder(BorderFactory.createEmptyBorder());
-            close.addActionListener(
-                    new ActionListener() {
-                        @Override
-                        public void actionPerformed(ActionEvent e) {
-                            hideDialog();
-                            dialogsPanel.reconstruct(Action.ELEMENT_SHRINKS, null);
-                            hideNotify();
-                        }
-                    }
-                    );
+            close.addActionListener(e -> {
+                hideDialog();
+                dialogsPanel.reconstruct(Action.ELEMENT_SHRINKS, null);
+                hideNotify();
+            });
             add(close);
             setToolTipText(tr("Click to minimize/maximize the panel content"));
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java	(revision 10611)
@@ -129,12 +129,9 @@
     public void refresh(Collection<? extends OsmPrimitive> fromPrimitives) {
         model.populate(fromPrimitives);
-        GuiHelper.runInEDT(new Runnable() {
-            @Override
-            public void run() {
-                if (model.getRowCount() != 0) {
-                    setTitle(trn("{0} Author", "{0} Authors", model.getRowCount(), model.getRowCount()));
-                } else {
-                    setTitle(tr("Authors"));
-                }
+        GuiHelper.runInEDT(() -> {
+            if (model.getRowCount() != 0) {
+                setTitle(trn("{0} Author", "{0} Authors", model.getRowCount(), model.getRowCount()));
+            } else {
+                setTitle(tr("Authors"));
             }
         });
@@ -320,10 +317,5 @@
             }
             Collections.sort(data);
-            GuiHelper.runInEDTAndWait(new Runnable() {
-                @Override
-                public void run() {
-                    fireTableDataChanged();
-                }
-            });
+            GuiHelper.runInEDTAndWait(this::fireTableDataChanged);
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java	(revision 10611)
@@ -593,10 +593,5 @@
                 final Command fixCommand = error.getFix();
                 if (fixCommand != null) {
-                    SwingUtilities.invokeAndWait(new Runnable() {
-                        @Override
-                        public void run() {
-                            Main.main.undoRedo.addNoRedraw(fixCommand);
-                        }
-                    });
+                    SwingUtilities.invokeAndWait(() -> Main.main.undoRedo.addNoRedraw(fixCommand));
                 }
                 // It is wanted to ignore an error if it said fixable, even if fixCommand was null
@@ -614,10 +609,5 @@
                 final DataSet ds = Main.getLayerManager().getEditDataSet();
                 int i = 0;
-                SwingUtilities.invokeAndWait(new Runnable() {
-                    @Override
-                    public void run() {
-                        ds.beginUpdate();
-                    }
-                });
+                SwingUtilities.invokeAndWait(ds::beginUpdate);
                 try {
                     for (TestError error: testErrors) {
@@ -630,24 +620,15 @@
                     }
                 } finally {
-                    SwingUtilities.invokeAndWait(new Runnable() {
-                        @Override
-                        public void run() {
-                            ds.endUpdate();
-                        }
-                    });
+                    SwingUtilities.invokeAndWait(ds::endUpdate);
                 }
                 monitor.subTask(tr("Updating map ..."));
-                SwingUtilities.invokeAndWait(new Runnable() {
-                    @Override
-                    public void run() {
-                        Main.main.undoRedo.afterAdd();
-                        Main.map.repaint();
-                        tree.resetErrors();
-                        ds.fireSelectionChanged();
-                    }
+                SwingUtilities.invokeAndWait(() -> {
+                    Main.main.undoRedo.afterAdd();
+                    Main.map.repaint();
+                    tree.resetErrors();
+                    ds.fireSelectionChanged();
                 });
             } catch (InterruptedException | InvocationTargetException e) {
-                // FIXME: signature of realRun should have a generic checked exception we
-                // could throw here
+                // FIXME: signature of realRun should have a generic checked exception we could throw here
                 throw new RuntimeException(e);
             } finally {
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java	(revision 10611)
@@ -653,10 +653,5 @@
         if (idx < 0)
             return;
-        GuiHelper.runInEDTAndWait(new Runnable() {
-            @Override
-            public void run() {
-                tblChangesets.scrollRectToVisible(tblChangesets.getCellRect(idx, 0, true));
-            }
-        });
+        GuiHelper.runInEDTAndWait(() -> tblChangesets.scrollRectToVisible(tblChangesets.getCellRect(idx, 0, true)));
         repaint();
     }
@@ -702,11 +697,8 @@
     public void runDownloadTask(final AbstractChangesetDownloadTask task) {
         Main.worker.submit(new PostDownloadHandler(task, task.download()));
-        Main.worker.submit(new Runnable() {
-            @Override
-            public void run() {
-                if (task.isCanceled() || task.isFailed())
-                    return;
-                setSelectedChangesets(task.getDownloadedData());
-            }
+        Main.worker.submit(() -> {
+            if (task.isCanceled() || task.isFailed())
+                return;
+            setSelectedChangesets(task.getDownloadedData());
         });
     }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerModel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerModel.java	(revision 10611)
@@ -7,5 +7,4 @@
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashSet;
 import java.util.List;
@@ -105,9 +104,5 @@
      */
     public void setSelectedChangesets(Collection<Changeset> selected) {
-        GuiHelper.runInEDTAndWait(new Runnable() {
-            @Override public void run() {
-                selectionModel.clearSelection();
-            }
-        });
+        GuiHelper.runInEDTAndWait(selectionModel::clearSelection);
         if (selected == null || selected.isEmpty())
             return;
@@ -115,9 +110,5 @@
             final int idx = data.indexOf(cs);
             if (idx >= 0) {
-                GuiHelper.runInEDTAndWait(new Runnable() {
-                    @Override public void run() {
-                        selectionModel.addSelectionInterval(idx, idx);
-                    }
-                });
+                GuiHelper.runInEDTAndWait(() -> selectionModel.addSelectionInterval(idx, idx));
             }
         }
@@ -162,10 +153,8 @@
         Collections.sort(
                 this.data,
-                new Comparator<Changeset>() {
-                    @Override public int compare(Changeset o1, Changeset o2) {
-                        if (o1.getId() < o2.getId()) return 1;
-                        if (o1.getId() == o2.getId()) return 0;
-                        return -1;
-                    }
+                (o1, o2) -> {
+                    if (o1.getId() < o2.getId()) return 1;
+                    if (o1.getId() == o2.getId()) return 0;
+                    return -1;
                 }
         );
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java	(revision 10611)
@@ -54,4 +54,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.tools.Utils.Function;
 import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
 
@@ -233,18 +234,8 @@
                             continue;
                         }
-                        GuiHelper.runInEDT(new Runnable() {
-                            @Override
-                            public void run() {
-                                HistoryBrowserDialogManager.getInstance().show(h);
-                            }
-                        });
+                        GuiHelper.runInEDT(() -> HistoryBrowserDialogManager.getInstance().show(h));
                     }
                 } catch (final RuntimeException e) {
-                    GuiHelper.runInEDT(new Runnable() {
-                        @Override
-                        public void run() {
-                            BugReportExceptionHandler.handleException(e);
-                        }
-                    });
+                    GuiHelper.runInEDT(() -> BugReportExceptionHandler.handleException(e));
                 }
             }
@@ -311,10 +302,5 @@
         public void actionPerformed(ActionEvent arg0) {
             final List<PrimitiveId> primitiveIds = new ArrayList<>(Utils.transform(
-                    model.getSelectedPrimitives(), new Utils.Function<HistoryOsmPrimitive, PrimitiveId>() {
-                        @Override
-                        public PrimitiveId apply(HistoryOsmPrimitive x) {
-                            return x.getPrimitiveId();
-                        }
-                    }));
+                    model.getSelectedPrimitives(), (Function<HistoryOsmPrimitive, PrimitiveId>) x -> x.getPrimitiveId()));
             Main.worker.submit(new DownloadPrimitivesWithReferrersTask(false, primitiveIds, true, true, null, null));
         }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentTableModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentTableModel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentTableModel.java	(revision 10611)
@@ -4,5 +4,4 @@
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -83,30 +82,27 @@
         Collections.sort(
                 data,
-                new Comparator<ChangesetDataSetEntry>() {
-                    @Override
-                    public int compare(ChangesetDataSetEntry c1, ChangesetDataSetEntry c2) {
-                        if (c1.getModificationType().equals(c2.getModificationType())) {
-                            long id1 = c1.getPrimitive().getId();
-                            long id2 = c2.getPrimitive().getId();
+                (c1, c2) -> {
+                    if (c1.getModificationType().equals(c2.getModificationType())) {
+                        long id1 = c1.getPrimitive().getId();
+                        long id2 = c2.getPrimitive().getId();
 
-                            if (id1 == id2)
-                                return 0;
-                            else if (id1 < id2)
-                                return -1;
-                            return 1;
+                        if (id1 == id2)
+                            return 0;
+                        else if (id1 < id2)
+                            return -1;
+                        return 1;
+                    }
+                    switch(c1.getModificationType()) {
+                    case CREATED: return -1;
+                    case UPDATED:
+                        switch(c2.getModificationType()) {
+                        case CREATED: return 1;
+                        default: return -1;
                         }
-                        switch(c1.getModificationType()) {
-                        case CREATED: return -1;
-                        case UPDATED:
-                            switch(c2.getModificationType()) {
-                            case CREATED: return 1;
-                            default: return -1;
-                            }
-                        case DELETED:
-                            return 1;
-                        }
-                        // should not happen
-                        return 0;
+                    case DELETED:
+                        return 1;
                     }
+                    // should not happen
+                    return 0;
                 }
         );
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDiscussionPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDiscussionPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDiscussionPanel.java	(revision 10611)
@@ -116,10 +116,7 @@
         JPanel pnl = new JPanel(new BorderLayout());
         table = new JTable(model, new ChangesetDiscussionTableColumnModel());
-        table.getColumnModel().getColumn(2).addPropertyChangeListener(new PropertyChangeListener() {
-            @Override
-            public void propertyChange(PropertyChangeEvent evt) {
-                if ("width".equals(evt.getPropertyName())) {
-                    updateRowHeights();
-                }
+        table.getColumnModel().getColumn(2).addPropertyChangeListener(evt -> {
+            if ("width".equals(evt.getPropertyName())) {
+                updateRowHeights();
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetListModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetListModel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetListModel.java	(revision 10611)
@@ -5,5 +5,4 @@
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashSet;
 import java.util.List;
@@ -143,11 +142,8 @@
         Collections.sort(
                 data,
-                new Comparator<Changeset>() {
-                    @Override
-                    public int compare(Changeset cs1, Changeset cs2) {
-                        if (cs1.getId() > cs2.getId()) return -1;
-                        if (cs1.getId() == cs2.getId()) return 0;
-                        return 1;
-                    }
+                (cs1, cs2) -> {
+                    if (cs1.getId() > cs2.getId()) return -1;
+                    if (cs1.getId() == cs2.getId()) return 0;
+                    return 1;
                 }
         );
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java	(revision 10611)
@@ -19,5 +19,4 @@
 import javax.swing.event.DocumentListener;
 import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkListener;
 
 import org.openstreetmap.josm.Main;
@@ -86,15 +85,10 @@
                         + "</body></html>"
         );
-        pnl.getEditorPane().addHyperlinkListener(
-                new HyperlinkListener() {
-                    @Override
-                    public void hyperlinkUpdate(HyperlinkEvent e) {
-                        if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
-                            tfUrl.setText(e.getDescription());
-                            tfUrl.requestFocusInWindow();
-                        }
-                    }
+        pnl.getEditorPane().addHyperlinkListener(e -> {
+                if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
+                    tfUrl.setText(e.getDescription());
+                    tfUrl.requestFocusInWindow();
                 }
-        );
+            });
         return pnl;
     }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/layer/ActivateLayerAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/layer/ActivateLayerAction.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/layer/ActivateLayerAction.java	(revision 10611)
@@ -88,16 +88,13 @@
     @Override
     public void updateEnabledState() {
-        GuiHelper.runInEDTAndWait(new Runnable() {
-            @Override
-            public void run() {
-                if (layer == null) {
-                    if (model.getSelectedLayers().size() != 1) {
-                        setEnabled(false);
-                        return;
-                    }
-                    setEnabled(!isActiveLayer(model.getSelectedLayers().get(0)));
-                } else {
-                    setEnabled(!isActiveLayer(layer));
+        GuiHelper.runInEDTAndWait(() -> {
+            if (layer == null) {
+                if (model.getSelectedLayers().size() != 1) {
+                    setEnabled(false);
+                    return;
                 }
+                setEnabled(!isActiveLayer(model.getSelectedLayers().get(0)));
+            } else {
+                setEnabled(!isActiveLayer(layer));
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityAction.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityAction.java	(revision 10611)
@@ -20,6 +20,4 @@
 import javax.swing.JPopupMenu;
 import javax.swing.JSlider;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
 
 import org.openstreetmap.josm.Main;
@@ -69,10 +67,5 @@
 
         visibilityCheckbox = new JCheckBox(tr("Show layer"));
-        visibilityCheckbox.addChangeListener(new ChangeListener() {
-            @Override
-            public void stateChanged(ChangeEvent e) {
-                setVisibleFlag(visibilityCheckbox.isSelected());
-            }
-        });
+        visibilityCheckbox.addChangeListener(e -> setVisibleFlag(visibilityCheckbox.isSelected()));
         content.add(visibilityCheckbox, GBC.eop());
 
@@ -178,10 +171,5 @@
             setPaintTicks(true);
 
-            addChangeListener(new ChangeListener() {
-                @Override
-                public void stateChanged(ChangeEvent e) {
-                    onStateChanged();
-                }
-            });
+            addChangeListener(e -> onStateChanged());
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 10611)
@@ -14,6 +14,4 @@
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
 import java.io.IOException;
 import java.net.URI;
@@ -23,5 +21,4 @@
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.EnumSet;
 import java.util.HashMap;
@@ -319,14 +316,11 @@
         tagRowSorter.addRowSorterListener(removeHiddenSelection);
         tagRowSorter.setComparator(0, AlphanumComparator.getInstance());
-        tagRowSorter.setComparator(1, new Comparator<Object>() {
-            @Override
-            public int compare(Object o1, Object o2) {
-                if (o1 instanceof Map && o2 instanceof Map) {
-                    final String v1 = ((Map) o1).size() == 1 ? (String) ((Map) o1).keySet().iterator().next() : tr("<different>");
-                    final String v2 = ((Map) o2).size() == 1 ? (String) ((Map) o2).keySet().iterator().next() : tr("<different>");
-                    return AlphanumComparator.getInstance().compare(v1, v2);
-                } else {
-                    return AlphanumComparator.getInstance().compare(String.valueOf(o1), String.valueOf(o2));
-                }
+        tagRowSorter.setComparator(1, (o1, o2) -> {
+            if (o1 instanceof Map && o2 instanceof Map) {
+                final String v1 = ((Map) o1).size() == 1 ? (String) ((Map) o1).keySet().iterator().next() : tr("<different>");
+                final String v2 = ((Map) o2).size() == 1 ? (String) ((Map) o2).keySet().iterator().next() : tr("<different>");
+                return AlphanumComparator.getInstance().compare(v1, v2);
+            } else {
+                return AlphanumComparator.getInstance().compare(String.valueOf(o1), String.valueOf(o2));
             }
         });
@@ -545,10 +539,5 @@
         f.setToolTipText(tr("Tag filter"));
         final CompileSearchTextDecorator decorator = CompileSearchTextDecorator.decorate(f);
-        f.addPropertyChangeListener("filter", new PropertyChangeListener() {
-            @Override
-            public void propertyChange(PropertyChangeEvent evt) {
-                setFilter(decorator.getMatch());
-            }
-        });
+        f.addPropertyChangeListener("filter", evt -> setFilter(decorator.getMatch()));
         return f;
     }
@@ -713,10 +702,7 @@
 
         List<Relation> sortedRelations = new ArrayList<>(roles.keySet());
-        Collections.sort(sortedRelations, new Comparator<Relation>() {
-            @Override
-            public int compare(Relation o1, Relation o2) {
-                int comp = Boolean.compare(o1.isDisabledAndHidden(), o2.isDisabledAndHidden());
-                return comp != 0 ? comp : DefaultNameFormatter.getInstance().getRelationComparator().compare(o1, o2);
-            }
+        Collections.sort(sortedRelations, (o1, o2) -> {
+            int comp = Boolean.compare(o1.isDisabledAndHidden(), o2.isDisabledAndHidden());
+            return comp != 0 ? comp : DefaultNameFormatter.getInstance().getRelationComparator().compare(o1, o2);
         });
 
@@ -1175,44 +1161,42 @@
                 }
 
-                Main.worker.execute(new Runnable() {
-                    @Override public void run() {
-                        try {
-                            // find a page that actually exists in the wiki
-                            HttpClient.Response conn;
-                            for (URI u : uris) {
-                                conn = HttpClient.create(u.toURL(), "HEAD").connect();
-
-                                if (conn.getResponseCode() != 200) {
+                Main.worker.execute(() -> {
+                    try {
+                        // find a page that actually exists in the wiki
+                        HttpClient.Response conn;
+                        for (URI u : uris) {
+                            conn = HttpClient.create(u.toURL(), "HEAD").connect();
+
+                            if (conn.getResponseCode() != 200) {
+                                conn.disconnect();
+                            } else {
+                                long osize = conn.getContentLength();
+                                if (osize > -1) {
+                                    conn.disconnect();
+
+                                    final URI newURI = new URI(u.toString()
+                                            .replace("=", "%3D") /* do not URLencode whole string! */
+                                            .replaceFirst("/wiki/", "/w/index.php?redirect=no&title=")
+                                    );
+                                    conn = HttpClient.create(newURI.toURL(), "HEAD").connect();
+                                }
+
+                                /* redirect pages have different content length, but retrieving a "nonredirect"
+                                 *  page using index.php and the direct-link method gives slightly different
+                                 *  content lengths, so we have to be fuzzy.. (this is UGLY, recode if u know better)
+                                 */
+                                if (conn.getContentLength() != -1 && osize > -1 && Math.abs(conn.getContentLength() - osize) > 200) {
+                                    Main.info("{0} is a mediawiki redirect", u);
                                     conn.disconnect();
                                 } else {
-                                    long osize = conn.getContentLength();
-                                    if (osize > -1) {
-                                        conn.disconnect();
-
-                                        final URI newURI = new URI(u.toString()
-                                                .replace("=", "%3D") /* do not URLencode whole string! */
-                                                .replaceFirst("/wiki/", "/w/index.php?redirect=no&title=")
-                                        );
-                                        conn = HttpClient.create(newURI.toURL(), "HEAD").connect();
-                                    }
-
-                                    /* redirect pages have different content length, but retrieving a "nonredirect"
-                                     *  page using index.php and the direct-link method gives slightly different
-                                     *  content lengths, so we have to be fuzzy.. (this is UGLY, recode if u know better)
-                                     */
-                                    if (conn.getContentLength() != -1 && osize > -1 && Math.abs(conn.getContentLength() - osize) > 200) {
-                                        Main.info("{0} is a mediawiki redirect", u);
-                                        conn.disconnect();
-                                    } else {
-                                        conn.disconnect();
-
-                                        OpenBrowser.displayUrl(u.toString());
-                                        break;
-                                    }
+                                    conn.disconnect();
+
+                                    OpenBrowser.displayUrl(u.toString());
+                                    break;
                                 }
                             }
-                        } catch (URISyntaxException | IOException e) {
-                            Main.error(e);
                         }
+                    } catch (URISyntaxException | IOException e1) {
+                        Main.error(e1);
                     }
                 });
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(revision 10611)
@@ -17,5 +17,4 @@
 import java.awt.datatransfer.Transferable;
 import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.FocusAdapter;
 import java.awt.event.FocusEvent;
@@ -108,10 +107,6 @@
     private String objKey;
 
-    private final Comparator<AutoCompletionListItem> defaultACItemComparator = new Comparator<AutoCompletionListItem>() {
-        @Override
-        public int compare(AutoCompletionListItem o1, AutoCompletionListItem o2) {
-            return String.CASE_INSENSITIVE_ORDER.compare(o1.getValue(), o2.getValue());
-        }
-    };
+    private final Comparator<AutoCompletionListItem> defaultACItemComparator =
+            (o1, o2) -> String.CASE_INSENSITIVE_ORDER.compare(o1.getValue(), o2.getValue());
 
     private String lastAddKey;
@@ -365,18 +360,5 @@
         private final String key;
         private final transient Map<String, Integer> m;
-
-        private final transient Comparator<AutoCompletionListItem> usedValuesAwareComparator = new Comparator<AutoCompletionListItem>() {
-                @Override
-                public int compare(AutoCompletionListItem o1, AutoCompletionListItem o2) {
-                    boolean c1 = m.containsKey(o1.getValue());
-                    boolean c2 = m.containsKey(o2.getValue());
-                    if (c1 == c2)
-                        return String.CASE_INSENSITIVE_ORDER.compare(o1.getValue(), o2.getValue());
-                    else if (c1)
-                        return -1;
-                    else
-                        return +1;
-                }
-            };
+        private final transient Comparator<AutoCompletionListItem> usedValuesAwareComparator;
 
         private final transient ListCellRenderer<AutoCompletionListItem> cellRenderer = new ListCellRenderer<AutoCompletionListItem>() {
@@ -409,4 +391,15 @@
             this.m = map;
 
+            usedValuesAwareComparator = (o1, o2) -> {
+                boolean c1 = m.containsKey(o1.getValue());
+                boolean c2 = m.containsKey(o2.getValue());
+                if (c1 == c2)
+                    return String.CASE_INSENSITIVE_ORDER.compare(o1.getValue(), o2.getValue());
+                else if (c1)
+                    return -1;
+                else
+                    return +1;
+            };
+
             JPanel mainPanel = new JPanel(new BorderLayout());
 
@@ -450,10 +443,5 @@
             p.add(Box.createHorizontalStrut(10), GBC.std());
             p.add(values, GBC.eol().fill(GBC.HORIZONTAL));
-            values.getEditor().addActionListener(new ActionListener() {
-                @Override
-                public void actionPerformed(ActionEvent e) {
-                    buttonAction(0, null); // emulate OK button click
-                }
-            });
+            values.getEditor().addActionListener(e -> buttonAction(0, null));
             addFocusAdapter(autocomplete, usedValuesAwareComparator);
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java	(revision 10611)
@@ -420,10 +420,5 @@
                     refreshView(r);
                 }
-                SwingUtilities.invokeLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        Main.map.repaint();
-                    }
-                });
+                SwingUtilities.invokeLater(() -> Main.map.repaint());
             } catch (OsmTransferException e) {
                 if (canceled) {
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java	(revision 10611)
@@ -133,14 +133,8 @@
             }
 
-            SwingUtilities.invokeLater(
-                    new Runnable() {
-                        @Override
-                        public void run() {
-                            curLayer.mergeFrom(dataSet);
-                            curLayer.onPostDownloadFromServer();
-                        }
-                    }
-            );
-
+            SwingUtilities.invokeLater(() -> {
+                curLayer.mergeFrom(dataSet);
+                curLayer.onPostDownloadFromServer();
+            });
         } catch (OsmTransferException e) {
             if (canceled) {
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationTask.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationTask.java	(revision 10611)
@@ -98,14 +98,9 @@
             }
 
-            SwingUtilities.invokeAndWait(
-                    new Runnable() {
-                        @Override
-                        public void run() {
-                            layer.mergeFrom(allDownloads);
-                            layer.onPostDownloadFromServer();
-                            Main.map.repaint();
-                        }
-                    }
-            );
+            SwingUtilities.invokeAndWait(() -> {
+                layer.mergeFrom(allDownloads);
+                layer.onPostDownloadFromServer();
+                Main.map.repaint();
+            });
         } catch (OsmTransferException | InvocationTargetException | InterruptedException e) {
             if (canceled) {
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java	(revision 10611)
@@ -47,8 +47,4 @@
 import javax.swing.JToolBar;
 import javax.swing.KeyStroke;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
 
 import org.openstreetmap.josm.Main;
@@ -232,17 +228,12 @@
         tabbedPane.add(tr("Parent Relations"), referrerBrowser);
         tabbedPane.add(tr("Child Relations"), new ChildRelationBrowser(getLayer(), relation));
-        tabbedPane.addChangeListener(
-                new ChangeListener() {
-                    @Override
-                    public void stateChanged(ChangeEvent e) {
-                        JTabbedPane sourceTabbedPane = (JTabbedPane) e.getSource();
-                        int index = sourceTabbedPane.getSelectedIndex();
-                        String title = sourceTabbedPane.getTitleAt(index);
-                        if (title.equals(tr("Parent Relations"))) {
-                            referrerBrowser.init();
-                        }
-                    }
-                }
-        );
+        tabbedPane.addChangeListener(e -> {
+            JTabbedPane sourceTabbedPane = (JTabbedPane) e.getSource();
+            int index = sourceTabbedPane.getSelectedIndex();
+            String title = sourceTabbedPane.getTitleAt(index);
+            if (title.equals(tr("Parent Relations"))) {
+                referrerBrowser.init();
+            }
+        });
 
         refreshAction = new RefreshAction(memberTable, memberTableModel, tagEditorPanel.getModel(), getLayer(), this);
@@ -487,10 +478,5 @@
         tfRole.addActionListener(setRoleAction);
         memberTableModel.getSelectionModel().addListSelectionListener(
-                new ListSelectionListener() {
-                    @Override
-                    public void valueChanged(ListSelectionEvent e) {
-                        tfRole.setEnabled(memberTable.getSelectedRowCount() > 0);
-                    }
-                }
+                e -> tfRole.setEnabled(memberTable.getSelectedRowCount() > 0)
         );
         tfRole.setEnabled(memberTable.getSelectedRowCount() > 0);
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java	(revision 10611)
@@ -105,24 +105,18 @@
     }
 
-    private transient ListSelectionListener highlighterListener = new ListSelectionListener() {
-        @Override
-        public void valueChanged(ListSelectionEvent lse) {
-            if (Main.isDisplayingMapView()) {
-                Collection<RelationMember> sel = getMemberTableModel().getSelectedMembers();
-                final List<OsmPrimitive> toHighlight = new ArrayList<>();
-                for (RelationMember r: sel) {
-                    if (r.getMember().isUsable()) {
-                        toHighlight.add(r.getMember());
-                    }
+    private transient ListSelectionListener highlighterListener = lse -> {
+        if (Main.isDisplayingMapView()) {
+            Collection<RelationMember> sel = getMemberTableModel().getSelectedMembers();
+            final List<OsmPrimitive> toHighlight = new ArrayList<>();
+            for (RelationMember r: sel) {
+                if (r.getMember().isUsable()) {
+                    toHighlight.add(r.getMember());
                 }
-                SwingUtilities.invokeLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        if (Main.isDisplayingMapView() && highlightHelper.highlightOnly(toHighlight)) {
-                            Main.map.mapView.repaint();
-                        }
-                    }
-                });
-            }
+            }
+            SwingUtilities.invokeLater(() -> {
+                if (Main.isDisplayingMapView() && highlightHelper.highlightOnly(toHighlight)) {
+                    Main.map.mapView.repaint();
+                }
+            });
         }
     };
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java	(revision 10611)
@@ -122,10 +122,5 @@
         // just trigger a repaint - the display name of the relation members may have changed
         Collection<RelationMember> sel = getSelectedMembers();
-        GuiHelper.runInEDT(new Runnable() {
-            @Override
-            public void run() {
-                fireTableDataChanged();
-            }
-        });
+        GuiHelper.runInEDT(() -> fireTableDataChanged());
         setSelectedMembers(sel);
     }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java	(revision 10611)
@@ -165,15 +165,7 @@
                 // copy the merged layer's data source info
                 getLayer().data.dataSources.addAll(referrers.dataSources);
-                // FIXME: this is necessary because there are  dialogs listening
+                // FIXME: this is necessary because there are dialogs listening
                 // for DataChangeEvents which manipulate Swing components on this thread.
-                //
-                SwingUtilities.invokeLater(
-                        new Runnable() {
-                            @Override
-                            public void run() {
-                                getLayer().onPostDownloadFromServer();
-                            }
-                        }
-                );
+                SwingUtilities.invokeLater(() -> getLayer().onPostDownloadFromServer());
 
                 if (visitor.getConflicts().isEmpty())
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java	(revision 10611)
@@ -110,14 +110,9 @@
                     new PleaseWaitProgressMonitor(tr("Loading parent relations"))
             );
-            task.setContinuation(
-                    new Runnable() {
-                        @Override
-                        public void run() {
-                            if (task.isCanceled() || task.hasError())
-                                return;
-                            model.populate(task.getParents());
-                        }
-                    }
-            );
+            task.setContinuation(() -> {
+                    if (task.isCanceled() || task.hasError())
+                        return;
+                    model.populate(task.getParents());
+                });
             Main.worker.submit(task);
         }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java	(revision 10611)
@@ -141,12 +141,5 @@
             }
             final RelationTreeModel model = (RelationTreeModel) getModel();
-            SwingUtilities.invokeLater(
-                    new Runnable() {
-                        @Override
-                        public void run() {
-                            model.refreshNode(path);
-                        }
-                    }
-            );
+            SwingUtilities.invokeLater(() -> model.refreshNode(path));
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java	(revision 10611)
@@ -21,7 +21,7 @@
 import org.openstreetmap.josm.gui.HelpAwareOptionPane;
 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
+import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor;
 import org.openstreetmap.josm.gui.dialogs.relation.MemberTable;
 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel;
-import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor;
 import org.openstreetmap.josm.gui.dialogs.relation.RelationDialogManager;
 import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor;
@@ -81,11 +81,6 @@
                     layer, editor.getRelation(), (RelationEditor) editor);
         }
-        SwingUtilities.invokeLater(new Runnable() {
-            @Override
-            public void run() {
-                // Relation list gets update in EDT so selecting my be postponed to following EDT run
-                Main.map.relationListDialog.selectRelation(newRelation);
-            }
-        });
+        // Relation list gets update in EDT so selecting my be postponed to following EDT run
+        SwingUtilities.invokeLater(() -> Main.map.relationListDialog.selectRelation(newRelation));
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorter.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorter.java	(revision 10611)
@@ -5,5 +5,4 @@
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
@@ -66,17 +65,14 @@
         @Override
         public List<RelationMember> sortMembers(List<RelationMember> list) {
-            Collections.sort(list, new Comparator<RelationMember>() {
-                @Override
-                public int compare(RelationMember a, RelationMember b) {
-                    final int houseNumber = AlphanumComparator.getInstance().compare(
-                            a.getMember().get("addr:housenumber"),
-                            b.getMember().get("addr:housenumber"));
-                    if (houseNumber != 0) {
-                        return houseNumber;
-                    }
-                    final String aDisplayName = a.getMember().getDisplayName(DefaultNameFormatter.getInstance());
-                    final String bDisplayName = b.getMember().getDisplayName(DefaultNameFormatter.getInstance());
-                    return AlphanumComparator.getInstance().compare(aDisplayName, bDisplayName);
-                }
+            Collections.sort(list, (a, b) -> {
+                final int houseNumber = AlphanumComparator.getInstance().compare(
+                        a.getMember().get("addr:housenumber"),
+                        b.getMember().get("addr:housenumber"));
+                if (houseNumber != 0) {
+                    return houseNumber;
+                }
+                final String aDisplayName = a.getMember().getDisplayName(DefaultNameFormatter.getInstance());
+                final String bDisplayName = b.getMember().getDisplayName(DefaultNameFormatter.getInstance());
+                return AlphanumComparator.getInstance().compare(aDisplayName, bDisplayName);
             });
             return list;
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java	(revision 10611)
@@ -147,10 +147,5 @@
 
         if (errors == null || errors.isEmpty()) {
-            GuiHelper.runInEDTAndWait(new Runnable() {
-                @Override
-                public void run() {
-                    valTreeModel.setRoot(rootNode);
-                }
-            });
+            GuiHelper.runInEDTAndWait(() -> valTreeModel.setRoot(rootNode));
             return;
         }
Index: trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java	(revision 10611)
@@ -110,11 +110,8 @@
 
         bookmarks = new BookmarkList();
-        bookmarks.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
-            @Override
-            public void valueChanged(ListSelectionEvent e) {
-                Bookmark b = bookmarks.getSelectedValue();
-                if (b != null && gui != null) {
-                    gui.boundingBoxChanged(b.getArea(), BookmarkSelection.this);
-                }
+        bookmarks.getSelectionModel().addListSelectionListener(e -> {
+            Bookmark b = bookmarks.getSelectedValue();
+            if (b != null && gui != null) {
+                gui.boundingBoxChanged(b.getArea(), BookmarkSelection.this);
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java	(revision 10611)
@@ -14,5 +14,4 @@
 import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
@@ -32,5 +31,4 @@
 import javax.swing.JTabbedPane;
 import javax.swing.KeyStroke;
-import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
@@ -94,11 +92,6 @@
         JPanel pnl = new JPanel(new GridBagLayout());
 
-        final ChangeListener checkboxChangeListener = new ChangeListener() {
-            @Override
-            public void stateChanged(ChangeEvent e) {
-                // size check depends on selected data source
-                updateSizeCheck();
-            }
-        };
+        // size check depends on selected data source
+        final ChangeListener checkboxChangeListener = e -> updateSizeCheck();
 
         // adding the download tasks
@@ -159,10 +152,5 @@
                 tr("<html>Autostart ''Download from OSM'' dialog every time JOSM is started.<br>" +
                         "You can open it manually from File menu or toolbar.</html>"));
-        cbStartup.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                 Main.pref.put("download.autorun", cbStartup.isSelected());
-            }
-        });
+        cbStartup.addActionListener(e -> Main.pref.put("download.autorun", cbStartup.isSelected()));
 
         pnl.add(cbNewLayer, GBC.std().anchor(GBC.WEST).insets(5, 5, 5, 5));
Index: trunk/src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java	(revision 10611)
@@ -5,6 +5,4 @@
 
 import java.awt.Component;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 import java.awt.event.WindowEvent;
 import java.util.Arrays;
@@ -70,12 +68,7 @@
         fullRel.setSelected(Main.pref.getBoolean("downloadprimitive.full", true));
 
-        cbType.addItemListener(new ItemListener() {
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                referrers.setText(cbType.getType() == OsmPrimitiveType.NODE
-                        ? tr("Download referrers (parent relations and ways)")
-                        : tr("Download referrers (parent relations)"));
-            }
-        });
+        cbType.addItemListener(e -> referrers.setText(cbType.getType() == OsmPrimitiveType.NODE
+                ? tr("Download referrers (parent relations and ways)")
+                : tr("Download referrers (parent relations)")));
 
         return Arrays.<Component>asList(referrers, fullRel, newLayer);
Index: trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java	(revision 10611)
@@ -384,16 +384,11 @@
                 if (!canceled) {
                     // Nominatim sometimes returns garbage, see #5934, #10643
-                    Main.warn(tr("Error occured with query ''{0}'': ''{1}''", urlString, e.getMessage()));
-                    GuiHelper.runInEDTAndWait(new Runnable() {
-                        @Override
-                        public void run() {
-                            HelpAwareOptionPane.showOptionDialog(
-                                    Main.parent,
-                                    tr("Name server returned invalid data. Please try again."),
-                                    tr("Bad response"),
-                                    JOptionPane.WARNING_MESSAGE, null
-                            );
-                        }
-                    });
+                    Main.warn(e, tr("Error occured with query ''{0}'': ''{1}''", urlString, e.getMessage()));
+                    GuiHelper.runInEDTAndWait(() -> HelpAwareOptionPane.showOptionDialog(
+                            Main.parent,
+                            tr("Name server returned invalid data. Please try again."),
+                            tr("Bad response"),
+                            JOptionPane.WARNING_MESSAGE, null
+                    ));
                 }
             } catch (IOException | ParserConfigurationException e) {
Index: trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java	(revision 10611)
@@ -114,13 +114,9 @@
     public static void setUrlForHelpTopic(final String helpTopic) {
         final HelpBrowser browser = getInstance();
-        Runnable r = new Runnable() {
-            @Override
-            public void run() {
-                browser.openHelpTopic(helpTopic);
-                browser.setVisible(true);
-                browser.toFront();
-            }
-        };
-        SwingUtilities.invokeLater(r);
+        SwingUtilities.invokeLater(() -> {
+            browser.openHelpTopic(helpTopic);
+            browser.setVisible(true);
+            browser.toFront();
+        });
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java	(revision 10611)
@@ -11,6 +11,4 @@
 import javax.swing.JSplitPane;
 import javax.swing.JTabbedPane;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
 
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -80,11 +78,8 @@
         pnl.add(tpViewers, BorderLayout.CENTER);
 
-        tpViewers.addChangeListener(new ChangeListener() {
-            @Override
-            public void stateChanged(ChangeEvent e) {
-                if (tpViewers.getSelectedComponent() == coordinateInfoViewer) {
-                    // while building the component size is not yet known, thus panning does not give reasonable results
-                    coordinateInfoViewer.setDisplayToFitMapMarkers();
-                }
+        tpViewers.addChangeListener(e -> {
+            if (tpViewers.getSelectedComponent() == coordinateInfoViewer) {
+                // while building the component size is not yet known, thus panning does not give reasonable results
+                coordinateInfoViewer.setDisplayToFitMapMarkers();
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java	(revision 10611)
@@ -196,24 +196,15 @@
         }
 
-        Runnable r = new Runnable() {
-
-            @Override
-            public void run() {
-                try {
-                    for (PrimitiveId p : notNewPrimitives) {
-                        final History h = HistoryDataSet.getInstance().getHistory(p);
-                        if (h == null) {
-                            continue;
-                        }
-                        SwingUtilities.invokeLater(new Runnable() {
-                            @Override
-                            public void run() {
-                                show(h);
-                            }
-                        });
+        Runnable r = () -> {
+            try {
+                for (PrimitiveId p : notNewPrimitives) {
+                    final History h = HistoryDataSet.getInstance().getHistory(p);
+                    if (h == null) {
+                        continue;
                     }
-                } catch (final RuntimeException e) {
-                    BugReportExceptionHandler.handleException(e);
+                    SwingUtilities.invokeLater(() -> show(h));
                 }
+            } catch (final RuntimeException e) {
+                BugReportExceptionHandler.handleException(e);
             }
         };
@@ -237,10 +228,4 @@
     };
 
-    private final Predicate<PrimitiveId> notNewPredicate = new Predicate<PrimitiveId>() {
-
-        @Override
-        public boolean evaluate(PrimitiveId p) {
-            return !p.isNew();
-        }
-    };
+    private final Predicate<PrimitiveId> notNewPredicate = p -> !p.isNew();
 }
Index: trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java	(revision 10611)
@@ -298,18 +298,10 @@
                 Main.worker.submit(new HistoryLoadTask().add(primitiveId));
             }
-            Runnable r = new Runnable() {
-                @Override
-                public void run() {
-                    final History h = HistoryDataSet.getInstance().getHistory(primitiveId);
-                    if (h == null)
-                        return;
-                    GuiHelper.runInEDT(new Runnable() {
-                        @Override public void run() {
-                            HistoryBrowserDialogManager.getInstance().show(h);
-                        }
-                    });
-                }
-            };
-            Main.worker.submit(r);
+            Main.worker.submit(() -> {
+                final History h = HistoryDataSet.getInstance().getHistory(primitiveId);
+                if (h == null)
+                    return;
+                GuiHelper.runInEDT(() -> HistoryBrowserDialogManager.getInstance().show(h));
+            });
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java	(revision 10611)
@@ -25,6 +25,4 @@
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
 import javax.swing.table.TableCellRenderer;
 
@@ -93,13 +91,10 @@
             }
         });
-        getModel().addTableModelListener(new TableModelListener() {
-            @Override
-            public void tableChanged(TableModelEvent e) {
-                adjustColumnWidth(VersionTable.this, 0, 0);
-                adjustColumnWidth(VersionTable.this, 1, -8);
-                adjustColumnWidth(VersionTable.this, 2, -8);
-                adjustColumnWidth(VersionTable.this, 3, 0);
-                adjustColumnWidth(VersionTable.this, 4, 0);
-            }
+        getModel().addTableModelListener(e -> {
+            adjustColumnWidth(VersionTable.this, 0, 0);
+            adjustColumnWidth(VersionTable.this, 1, -8);
+            adjustColumnWidth(VersionTable.this, 2, -8);
+            adjustColumnWidth(VersionTable.this, 3, 0);
+            adjustColumnWidth(VersionTable.this, 4, 0);
         });
     }
Index: trunk/src/org/openstreetmap/josm/gui/io/AbstractPrimitiveTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/AbstractPrimitiveTask.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/io/AbstractPrimitiveTask.java	(revision 10611)
@@ -184,12 +184,9 @@
             return;
         }
-        GuiHelper.runInEDTAndWait(new Runnable() {
-            @Override
-            public void run() {
-                layer.mergeFrom(ds);
-                if (zoom && Main.map != null)
-                    AutoScaleAction.zoomTo(ds.allPrimitives());
-                layer.onPostDownloadFromServer();
-            }
+        GuiHelper.runInEDTAndWait(() -> {
+            layer.mergeFrom(ds);
+            if (zoom && Main.map != null)
+                AutoScaleAction.zoomTo(ds.allPrimitives());
+            layer.onPostDownloadFromServer();
         });
     }
Index: trunk/src/org/openstreetmap/josm/gui/io/ActionFlagsTableCell.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/ActionFlagsTableCell.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/io/ActionFlagsTableCell.java	(revision 10611)
@@ -40,10 +40,5 @@
     private final transient CellEditorSupport cellEditorSupport = new CellEditorSupport(this);
 
-    private final transient ActionListener al = new ActionListener() {
-        @Override
-        public void actionPerformed(ActionEvent e) {
-            cellEditorSupport.fireEditingStopped();
-        }
-    };
+    private final transient ActionListener al = e -> cellEditorSupport.fireEditingStopped();
 
     /**
Index: trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java	(revision 10611)
@@ -24,5 +24,4 @@
 import javax.swing.event.ChangeListener;
 import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkListener;
 
 import org.openstreetmap.josm.Main;
@@ -70,13 +69,10 @@
         JEditorPane sourceLabel = new JMultilineLabel("<html><b>" + tr("Specify the data source for the changes")
                 + "</b> (<a href=\"urn:changeset-source\">" + tr("obtain from current layers") + "</a>)<b>:</b>");
-        sourceLabel.addHyperlinkListener(new HyperlinkListener() {
-            @Override
-            public void hyperlinkUpdate(HyperlinkEvent e) {
-                if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType())) {
-                    final String source = Main.map.mapView.getLayerInformationForSourceTag();
-                    hcbUploadSource.setText(Utils.shortenString(source, Changeset.MAX_CHANGESET_TAG_LENGTH));
-                    // Fix #9965
-                    changesetSourceModel.setComment(hcbUploadSource.getText());
-                }
+        sourceLabel.addHyperlinkListener(e -> {
+            if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType())) {
+                final String source = Main.map.mapView.getLayerInformationForSourceTag();
+                hcbUploadSource.setText(Utils.shortenString(source, Changeset.MAX_CHANGESET_TAG_LENGTH));
+                // Fix #9965
+                changesetSourceModel.setComment(hcbUploadSource.getText());
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/io/CloseChangesetTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/CloseChangesetTask.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/io/CloseChangesetTask.java	(revision 10611)
@@ -58,12 +58,5 @@
             ExceptionDialogUtil.explainException(lastException);
         }
-        SwingUtilities.invokeLater(
-                new Runnable() {
-                    @Override
-                    public void run() {
-                        ChangesetCache.getInstance().update(closedChangesets);
-                    }
-                }
-        );
+        SwingUtilities.invokeLater(() -> ChangesetCache.getInstance().update(closedChangesets));
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java	(revision 10611)
@@ -85,17 +85,9 @@
             return;
         }
-        SwingUtilities.invokeLater(
-                new Runnable() {
-                    @Override public void run() {
-                        ChangesetCache.getInstance().update(changesets);
-                    }
-                }
-        );
+        SwingUtilities.invokeLater(() -> ChangesetCache.getInstance().update(changesets));
     }
 
     /**
-     * Refreshes the user info from the server. This is necessary if we don't know
-     * the users id yet.
-     *
+     * Refreshes the user info from the server. This is necessary if we don't know the users id yet.
      */
     protected void refreshUserIdentity() {
Index: trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java	(revision 10611)
@@ -138,20 +138,15 @@
         final Set<PrimitiveId> errs = mainTask.getMissingPrimitives();
         if (errs != null && !errs.isEmpty())
-            GuiHelper.runInEDTAndWait(new Runnable() {
-                @Override
-                public void run() {
-                    reportProblemDialog(errs,
-                            trn("Object could not be downloaded", "Some objects could not be downloaded", errs.size()),
-                            trn("One object could not be downloaded.<br>",
-                                    "{0} objects could not be downloaded.<br>",
-                                    errs.size(),
-                                    errs.size())
-                                    + tr("The server replied with response code 404.<br>"
-                                         + "This usually means, the server does not know an object with the requested id."),
-                            tr("missing objects:"),
-                            JOptionPane.ERROR_MESSAGE
-                            ).showDialog();
-                }
-            });
+            GuiHelper.runInEDTAndWait(() -> reportProblemDialog(errs,
+                    trn("Object could not be downloaded", "Some objects could not be downloaded", errs.size()),
+                    trn("One object could not be downloaded.<br>",
+                            "{0} objects could not be downloaded.<br>",
+                            errs.size(),
+                            errs.size())
+                            + tr("The server replied with response code 404.<br>"
+                                 + "This usually means, the server does not know an object with the requested id."),
+                    tr("missing objects:"),
+                    JOptionPane.ERROR_MESSAGE
+                    ).showDialog());
 
         // Warm about deleted primitives
@@ -165,19 +160,14 @@
         }
         if (!del.isEmpty())
-            GuiHelper.runInEDTAndWait(new Runnable() {
-                @Override
-                public void run() {
-                    reportProblemDialog(del,
-                            trn("Object deleted", "Objects deleted", del.size()),
-                            trn(
-                                "One downloaded object is deleted.",
-                                "{0} downloaded objects are deleted.",
-                                del.size(),
-                                del.size()),
-                            null,
-                            JOptionPane.WARNING_MESSAGE
-                    ).showDialog();
-                }
-            });
+            GuiHelper.runInEDTAndWait(() -> reportProblemDialog(del,
+                    trn("Object deleted", "Objects deleted", del.size()),
+                    trn(
+                        "One downloaded object is deleted.",
+                        "{0} downloaded objects are deleted.",
+                        del.size(),
+                        del.size()),
+                    null,
+                    JOptionPane.WARNING_MESSAGE
+            ).showDialog());
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java	(revision 10611)
@@ -579,28 +579,25 @@
         @Override
         public void run() {
-            GuiHelper.runInEDTAndWait(new Runnable() {
-                @Override
-                public void run() {
-                    model.setMode(SaveLayersModel.Mode.UPLOADING_AND_SAVING);
-                    List<SaveLayerInfo> toUpload = model.getLayersToUpload();
-                    if (!toUpload.isEmpty()) {
-                        uploadLayers(toUpload);
-                    }
-                    List<SaveLayerInfo> toSave = model.getLayersToSave();
-                    if (!toSave.isEmpty()) {
-                        saveLayers(toSave);
-                    }
-                    model.setMode(SaveLayersModel.Mode.EDITING_DATA);
-                    if (model.hasUnsavedData()) {
-                        warnBecauseOfUnsavedData();
-                        model.setMode(Mode.EDITING_DATA);
-                        if (canceled) {
-                            setUserAction(UserAction.CANCEL);
-                            closeDialog();
-                        }
-                    } else {
-                        setUserAction(UserAction.PROCEED);
+            GuiHelper.runInEDTAndWait(() -> {
+                model.setMode(SaveLayersModel.Mode.UPLOADING_AND_SAVING);
+                List<SaveLayerInfo> toUpload = model.getLayersToUpload();
+                if (!toUpload.isEmpty()) {
+                    uploadLayers(toUpload);
+                }
+                List<SaveLayerInfo> toSave = model.getLayersToSave();
+                if (!toSave.isEmpty()) {
+                    saveLayers(toSave);
+                }
+                model.setMode(SaveLayersModel.Mode.EDITING_DATA);
+                if (model.hasUnsavedData()) {
+                    warnBecauseOfUnsavedData();
+                    model.setMode(Mode.EDITING_DATA);
+                    if (canceled) {
+                        setUserAction(UserAction.CANCEL);
                         closeDialog();
                     }
+                } else {
+                    setUserAction(UserAction.PROCEED);
+                    closeDialog();
                 }
             });
Index: trunk/src/org/openstreetmap/josm/gui/io/SaveLayersModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/SaveLayersModel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/io/SaveLayersModel.java	(revision 10611)
@@ -7,5 +7,4 @@
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
 
@@ -72,13 +71,5 @@
             layerInfo.add(new SaveLayerInfo(layer));
         }
-        Collections.sort(
-                layerInfo,
-                new Comparator<SaveLayerInfo>() {
-                    @Override
-                    public int compare(SaveLayerInfo o1, SaveLayerInfo o2) {
-                        return o1.compareTo(o2);
-                    }
-                }
-        );
+        Collections.sort(layerInfo, (o1, o2) -> o1.compareTo(o2));
         fireTableDataChanged();
     }
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java	(revision 10611)
@@ -219,12 +219,8 @@
         // we always clean up the data, even in case of errors. It's possible the data was
         // partially uploaded. Better run on EDT.
-        //
-        Runnable r = new Runnable() {
-            @Override
-            public void run() {
-                layer.cleanupAfterUpload(processedPrimitives);
-                layer.onPostUploadToServer();
-                ChangesetCache.getInstance().update(changeset);
-            }
+        Runnable r = () -> {
+            layer.cleanupAfterUpload(processedPrimitives);
+            layer.onPostUploadToServer();
+            ChangesetCache.getInstance().update(changeset);
         };
 
@@ -320,51 +316,46 @@
         // - to the Upload Dialog
         // - to map editing
-        GuiHelper.runInEDT(new Runnable() {
-            @Override
-            public void run() {
-                // if the changeset is still open after this upload we want it to
-                // be selected on the next upload
-                //
-                ChangesetCache.getInstance().update(changeset);
-                if (changeset != null && changeset.isOpen()) {
-                    UploadDialog.getUploadDialog().setSelectedChangesetForNextUpload(changeset);
-                }
-                if (uploadCanceled) return;
-                if (lastException == null) {
-                    new Notification(
-                            "<h3>" + tr("Upload successful!") + "</h3>")
-                            .setIcon(ImageProvider.get("misc", "check_large"))
-                            .show();
+        GuiHelper.runInEDT(() -> {
+            // if the changeset is still open after this upload we want it to be selected on the next upload
+            ChangesetCache.getInstance().update(changeset);
+            if (changeset != null && changeset.isOpen()) {
+                UploadDialog.getUploadDialog().setSelectedChangesetForNextUpload(changeset);
+            }
+            if (uploadCanceled) return;
+            if (lastException == null) {
+                new Notification(
+                        "<h3>" + tr("Upload successful!") + "</h3>")
+                        .setIcon(ImageProvider.get("misc", "check_large"))
+                        .show();
+                return;
+            }
+            if (lastException instanceof ChangesetClosedException) {
+                ChangesetClosedException e = (ChangesetClosedException) lastException;
+                if (e.getSource().equals(ChangesetClosedException.Source.UPDATE_CHANGESET)) {
+                    handleFailedUpload(lastException);
                     return;
                 }
-                if (lastException instanceof ChangesetClosedException) {
-                    ChangesetClosedException e = (ChangesetClosedException) lastException;
-                    if (e.getSource().equals(ChangesetClosedException.Source.UPDATE_CHANGESET)) {
-                        handleFailedUpload(lastException);
-                        return;
-                    }
-                    if (strategy.getPolicy() == null)
-                        /* do nothing if unknown policy */
-                        return;
-                    if (e.getSource().equals(ChangesetClosedException.Source.UPLOAD_DATA)) {
-                        switch(strategy.getPolicy()) {
-                        case ABORT:
-                            break; /* do nothing - we return to map editing */
-                        case AUTOMATICALLY_OPEN_NEW_CHANGESETS:
-                            break; /* do nothing - we return to map editing */
-                        case FILL_ONE_CHANGESET_AND_RETURN_TO_UPLOAD_DIALOG:
-                            // return to the upload dialog
-                            //
-                            toUpload.removeProcessed(processedPrimitives);
-                            UploadDialog.getUploadDialog().setUploadedPrimitives(toUpload);
-                            UploadDialog.getUploadDialog().setVisible(true);
-                            break;
-                        }
-                    } else {
-                        handleFailedUpload(lastException);
+                if (strategy.getPolicy() == null)
+                    /* do nothing if unknown policy */
+                    return;
+                if (e.getSource().equals(ChangesetClosedException.Source.UPLOAD_DATA)) {
+                    switch(strategy.getPolicy()) {
+                    case ABORT:
+                        break; /* do nothing - we return to map editing */
+                    case AUTOMATICALLY_OPEN_NEW_CHANGESETS:
+                        break; /* do nothing - we return to map editing */
+                    case FILL_ONE_CHANGESET_AND_RETURN_TO_UPLOAD_DIALOG:
+                        // return to the upload dialog
+                        //
+                        toUpload.removeProcessed(processedPrimitives);
+                        UploadDialog.getUploadDialog().setUploadedPrimitives(toUpload);
+                        UploadDialog.getUploadDialog().setVisible(true);
+                        break;
                     }
                 } else {
                     handleFailedUpload(lastException);
                 }
+            } else {
+                handleFailedUpload(lastException);
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 10611)
@@ -1880,10 +1880,6 @@
             double bufferX, double bufferY) {
         PrecacheTask precacheTask = new PrecacheTask(progressMonitor);
-        final Set<Tile> requestedTiles = new ConcurrentSkipListSet<>(new Comparator<Tile>() {
-            @Override
-            public int compare(Tile o1, Tile o2) {
-                return String.CASE_INSENSITIVE_ORDER.compare(o1.getKey(), o2.getKey());
-            }
-        });
+        final Set<Tile> requestedTiles = new ConcurrentSkipListSet<>(
+                (o1, o2) -> String.CASE_INSENSITIVE_ORDER.compare(o1.getKey(), o2.getKey()));
         for (LatLon point: points) {
 
Index: trunk/src/org/openstreetmap/josm/gui/layer/AlignImageryPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/AlignImageryPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/AlignImageryPanel.java	(revision 10611)
@@ -7,6 +7,4 @@
 import java.awt.Font;
 import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 
 import javax.swing.JButton;
@@ -55,12 +53,9 @@
         closeButton.setBorderPainted(false);
         closeButton.setToolTipText(tr("Hide this message and never show it again"));
-        closeButton.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if (Main.isDisplayingMapView()) {
-                    Main.map.removeTopPanel(AlignImageryPanel.class);
-                    if (doNotShowAgain.isSelected()) {
-                        showAgain.put(Boolean.FALSE);
-                    }
+        closeButton.addActionListener(e -> {
+            if (Main.isDisplayingMapView()) {
+                Main.map.removeTopPanel(AlignImageryPanel.class);
+                if (doNotShowAgain.isSelected()) {
+                    showAgain.put(Boolean.FALSE);
                 }
             }
Index: trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java	(revision 10611)
@@ -183,10 +183,5 @@
         final JScrollPane sp = new JScrollPane(new HtmlPanel(info.toString()));
         sp.setPreferredSize(new Dimension(sp.getPreferredSize().width+20, 370));
-        SwingUtilities.invokeLater(new Runnable() {
-            @Override
-            public void run() {
-                sp.getVerticalScrollBar().setValue(0);
-            }
-        });
+        SwingUtilities.invokeLater(() -> sp.getVerticalScrollBar().setValue(0));
         return sp;
     }
Index: trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java	(revision 10611)
@@ -301,10 +301,5 @@
      */
     public static ImageProcessor createImageProcessor(final BufferedImageOp op, final boolean inPlace) {
-        return new ImageProcessor() {
-            @Override
-            public BufferedImage process(BufferedImage image) {
-                return op.filter(image, inPlace ? image : null);
-            }
-        };
+        return image -> op.filter(image, inPlace ? image : null);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/layer/Layer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/Layer.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/Layer.java	(revision 10611)
@@ -516,13 +516,8 @@
 
             // run later to not block loading the UI.
-            SwingUtilities.invokeLater(new Runnable() {
-                @Override
-                public void run() {
-                    JOptionPane.showMessageDialog(Main.parent,
-                            message,
-                            tr("Warning"),
-                            JOptionPane.WARNING_MESSAGE);
-                }
-            });
+            SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog(Main.parent,
+                    message,
+                    tr("Warning"),
+                    JOptionPane.WARNING_MESSAGE));
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/layer/LayerManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/LayerManager.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/LayerManager.java	(revision 10611)
@@ -178,10 +178,5 @@
         // we force this on to the EDT Thread to make events fire from there.
         // The synchronization lock needs to be held by the EDT.
-        GuiHelper.runInEDTAndWaitWithException(new Runnable() {
-            @Override
-            public void run() {
-                realAddLayer(layer);
-            }
-        });
+        GuiHelper.runInEDTAndWaitWithException(() -> realAddLayer(layer));
     }
 
@@ -208,10 +203,5 @@
         // we force this on to the EDT Thread to make events fire from there.
         // The synchronization lock needs to be held by the EDT.
-        GuiHelper.runInEDTAndWaitWithException(new Runnable() {
-            @Override
-            public void run() {
-                realRemoveLayer(layer);
-            }
-        });
+        GuiHelper.runInEDTAndWaitWithException(() -> realRemoveLayer(layer));
     }
 
@@ -247,10 +237,5 @@
         // we force this on to the EDT Thread to make events fire from there.
         // The synchronization lock needs to be held by the EDT.
-        GuiHelper.runInEDTAndWaitWithException(new Runnable() {
-            @Override
-            public void run() {
-                realMoveLayer(layer, position);
-            }
-        });
+        GuiHelper.runInEDTAndWaitWithException(() -> realMoveLayer(layer, position));
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java	(revision 10611)
@@ -228,10 +228,5 @@
         // we force this on to the EDT Thread to make events fire from there.
         // The synchronization lock needs to be held by the EDT.
-        GuiHelper.runInEDTAndWaitWithException(new Runnable() {
-            @Override
-            public void run() {
-                realSetActiveLayer(layer);
-            }
-        });
+        GuiHelper.runInEDTAndWaitWithException(() -> realSetActiveLayer(layer));
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 10611)
@@ -30,5 +30,4 @@
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.Callable;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.regex.Pattern;
@@ -994,19 +993,16 @@
     @Override
     public boolean checkSaveConditions() {
-        if (isDataSetEmpty() && 1 != GuiHelper.runInEDTAndWaitAndReturn(new Callable<Integer>() {
-            @Override
-            public Integer call() {
-                if (GraphicsEnvironment.isHeadless()) {
-                    return 2;
-                }
-                ExtendedDialog dialog = new ExtendedDialog(
-                        Main.parent,
-                        tr("Empty document"),
-                        new String[] {tr("Save anyway"), tr("Cancel")}
-                );
-                dialog.setContent(tr("The document contains no data."));
-                dialog.setButtonIcons(new String[] {"save", "cancel"});
-                return dialog.showDialog().getValue();
-            }
+        if (isDataSetEmpty() && 1 != GuiHelper.runInEDTAndWaitAndReturn(() -> {
+            if (GraphicsEnvironment.isHeadless()) {
+                return 2;
+            }
+            ExtendedDialog dialog = new ExtendedDialog(
+                    Main.parent,
+                    tr("Empty document"),
+                    new String[] {tr("Save anyway"), tr("Cancel")}
+            );
+            dialog.setContent(tr("The document contains no data."));
+            dialog.setButtonIcons(new String[] {"save", "cancel"});
+            return dialog.showDialog().getValue();
         })) {
             return false;
@@ -1014,18 +1010,15 @@
 
         ConflictCollection conflictsCol = getConflicts();
-        if (conflictsCol != null && !conflictsCol.isEmpty() && 1 != GuiHelper.runInEDTAndWaitAndReturn(new Callable<Integer>() {
-            @Override
-            public Integer call() {
-                ExtendedDialog dialog = new ExtendedDialog(
-                        Main.parent,
-                        /* I18N: Display title of the window showing conflicts */
-                        tr("Conflicts"),
-                        new String[] {tr("Reject Conflicts and Save"), tr("Cancel")}
-                );
-                dialog.setContent(
-                        tr("There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?"));
-                dialog.setButtonIcons(new String[] {"save", "cancel"});
-                return dialog.showDialog().getValue();
-            }
+        if (conflictsCol != null && !conflictsCol.isEmpty() && 1 != GuiHelper.runInEDTAndWaitAndReturn(() -> {
+            ExtendedDialog dialog = new ExtendedDialog(
+                    Main.parent,
+                    /* I18N: Display title of the window showing conflicts */
+                    tr("Conflicts"),
+                    new String[] {tr("Reject Conflicts and Save"), tr("Cancel")}
+            );
+            dialog.setContent(
+                    tr("There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?"));
+            dialog.setButtonIcons(new String[] {"save", "cancel"});
+            return dialog.showDialog().getValue();
         })) {
             return false;
Index: trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 10611)
@@ -73,10 +73,7 @@
     @Override
     protected TMSTileSource getTileSource(ImageryInfo info) {
-        return getTileSourceStatic(info, new Runnable() {
-            @Override
-            public void run() {
-                Main.debug("Attribution loaded, running loadAllErrorTiles");
-                TMSLayer.this.loadAllErrorTiles(false);
-            }
+        return getTileSourceStatic(info, () -> {
+            Main.debug("Attribution loaded, running loadAllErrorTiles");
+            TMSLayer.this.loadAllErrorTiles(false);
         });
     }
Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 10611)
@@ -30,5 +30,4 @@
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.Date;
 import java.util.Dictionary;
@@ -60,6 +59,4 @@
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
 import javax.swing.filechooser.FileFilter;
 
@@ -460,24 +457,20 @@
             });
             imgList.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-            imgList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
-
-                @Override
-                public void valueChanged(ListSelectionEvent arg0) {
-                    int index = imgList.getSelectedIndex();
-                    Integer orientation = ExifReader.readOrientation(yLayer.data.get(index).getFile());
-                    imgDisp.setImage(yLayer.data.get(index).getFile(), orientation);
-                    Date date = yLayer.data.get(index).getExifTime();
-                    if (date != null) {
-                        DateFormat df = DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.MEDIUM);
-                        lbExifTime.setText(df.format(date));
-                        tfGpsTime.setText(df.format(date));
-                        tfGpsTime.setCaretPosition(tfGpsTime.getText().length());
-                        tfGpsTime.setEnabled(true);
-                        tfGpsTime.requestFocus();
-                    } else {
-                        lbExifTime.setText(tr("No date"));
-                        tfGpsTime.setText("");
-                        tfGpsTime.setEnabled(false);
-                    }
+            imgList.getSelectionModel().addListSelectionListener(evt -> {
+                int index = imgList.getSelectedIndex();
+                Integer orientation = ExifReader.readOrientation(yLayer.data.get(index).getFile());
+                imgDisp.setImage(yLayer.data.get(index).getFile(), orientation);
+                Date date = yLayer.data.get(index).getExifTime();
+                if (date != null) {
+                    DateFormat df = DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.MEDIUM);
+                    lbExifTime.setText(df.format(date));
+                    tfGpsTime.setText(df.format(date));
+                    tfGpsTime.setCaretPosition(tfGpsTime.getText().length());
+                    tfGpsTime.setEnabled(true);
+                    tfGpsTime.requestFocus();
+                } else {
+                    lbExifTime.setText(tr("No date"));
+                    tfGpsTime.setText("");
+                    tfGpsTime.setEnabled(false);
                 }
             });
@@ -485,27 +478,23 @@
 
             JButton openButton = new JButton(tr("Open another photo"));
-            openButton.addActionListener(new ActionListener() {
-
-                @Override
-                public void actionPerformed(ActionEvent ae) {
-                    AbstractFileChooser fc = DiskAccessAction.createAndOpenFileChooser(true, false, null,
-                            JpgImporter.FILE_FILTER_WITH_FOLDERS, JFileChooser.FILES_ONLY, "geoimage.lastdirectory");
-                    if (fc == null)
-                        return;
-                    File sel = fc.getSelectedFile();
-
-                    Integer orientation = ExifReader.readOrientation(sel);
-                    imgDisp.setImage(sel, orientation);
-
-                    Date date = ExifReader.readTime(sel);
-                    if (date != null) {
-                        lbExifTime.setText(DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.MEDIUM).format(date));
-                        tfGpsTime.setText(DateUtils.getDateFormat(DateFormat.SHORT).format(date)+' ');
-                        tfGpsTime.setEnabled(true);
-                    } else {
-                        lbExifTime.setText(tr("No date"));
-                        tfGpsTime.setText("");
-                        tfGpsTime.setEnabled(false);
-                    }
+            openButton.addActionListener(ae -> {
+                AbstractFileChooser fc = DiskAccessAction.createAndOpenFileChooser(true, false, null,
+                        JpgImporter.FILE_FILTER_WITH_FOLDERS, JFileChooser.FILES_ONLY, "geoimage.lastdirectory");
+                if (fc == null)
+                    return;
+                File sel = fc.getSelectedFile();
+
+                Integer orientation = ExifReader.readOrientation(sel);
+                imgDisp.setImage(sel, orientation);
+
+                Date date = ExifReader.readTime(sel);
+                if (date != null) {
+                    lbExifTime.setText(DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.MEDIUM).format(date));
+                    tfGpsTime.setText(DateUtils.getDateFormat(DateFormat.SHORT).format(date)+' ');
+                    tfGpsTime.setEnabled(true);
+                } else {
+                    lbExifTime.setText(tr("No date"));
+                    tfGpsTime.setText("");
+                    tfGpsTime.setEnabled(false);
                 }
             });
@@ -1092,10 +1081,5 @@
         }
 
-        Collections.sort(dateImgLst, new Comparator<ImageEntry>() {
-            @Override
-            public int compare(ImageEntry arg0, ImageEntry arg1) {
-                return arg0.getExifTime().compareTo(arg1.getExifTime());
-            }
-        });
+        Collections.sort(dateImgLst, (o1, o2) -> o1.getExifTime().compareTo(o2.getExifTime()));
 
         return dateImgLst;
Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(revision 10611)
@@ -66,6 +66,4 @@
 import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent;
 import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
-import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
-import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.io.JpgImporter;
@@ -431,13 +429,10 @@
 
         if (selected != null && !data.isEmpty()) {
-            GuiHelper.runInEDTAndWait(new Runnable() {
-                @Override
-                public void run() {
-                    for (int i = 0; i < data.size(); i++) {
-                        if (selected.equals(data.get(i))) {
-                            currentPhoto = i;
-                            ImageViewerDialog.showImage(GeoImageLayer.this, data.get(i));
-                            break;
-                        }
+            GuiHelper.runInEDTAndWait(() -> {
+                for (int i = 0; i < data.size(); i++) {
+                    if (selected.equals(data.get(i))) {
+                        currentPhoto = i;
+                        ImageViewerDialog.showImage(GeoImageLayer.this, data.get(i));
+                        break;
                     }
                 }
@@ -881,12 +876,9 @@
         };
 
-        mapModeListener = new MapModeChangeListener() {
-            @Override
-            public void mapModeChange(MapMode oldMapMode, MapMode newMapMode) {
-                if (newMapMode == null || isSupportedMapMode(newMapMode)) {
-                    Main.map.mapView.addMouseListener(mouseAdapter);
-                } else {
-                    Main.map.mapView.removeMouseListener(mouseAdapter);
-                }
+        mapModeListener = (oldMapMode, newMapMode) -> {
+            if (newMapMode == null || isSupportedMapMode(newMapMode)) {
+                Main.map.mapView.addMouseListener(mouseAdapter);
+            } else {
+                Main.map.mapView.removeMouseListener(mouseAdapter);
             }
         };
@@ -895,11 +887,8 @@
         mapModeListener.mapModeChange(null, Main.map.mapMode);
 
-        Main.getLayerManager().addActiveLayerChangeListener(new ActiveLayerChangeListener() {
-            @Override
-            public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
-                if (Main.getLayerManager().getActiveLayer() == GeoImageLayer.this) {
-                    // only in select mode it is possible to click the images
-                    Main.map.selectSelectTool(false);
-                }
+        Main.getLayerManager().addActiveLayerChangeListener(e -> {
+            if (Main.getLayerManager().getActiveLayer() == GeoImageLayer.this) {
+                // only in select mode it is possible to click the images
+                Main.map.selectSelectTool(false);
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java	(revision 10611)
@@ -10,5 +10,4 @@
 import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
@@ -27,6 +26,4 @@
 import javax.swing.JToggleButton;
 import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
 import javax.swing.table.DefaultTableModel;
 import javax.swing.table.TableCellRenderer;
@@ -205,12 +202,9 @@
     /** listens to selection changes in the table and redraws the map */
     private void listenToSelectionChanges() {
-        table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
-            @Override
-            public void valueChanged(ListSelectionEvent e) {
-                if (noUpdates || !(e.getSource() instanceof ListSelectionModel)) {
-                    return;
-                }
-                updateVisibilityFromTable();
-            }
+        table.getSelectionModel().addListSelectionListener(e -> {
+            if (noUpdates || !(e.getSource() instanceof ListSelectionModel)) {
+                return;
+            }
+            updateVisibilityFromTable();
         });
     }
@@ -230,12 +224,10 @@
 
         dateFilter = new DateFilterPanel(layer, "gpx.traces", false);
-        dateFilter.setFilterAppliedListener(new ActionListener() {
-            @Override public void actionPerformed(ActionEvent e) {
-                noUpdates = true;
-                selectVisibleTracksInTable();
-                noUpdates = false;
-                Main.map.mapView.preferenceChanged(null);
-                Main.map.repaint(100);
-            }
+        dateFilter.setFilterAppliedListener(e -> {
+            noUpdates = true;
+            selectVisibleTracksInTable();
+            noUpdates = false;
+            Main.map.mapView.preferenceChanged(null);
+            Main.map.repaint(100);
         });
         dateFilter.loadFromPrefs();
Index: trunk/src/org/openstreetmap/josm/gui/layer/gpx/DateFilterPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/gpx/DateFilterPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/gpx/DateFilterPanel.java	(revision 10611)
@@ -6,5 +6,4 @@
 import java.awt.Component;
 import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.util.Date;
@@ -14,5 +13,4 @@
 import javax.swing.JPanel;
 import javax.swing.Timer;
-import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
@@ -70,15 +68,9 @@
     }
 
-    private final transient ChangeListener changeListener = new ChangeListener() {
-        @Override public void stateChanged(ChangeEvent e) {
-            if (isEnabled()) applyFilterWithDelay();
-        }
+    private final transient ChangeListener changeListener = e -> {
+        if (isEnabled()) applyFilterWithDelay();
     };
 
-    private final Timer t = new Timer(200, new ActionListener() {
-        @Override public void actionPerformed(ActionEvent e) {
-            applyFilter();
-        }
-    });
+    private final Timer t = new Timer(200, e -> applyFilter());
 
     /**
Index: trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongPanel.java	(revision 10611)
@@ -14,5 +14,4 @@
 import javax.swing.JSpinner;
 import javax.swing.SpinnerNumberModel;
-import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
@@ -179,9 +178,5 @@
         };
 
-        addChangeListener(new ChangeListener() {
-            @Override public void stateChanged(ChangeEvent e) {
-                options[0].setEnabled(isDownloadOsmData() || isDownloadGpxData());
-            }
-        });
+        addChangeListener(e -> options[0].setEnabled(isDownloadOsmData() || isDownloadGpxData()));
 
         int ret = HelpAwareOptionPane.showOptionDialog(Main.parent, this, title,
Index: trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java	(revision 10611)
@@ -12,5 +12,4 @@
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 
 import javax.swing.AbstractAction;
@@ -89,10 +88,5 @@
             // long as they don't overlap, that's fine)
             if (sel.length > 1) {
-                Arrays.sort(sel, new Comparator<File>() {
-                    @Override
-                    public int compare(File a, File b) {
-                        return a.lastModified() <= b.lastModified() ? -1 : 1;
-                    }
-                });
+                Arrays.sort(sel, (a, b) -> a.lastModified() <= b.lastModified() ? -1 : 1);
             }
             StringBuilder names = new StringBuilder();
@@ -284,10 +278,5 @@
         /* we must have got at least one waypoint now */
 
-        Collections.sort((ArrayList<WayPoint>) waypoints, new Comparator<WayPoint>() {
-            @Override
-            public int compare(WayPoint a, WayPoint b) {
-                return a.time <= b.time ? -1 : 1;
-            }
-        });
+        Collections.sort((ArrayList<WayPoint>) waypoints, (a, b) -> a.time <= b.time ? -1 : 1);
 
         firstTime = -1.0; /* this time of the first waypoint, not first trackpoint */
@@ -299,6 +288,5 @@
             AudioMarker am = new AudioMarker(w.getCoor(), w, url, ml, w.time, offset);
             /*
-             * timeFromAudio intended for future use to shift markers of this type on
-             * synchronization
+             * timeFromAudio intended for future use to shift markers of this type on synchronization
              */
             if (w == wayPointFromTimeStamp) {
Index: trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarker.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarker.java	(revision 10611)
@@ -7,5 +7,4 @@
 import java.awt.Image;
 import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.net.URL;
 import java.util.Collections;
@@ -55,15 +54,12 @@
         p2.add(scale);
         p.add(p2, BorderLayout.SOUTH);
-        scale.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent ev) {
-                p.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
-                if (scale.getModel().isSelected()) {
-                    ((JLabel) vp.getView()).setIcon(loadScaledImage(imageUrl, Math.max(vp.getWidth(), vp.getHeight())));
-                } else {
-                    ((JLabel) vp.getView()).setIcon(new ImageIcon(imageUrl));
-                }
-                p.setCursor(Cursor.getDefaultCursor());
+        scale.addActionListener(ev1 -> {
+            p.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+            if (scale.getModel().isSelected()) {
+                ((JLabel) vp.getView()).setIcon(loadScaledImage(imageUrl, Math.max(vp.getWidth(), vp.getHeight())));
+            } else {
+                ((JLabel) vp.getView()).setIcon(new ImageIcon(imageUrl));
             }
+            p.setCursor(Cursor.getDefaultCursor());
         });
         scale.setSelected(true);
Index: trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java	(revision 10611)
@@ -183,44 +183,41 @@
     // Add one Marker specifying the default behaviour.
     static {
-        Marker.markerProducers.add(new MarkerProducers() {
-            @Override
-            public Collection<Marker> createMarkers(WayPoint wpt, File relativePath, MarkerLayer parentLayer, double time, double offset) {
-                String uri = null;
-                // cheapest way to check whether "link" object exists and is a non-empty collection of GpxLink objects...
-                Collection<GpxLink> links = wpt.<GpxLink>getCollection(GpxConstants.META_LINKS);
-                if (links != null) {
-                    for (GpxLink oneLink : links) {
-                        uri = oneLink.uri;
-                        break;
+        Marker.markerProducers.add((wpt, relativePath, parentLayer, time, offset) -> {
+            String uri = null;
+            // cheapest way to check whether "link" object exists and is a non-empty collection of GpxLink objects...
+            Collection<GpxLink> links = wpt.<GpxLink>getCollection(GpxConstants.META_LINKS);
+            if (links != null) {
+                for (GpxLink oneLink : links) {
+                    uri = oneLink.uri;
+                    break;
+                }
+            }
+
+            URL url = uriToUrl(uri, relativePath);
+
+            String urlStr = url == null ? "" : url.toString();
+            String symbolName = wpt.getString("symbol");
+            if (symbolName == null) {
+                symbolName = wpt.getString(GpxConstants.PT_SYM);
+            }
+            // text marker is returned in every case, see #10208
+            final Marker marker = new Marker(wpt.getCoor(), wpt, symbolName, parentLayer, time, offset);
+            if (url == null) {
+                return Collections.singleton(marker);
+            } else if (urlStr.endsWith(".wav")) {
+                final AudioMarker audioMarker = new AudioMarker(wpt.getCoor(), wpt, url, parentLayer, time, offset);
+                Extensions exts = (Extensions) wpt.get(GpxConstants.META_EXTENSIONS);
+                if (exts != null && exts.containsKey("offset")) {
+                    try {
+                        audioMarker.syncOffset = Double.parseDouble(exts.get("sync-offset"));
+                    } catch (NumberFormatException nfe) {
+                        Main.warn(nfe);
                     }
                 }
-
-                URL url = uriToUrl(uri, relativePath);
-
-                String urlStr = url == null ? "" : url.toString();
-                String symbolName = wpt.getString("symbol");
-                if (symbolName == null) {
-                    symbolName = wpt.getString(GpxConstants.PT_SYM);
-                }
-                // text marker is returned in every case, see #10208
-                final Marker marker = new Marker(wpt.getCoor(), wpt, symbolName, parentLayer, time, offset);
-                if (url == null) {
-                    return Collections.singleton(marker);
-                } else if (urlStr.endsWith(".wav")) {
-                    final AudioMarker audioMarker = new AudioMarker(wpt.getCoor(), wpt, url, parentLayer, time, offset);
-                    Extensions exts = (Extensions) wpt.get(GpxConstants.META_EXTENSIONS);
-                    if (exts != null && exts.containsKey("offset")) {
-                        try {
-                            audioMarker.syncOffset = Double.parseDouble(exts.get("sync-offset"));
-                        } catch (NumberFormatException nfe) {
-                            Main.warn(nfe);
-                        }
-                    }
-                    return Arrays.asList(marker, audioMarker);
-                } else if (urlStr.endsWith(".png") || urlStr.endsWith(".jpg") || urlStr.endsWith(".jpeg") || urlStr.endsWith(".gif")) {
-                    return Arrays.asList(marker, new ImageMarker(wpt.getCoor(), url, parentLayer, time, offset));
-                } else {
-                    return Arrays.asList(marker, new WebMarker(wpt.getCoor(), url, parentLayer, time, offset));
-                }
+                return Arrays.asList(marker, audioMarker);
+            } else if (urlStr.endsWith(".png") || urlStr.endsWith(".jpg") || urlStr.endsWith(".jpeg") || urlStr.endsWith(".gif")) {
+                return Arrays.asList(marker, new ImageMarker(wpt.getCoor(), url, parentLayer, time, offset));
+            } else {
+                return Arrays.asList(marker, new WebMarker(wpt.getCoor(), url, parentLayer, time, offset));
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java	(revision 10611)
@@ -20,5 +20,4 @@
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
 
@@ -235,10 +234,5 @@
         if (from instanceof MarkerLayer) {
             data.addAll(((MarkerLayer) from).data);
-            Collections.sort(data, new Comparator<Marker>() {
-                @Override
-                public int compare(Marker o1, Marker o2) {
-                    return Double.compare(o1.time, o2.time);
-                }
-            });
+            Collections.sort(data, (o1, o2) -> Double.compare(o1.time, o2.time));
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java	(revision 10611)
@@ -7,6 +7,4 @@
 import java.awt.Point;
 import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
@@ -290,10 +288,5 @@
         if (timer == null) {
             animationInterval = Main.pref.getDouble("marker.audioanimationinterval", 1.0); //milliseconds
-            timer = new Timer((int) (animationInterval * 1000.0), new ActionListener() {
-                @Override
-                public void actionPerformed(ActionEvent e) {
-                    timerAction();
-                }
-            });
+            timer = new Timer((int) (animationInterval * 1000.0), e -> timerAction());
             timer.setInitialDelay(0);
         } else {
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 10611)
@@ -59,10 +59,7 @@
     public void clearCached() {
         // run in EDT to make sure this isn't called during rendering run
-        GuiHelper.runInEDT(new Runnable() {
-            @Override
-            public void run() {
-                cacheIdx++;
-                preferenceCache.clear();
-            }
+        GuiHelper.runInEDT(() -> {
+            cacheIdx++;
+            preferenceCache.clear();
         });
     }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 10611)
@@ -365,13 +365,10 @@
         @Override
         protected void finish() {
-            SwingUtilities.invokeLater(new Runnable() {
-                @Override
-                public void run() {
-                    fireMapPaintSylesUpdated();
-                    styles.clearCached();
-                    if (Main.isDisplayingMapView()) {
-                        Main.map.mapView.preferenceChanged(null);
-                        Main.map.mapView.repaint();
-                    }
+            SwingUtilities.invokeLater(() -> {
+                fireMapPaintSylesUpdated();
+                styles.clearCached();
+                if (Main.isDisplayingMapView()) {
+                    Main.map.mapView.preferenceChanged(null);
+                    Main.map.mapView.repaint();
                 }
             });
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 10611)
@@ -39,4 +39,5 @@
 import org.openstreetmap.josm.tools.RightAndLefthandTraffic;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.tools.Utils.Function;
 
 /**
@@ -1127,10 +1128,5 @@
 
         public Float aggregateList(List<?> lst) {
-            final List<Float> floats = Utils.transform(lst, new Utils.Function<Object, Float>() {
-                @Override
-                public Float apply(Object x) {
-                    return Cascade.convertTo(x, float.class);
-                }
-            });
+            final List<Float> floats = Utils.transform(lst, (Function<Object, Float>) x -> Cascade.convertTo(x, float.class));
             final Collection<Float> nonNullList = Utils.filter(floats, Predicates.not(Predicates.isNull()));
             return nonNullList.isEmpty() ? (Float) Float.NaN : computeMax ? Collections.max(nonNullList) : Collections.min(nonNullList);
@@ -1141,10 +1137,5 @@
             List<?> l = Cascade.convertTo(args.get(0).evaluate(env), List.class);
             if (args.size() != 1 || l == null)
-                l = Utils.transform(args, new Utils.Function<Expression, Object>() {
-                    @Override
-                    public Object apply(Expression x) {
-                        return x.evaluate(env);
-                    }
-                });
+                l = Utils.transform(args, (Function<Expression, Object>) x -> x.evaluate(env));
             return aggregateList(l);
         }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java	(revision 10611)
@@ -99,22 +99,19 @@
                 .setHeight(height)
                 .setOptional(true)
-                .getInBackground(new ImageCallback() {
-                    @Override
-                    public void finished(ImageIcon result) {
-                        synchronized (MapImage.this) {
-                            if (result == null) {
-                                source.logWarning(tr("Failed to locate image ''{0}''", name));
-                                ImageIcon noIcon = MapPaintStyles.getNoIcon_Icon(source);
-                                img = noIcon == null ? null : (BufferedImage) noIcon.getImage();
-                            } else {
-                                img = (BufferedImage) rescale(result.getImage());
-                            }
-                            if (temporary) {
-                                disabledImgCache = null;
-                                Main.map.mapView.preferenceChanged(null); // otherwise repaint is ignored, because layer hasn't changed
-                                Main.map.mapView.repaint();
-                            }
-                            temporary = false;
+                .getInBackground((ImageCallback) result -> {
+                    synchronized (MapImage.this) {
+                        if (result == null) {
+                            source.logWarning(tr("Failed to locate image ''{0}''", name));
+                            ImageIcon noIcon = MapPaintStyles.getNoIcon_Icon(source);
+                            img = noIcon == null ? null : (BufferedImage) noIcon.getImage();
+                        } else {
+                            img = (BufferedImage) rescale(result.getImage());
                         }
+                        if (temporary) {
+                            disabledImgCache = null;
+                            Main.map.mapView.preferenceChanged(null); // otherwise repaint is ignored, because layer hasn't changed
+                            Main.map.mapView.repaint();
+                        }
+                        temporary = false;
                     }
                 }
Index: trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java	(revision 10611)
@@ -465,12 +465,9 @@
 
         protected void handleException(final OsmOAuthAuthorizationException e) {
-            Runnable r = new Runnable() {
-                @Override
-                public void run() {
-                    if (e instanceof OsmLoginFailedException) {
-                        alertLoginFailed((OsmLoginFailedException) e);
-                    } else {
-                        alertAuthorisationFailed(e);
-                    }
+            Runnable r = () -> {
+                if (e instanceof OsmLoginFailedException) {
+                    alertLoginFailed((OsmLoginFailedException) e);
+                } else {
+                    alertAuthorisationFailed(e);
                 }
             };
@@ -505,10 +502,7 @@
                 getProgressMonitor().worked(1);
                 if (canceled) return;
-                GuiHelper.runInEDT(new Runnable() {
-                    @Override
-                    public void run() {
-                        prepareUIForResultDisplay();
-                        setAccessToken(accessToken);
-                    }
+                GuiHelper.runInEDT(() -> {
+                    prepareUIForResultDisplay();
+                    setAccessToken(accessToken);
                 });
             } catch (final OsmOAuthAuthorizationException e) {
Index: trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveAccessTokenTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveAccessTokenTask.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveAccessTokenTask.java	(revision 10611)
@@ -90,10 +90,5 @@
         } catch (final OsmOAuthAuthorizationException e) {
             Main.error(e);
-            GuiHelper.runInEDT(new Runnable() {
-                @Override
-                public void run() {
-                    alertRetrievingAccessTokenFailed(e);
-                }
-            });
+            GuiHelper.runInEDT(() -> alertRetrievingAccessTokenFailed(e));
             accessToken = null;
         } finally {
Index: trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveRequestTokenTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveRequestTokenTask.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveRequestTokenTask.java	(revision 10611)
@@ -84,10 +84,5 @@
         } catch (final OsmOAuthAuthorizationException e) {
             Main.error(e);
-            GuiHelper.runInEDT(new Runnable() {
-                @Override
-                public void run() {
-                    alertRetrievingRequestTokenFailed(e);
-                }
-            });
+            GuiHelper.runInEDT(() -> alertRetrievingRequestTokenFailed(e));
             requestToken = null;
         } finally {
Index: trunk/src/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUI.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUI.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUI.java	(revision 10611)
@@ -13,5 +13,4 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 import java.util.concurrent.Executor;
 
@@ -143,10 +142,5 @@
             cbShowAdvancedParameters.setSelected(false);
             cbShowAdvancedParameters.addItemListener(
-                    new ItemListener() {
-                        @Override
-                        public void itemStateChanged(ItemEvent evt) {
-                            getAdvancedPropertiesPanel().setVisible(evt.getStateChange() == ItemEvent.SELECTED);
-                        }
-                    }
+                    evt -> getAdvancedPropertiesPanel().setVisible(evt.getStateChange() == ItemEvent.SELECTED)
             );
 
@@ -400,17 +394,9 @@
             );
             executor.execute(task);
-            Runnable r = new Runnable() {
-                @Override
-                public void run() {
-                    if (task.isCanceled()) return;
-                    if (task.getRequestToken() == null) return;
-                    requestToken = task.getRequestToken();
-                    GuiHelper.runInEDT(new Runnable() {
-                        @Override
-                        public void run() {
-                            transitionToRetrieveAccessToken();
-                        }
-                    });
-                }
+            Runnable r = () -> {
+                if (task.isCanceled()) return;
+                if (task.getRequestToken() == null) return;
+                requestToken = task.getRequestToken();
+                GuiHelper.runInEDT(SemiAutomaticAuthorizationUI.this::transitionToRetrieveAccessToken);
             };
             executor.execute(r);
@@ -437,17 +423,11 @@
             );
             executor.execute(task);
-            Runnable r = new Runnable() {
-                @Override
-                public void run() {
-                    if (task.isCanceled()) return;
-                    if (task.getAccessToken() == null) return;
-                    GuiHelper.runInEDT(new Runnable() {
-                        @Override
-                        public void run() {
-                            setAccessToken(task.getAccessToken());
-                            transitionToShowAccessToken();
-                        }
-                    });
-                }
+            Runnable r = () -> {
+                if (task.isCanceled()) return;
+                if (task.getAccessToken() == null) return;
+                GuiHelper.runInEDT(() -> {
+                    setAccessToken(task.getAccessToken());
+                    transitionToShowAccessToken();
+                });
             };
             executor.execute(r);
Index: trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java	(revision 10611)
@@ -12,5 +12,4 @@
 import java.awt.Insets;
 import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
 import java.awt.event.WindowAdapter;
@@ -19,7 +18,7 @@
 import javax.swing.AbstractAction;
 import javax.swing.BorderFactory;
+import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JComponent;
-import javax.swing.JButton;
 import javax.swing.JDialog;
 import javax.swing.JPanel;
@@ -58,10 +57,5 @@
         JCheckBox expert = new JCheckBox(tr("Expert mode"));
         expert.setSelected(ExpertToggleAction.isExpert());
-        expert.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                ExpertToggleAction.getInstance().actionPerformed(null);
-            }
-        });
+        expert.addActionListener(e -> ExpertToggleAction.getInstance().actionPerformed(null));
 
         JPanel btns = new JPanel(new FlowLayout(FlowLayout.CENTER));
Index: trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java	(revision 10611)
@@ -322,19 +322,9 @@
 
     public void selectTabByName(String name) {
-        selectTabBy(new TabIdentifier() {
-            @Override
-            public boolean identify(TabPreferenceSetting tps, Object name) {
-                return name != null && tps != null && tps.getIconName() != null && name.equals(tps.getIconName());
-            }
-        }, name);
+        selectTabBy((tps, name1) -> name1 != null && tps != null && tps.getIconName() != null && name1.equals(tps.getIconName()), name);
     }
 
     public void selectTabByPref(Class<? extends TabPreferenceSetting> clazz) {
-        selectTabBy(new TabIdentifier() {
-            @Override
-            public boolean identify(TabPreferenceSetting tps, Object clazz) {
-                return tps.getClass().isAssignableFrom((Class<?>) clazz);
-            }
-        }, clazz);
+        selectTabBy((tps, clazz1) -> tps.getClass().isAssignableFrom((Class<?>) clazz1), clazz);
     }
 
@@ -344,10 +334,5 @@
                 final SubPreferenceSetting sub = (SubPreferenceSetting) setting;
                 final TabPreferenceSetting tab = sub.getTabPreferenceSetting(this);
-                selectTabBy(new TabIdentifier() {
-                    @Override
-                    public boolean identify(TabPreferenceSetting tps, Object unused) {
-                        return tps.equals(tab);
-                    }
-                }, null);
+                selectTabBy((tps, unused) -> tps.equals(tab), null);
                 return tab.selectSubTab(sub);
             }
@@ -419,5 +404,4 @@
     public void savePreferences() {
         // create a task for downloading plugins if the user has activated, yet not downloaded, new plugins
-        //
         final PluginPreference preference = getPluginPreference();
         final Set<PluginInformation> toDownload = preference.getPluginsScheduledForUpdateOrDownload();
@@ -430,5 +414,4 @@
 
         // this is the task which will run *after* the plugins are downloaded
-        //
         final Runnable continuation = new PluginDownloadAfterTask(preference, task, toDownload);
 
@@ -436,18 +419,9 @@
             // if we have to launch a plugin download task we do it asynchronously, followed
             // by the remaining "save preferences" activites run on the Swing EDT.
-            //
             Main.worker.submit(task);
-            Main.worker.submit(
-                    new Runnable() {
-                        @Override
-                        public void run() {
-                            SwingUtilities.invokeLater(continuation);
-                        }
-                    }
-                    );
+            Main.worker.submit(() -> SwingUtilities.invokeLater(continuation));
         } else {
             // no need for asynchronous activities. Simply run the remaining "save preference"
             // activities on this thread (we are already on the Swing EDT
-            //
             continuation.run();
         }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 10611)
@@ -18,6 +18,4 @@
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
 import java.io.BufferedReader;
 import java.io.File;
@@ -29,5 +27,4 @@
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.EventObject;
 import java.util.HashMap;
@@ -66,5 +63,4 @@
 import javax.swing.event.CellEditorListener;
 import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
@@ -165,26 +161,15 @@
         }
 
-        activeSourcesModel.addTableModelListener(new TableModelListener() {
-            @Override
-            public void tableChanged(TableModelEvent e) {
-                listCellRenderer.updateSources(activeSourcesModel.getSources());
-                lstAvailableSources.repaint();
-            }
+        activeSourcesModel.addTableModelListener(e -> {
+            listCellRenderer.updateSources(activeSourcesModel.getSources());
+            lstAvailableSources.repaint();
         });
-        tblActiveSources.addPropertyChangeListener(new PropertyChangeListener() {
-            @Override
-            public void propertyChange(PropertyChangeEvent evt) {
-                listCellRenderer.updateSources(activeSourcesModel.getSources());
-                lstAvailableSources.repaint();
-            }
+        tblActiveSources.addPropertyChangeListener(evt -> {
+            listCellRenderer.updateSources(activeSourcesModel.getSources());
+            lstAvailableSources.repaint();
         });
-        activeSourcesModel.addTableModelListener(new TableModelListener() {
-            // Force swing to show horizontal scrollbars for the JTable
-            // Yes, this is a little ugly, but should work
-            @Override
-            public void tableChanged(TableModelEvent e) {
-                TableHelper.adjustColumnWidth(tblActiveSources, canEnable ? 1 : 0, 800);
-            }
-        });
+        // Force Swing to show horizontal scrollbars for the JTable
+        // Yes, this is a little ugly, but should work
+        activeSourcesModel.addTableModelListener(e -> TableHelper.adjustColumnWidth(tblActiveSources, canEnable ? 1 : 0, 800));
         activeSourcesModel.setActiveSources(getInitialSourcesList());
 
@@ -1238,17 +1223,12 @@
 
         protected void sort() {
-            Collections.sort(
-                    data,
-                    new Comparator<String>() {
-                        @Override
-                        public int compare(String o1, String o2) {
-                            if (o1.isEmpty() && o2.isEmpty())
-                                return 0;
-                            if (o1.isEmpty()) return 1;
-                            if (o2.isEmpty()) return -1;
-                            return o1.compareTo(o2);
-                        }
-                    }
-                    );
+            Collections.sort(data,
+                    (o1, o2) -> {
+                        if (o1.isEmpty() && o2.isEmpty())
+                            return 0;
+                        if (o1.isEmpty()) return 1;
+                        if (o2.isEmpty()) return -1;
+                        return o1.compareTo(o2);
+                    });
         }
 
@@ -1380,16 +1360,11 @@
             final String msg = tr(getStr(I18nString.FAILED_TO_LOAD_SOURCES_FROM), url, emsg);
 
-            GuiHelper.runInEDT(new Runnable() {
-                @Override
-                public void run() {
-                    HelpAwareOptionPane.showOptionDialog(
-                            Main.parent,
-                            msg,
-                            tr("Error"),
-                            JOptionPane.ERROR_MESSAGE,
-                            ht(getStr(I18nString.FAILED_TO_LOAD_SOURCES_FROM_HELP_TOPIC))
-                            );
-                }
-            });
+            GuiHelper.runInEDT(() -> HelpAwareOptionPane.showOptionDialog(
+                    Main.parent,
+                    msg,
+                    tr("Error"),
+                    JOptionPane.ERROR_MESSAGE,
+                    ht(getStr(I18nString.FAILED_TO_LOAD_SOURCES_FROM_HELP_TOPIC))
+                    ));
         }
 
@@ -1746,14 +1721,9 @@
      */
     public final void deferLoading(final DefaultTabPreferenceSetting tab, final Component component) {
-        tab.getTabPane().addChangeListener(
-                new ChangeListener() {
-                    @Override
-                    public void stateChanged(ChangeEvent e) {
-                        if (tab.getTabPane().getSelectedComponent() == component) {
-                            SourceEditor.this.initiallyLoadAvailableSources();
-                        }
-                    }
-                }
-                );
+        tab.getTabPane().addChangeListener(e -> {
+            if (tab.getTabPane().getSelectedComponent() == component) {
+                SourceEditor.this.initiallyLoadAvailableSources();
+            }
+        });
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 10611)
@@ -18,6 +18,4 @@
 import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -51,10 +49,6 @@
 import javax.swing.MenuElement;
 import javax.swing.TransferHandler;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
 import javax.swing.event.PopupMenuEvent;
 import javax.swing.event.PopupMenuListener;
-import javax.swing.event.TreeSelectionEvent;
-import javax.swing.event.TreeSelectionListener;
 import javax.swing.table.AbstractTableModel;
 import javax.swing.tree.DefaultMutableTreeNode;
@@ -69,6 +63,4 @@
 import org.openstreetmap.josm.actions.ParameterizedAction;
 import org.openstreetmap.josm.actions.ParameterizedActionDecorator;
-import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
-import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset;
 import org.openstreetmap.josm.tools.GBC;
@@ -762,16 +754,13 @@
             };
             selectedList.setCellRenderer(renderer);
-            selectedList.addListSelectionListener(new ListSelectionListener() {
-                @Override
-                public void valueChanged(ListSelectionEvent e) {
-                    boolean sel = selectedList.getSelectedIndex() != -1;
-                    if (sel) {
-                        actionsTree.clearSelection();
-                        ActionDefinition action = selected.get(selectedList.getSelectedIndex());
-                        actionParametersModel.setCurrentAction(action);
-                        actionParametersPanel.setVisible(actionParametersModel.getRowCount() > 0);
-                    }
-                    updateEnabledState();
-                }
+            selectedList.addListSelectionListener(e -> {
+                boolean sel = selectedList.getSelectedIndex() != -1;
+                if (sel) {
+                    actionsTree.clearSelection();
+                    ActionDefinition action = selected.get(selectedList.getSelectedIndex());
+                    actionParametersModel.setCurrentAction(action);
+                    actionParametersPanel.setVisible(actionParametersModel.getRowCount() > 0);
+                }
+                updateEnabledState();
             });
 
@@ -804,9 +793,5 @@
             });
             actionsTree.setDragEnabled(true);
-            actionsTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
-                @Override public void valueChanged(TreeSelectionEvent e) {
-                    updateEnabledState();
-                }
-            });
+            actionsTree.getSelectionModel().addTreeSelectionListener(e -> updateEnabledState());
 
             final JPanel left = new JPanel(new GridBagLayout());
@@ -914,10 +899,7 @@
         control.setFloatable(false);
         control.setComponentPopupMenu(popupMenu);
-        Main.pref.addPreferenceChangeListener(new PreferenceChangedListener() {
-            @Override
-            public void preferenceChanged(PreferenceChangeEvent e) {
-                if ("toolbar.visible".equals(e.getKey())) {
-                    refreshToolbarControl();
-                }
+        Main.pref.addPreferenceChangeListener(e -> {
+            if ("toolbar.visible".equals(e.getKey())) {
+                refreshToolbarControl();
             }
         });
@@ -1078,11 +1060,7 @@
                 } else {
                     // hide action text if an icon is set later (necessary for delayed/background image loading)
-                    action.getParametrizedAction().addPropertyChangeListener(new PropertyChangeListener() {
-
-                        @Override
-                        public void propertyChange(PropertyChangeEvent evt) {
-                            if (Action.SMALL_ICON.equals(evt.getPropertyName())) {
-                                b.setHideActionText(evt.getNewValue() != null);
-                            }
+                    action.getParametrizedAction().addPropertyChangeListener(evt -> {
+                        if (Action.SMALL_ICON.equals(evt.getPropertyName())) {
+                            b.setHideActionText(evt.getNewValue() != null);
                         }
                     });
Index: trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java	(revision 10611)
@@ -75,17 +75,14 @@
     private final Map<String, String> profileTypes = new LinkedHashMap<>();
 
-    private final Comparator<PrefEntry> customComparator = new Comparator<PrefEntry>() {
-        @Override
-        public int compare(PrefEntry o1, PrefEntry o2) {
-            if (o1.isChanged() && !o2.isChanged())
-                return -1;
-            if (o2.isChanged() && !o1.isChanged())
-                return 1;
-            if (!(o1.isDefault()) && o2.isDefault())
-                return -1;
-            if (!(o2.isDefault()) && o1.isDefault())
-                return 1;
-            return o1.compareTo(o2);
-        }
+    private final Comparator<PrefEntry> customComparator = (o1, o2) -> {
+        if (o1.isChanged() && !o2.isChanged())
+            return -1;
+        if (o2.isChanged() && !o1.isChanged())
+            return 1;
+        if (!(o1.isDefault()) && o2.isDefault())
+            return -1;
+        if (!(o2.isDefault()) && o1.isDefault())
+            return 1;
+        return o1.compareTo(o2);
     };
 
@@ -139,12 +136,10 @@
         p.add(Box.createHorizontalGlue(), GBC.std().fill(GBC.HORIZONTAL));
         p.add(add, GBC.std().insets(0, 5, 0, 0));
-        add.addActionListener(new ActionListener() {
-            @Override public void actionPerformed(ActionEvent e) {
-                PrefEntry pe = table.addPreference(gui);
-                if (pe != null) {
-                    allData.add(pe);
-                    Collections.sort(allData);
-                    applyFilter();
-                }
+        add.addActionListener(e -> {
+            PrefEntry pe = table.addPreference(gui);
+            if (pe != null) {
+                allData.add(pe);
+                Collections.sort(allData);
+                applyFilter();
             }
         });
@@ -152,34 +147,20 @@
         JButton edit = new JButton(tr("Edit"));
         p.add(edit, GBC.std().insets(5, 5, 5, 0));
-        edit.addActionListener(new ActionListener() {
-            @Override public void actionPerformed(ActionEvent e) {
-                if (table.editPreference(gui))
-                    applyFilter();
-            }
+        edit.addActionListener(e -> {
+            if (table.editPreference(gui))
+                applyFilter();
         });
 
         JButton reset = new JButton(tr("Reset"));
         p.add(reset, GBC.std().insets(0, 5, 0, 0));
-        reset.addActionListener(new ActionListener() {
-            @Override public void actionPerformed(ActionEvent e) {
-                table.resetPreferences(gui);
-            }
-        });
+        reset.addActionListener(e -> table.resetPreferences(gui));
 
         JButton read = new JButton(tr("Read from file"));
         p.add(read, GBC.std().insets(5, 5, 0, 0));
-        read.addActionListener(new ActionListener() {
-            @Override public void actionPerformed(ActionEvent e) {
-                readPreferencesFromXML();
-            }
-        });
+        read.addActionListener(e -> readPreferencesFromXML());
 
         JButton export = new JButton(tr("Export selected items"));
         p.add(export, GBC.std().insets(5, 5, 0, 0));
-        export.addActionListener(new ActionListener() {
-            @Override public void actionPerformed(ActionEvent e) {
-                exportSelectedToXML();
-            }
-        });
+        export.addActionListener(e -> exportSelectedToXML());
 
         final JButton more = new JButton(tr("More..."));
Index: trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListEditor.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListEditor.java	(revision 10611)
@@ -19,5 +19,4 @@
 import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.GBC;
-import org.openstreetmap.josm.tools.Predicate;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -44,10 +43,5 @@
     @Override
     public List<String> getData() {
-        return new ArrayList<>(Utils.filter(model.getData(), new Predicate<String>() {
-            @Override
-            public boolean evaluate(String object) {
-                return object != null && !object.isEmpty();
-            }
-        }));
+        return new ArrayList<>(Utils.filter(model.getData(), object -> object != null && !object.isEmpty()));
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java	(revision 10611)
@@ -5,9 +5,6 @@
 
 import java.awt.Color;
-import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
@@ -156,52 +153,40 @@
 
         colorEdit = new JButton(tr("Choose"));
-        colorEdit.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                int sel = colors.getSelectedRow();
-                JColorChooser chooser = new JColorChooser((Color) colors.getValueAt(sel, 1));
-                int answer = JOptionPane.showConfirmDialog(
-                        gui, chooser,
-                        tr("Choose a color for {0}", getName((String) colors.getValueAt(sel, 0))),
-                        JOptionPane.OK_CANCEL_OPTION,
-                        JOptionPane.PLAIN_MESSAGE);
-                if (answer == JOptionPane.OK_OPTION) {
-                    colors.setValueAt(chooser.getColor(), sel, 1);
-                }
+        colorEdit.addActionListener(e -> {
+            int sel = colors.getSelectedRow();
+            JColorChooser chooser = new JColorChooser((Color) colors.getValueAt(sel, 1));
+            int answer = JOptionPane.showConfirmDialog(
+                    gui, chooser,
+                    tr("Choose a color for {0}", getName((String) colors.getValueAt(sel, 0))),
+                    JOptionPane.OK_CANCEL_OPTION,
+                    JOptionPane.PLAIN_MESSAGE);
+            if (answer == JOptionPane.OK_OPTION) {
+                colors.setValueAt(chooser.getColor(), sel, 1);
             }
         });
         defaultSet = new JButton(tr("Set to default"));
-        defaultSet.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                int sel = colors.getSelectedRow();
-                String name = (String) colors.getValueAt(sel, 0);
+        defaultSet.addActionListener(e -> {
+            int sel = colors.getSelectedRow();
+            String name = (String) colors.getValueAt(sel, 0);
+            Color c = Main.pref.getDefaultColor(name);
+            if (c != null) {
+                colors.setValueAt(c, sel, 1);
+            }
+        });
+        JButton defaultAll = new JButton(tr("Set all to default"));
+        defaultAll.addActionListener(e -> {
+            for (int i = 0; i < colors.getRowCount(); ++i) {
+                String name = (String) colors.getValueAt(i, 0);
                 Color c = Main.pref.getDefaultColor(name);
                 if (c != null) {
-                    colors.setValueAt(c, sel, 1);
+                    colors.setValueAt(c, i, 1);
                 }
             }
         });
-        JButton defaultAll = new JButton(tr("Set all to default"));
-        defaultAll.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                for (int i = 0; i < colors.getRowCount(); ++i) {
-                    String name = (String) colors.getValueAt(i, 0);
-                    Color c = Main.pref.getDefaultColor(name);
-                    if (c != null) {
-                        colors.setValueAt(c, i, 1);
-                    }
-                }
-            }
-        });
         remove = new JButton(tr("Remove"));
-        remove.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                int sel = colors.getSelectedRow();
-                del.add((String) colors.getValueAt(sel, 0));
-                tableModel.removeRow(sel);
-            }
+        remove.addActionListener(e -> {
+            int sel = colors.getSelectedRow();
+            del.add((String) colors.getValueAt(sel, 0));
+            tableModel.removeRow(sel);
         });
         remove.setEnabled(false);
@@ -233,18 +218,15 @@
         colors.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
         final TableCellRenderer oldColorsRenderer = colors.getDefaultRenderer(Object.class);
-        colors.setDefaultRenderer(Object.class, new TableCellRenderer() {
-            @Override
-            public Component getTableCellRendererComponent(JTable t, Object o, boolean selected, boolean focus, int row, int column) {
-                if (o == null)
-                    return new JLabel();
-                if (column == 1) {
-                    Color c = (Color) o;
-                    JLabel l = new JLabel(ColorHelper.color2html(c));
-                    GuiHelper.setBackgroundReadable(l, c);
-                    l.setOpaque(true);
-                    return l;
-                }
-                return oldColorsRenderer.getTableCellRendererComponent(t, getName(o.toString()), selected, focus, row, column);
-            }
+        colors.setDefaultRenderer(Object.class, (t, o, selected, focus, row, column) -> {
+            if (o == null)
+                return new JLabel();
+            if (column == 1) {
+                Color c = (Color) o;
+                JLabel l = new JLabel(ColorHelper.color2html(c));
+                GuiHelper.setBackgroundReadable(l, c);
+                l.setOpaque(true);
+                return l;
+            }
+            return oldColorsRenderer.getTableCellRendererComponent(t, getName(o.toString()), selected, focus, row, column);
         });
         colors.getColumnModel().getColumn(1).setWidth(100);
Index: trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java	(revision 10611)
@@ -5,6 +5,4 @@
 
 import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 
 import javax.swing.BorderFactory;
@@ -71,14 +69,11 @@
 
         // directionHint
-        directionHint.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if (directionHint.isSelected()) {
-                    headArrow.setSelected(Main.pref.getBoolean("draw.segment.head_only", false));
-                } else {
-                    headArrow.setSelected(false);
-                }
-                headArrow.setEnabled(directionHint.isSelected());
+        directionHint.addActionListener(e -> {
+            if (directionHint.isSelected()) {
+                headArrow.setSelected(Main.pref.getBoolean("draw.segment.head_only", false));
+            } else {
+                headArrow.setSelected(false);
             }
+            headArrow.setEnabled(directionHint.isSelected());
         });
         directionHint.setToolTipText(tr("Draw direction hints for way segments."));
Index: trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java	(revision 10611)
@@ -7,5 +7,4 @@
 import java.awt.Component;
 import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 
@@ -18,6 +17,4 @@
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
 
 import org.openstreetmap.josm.Main;
@@ -140,15 +137,12 @@
         ExpertToggleAction.addVisibilitySwitcher(drawRawGpsLinesAll);
 
-        drawRawGpsLinesActionListener = new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                boolean f = drawRawGpsLinesNone.isSelected() || drawRawGpsLinesGlobal.isSelected();
-                forceRawGpsLines.setEnabled(!f);
-                drawRawGpsMaxLineLength.setEnabled(!(f || drawRawGpsLinesLocal.isSelected()));
-                drawRawGpsMaxLineLengthLocal.setEnabled(!f);
-                drawGpsArrows.setEnabled(!f);
-                drawGpsArrowsFast.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled());
-                drawGpsArrowsMinDist.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled());
-            }
+        drawRawGpsLinesActionListener = e -> {
+            boolean f = drawRawGpsLinesNone.isSelected() || drawRawGpsLinesGlobal.isSelected();
+            forceRawGpsLines.setEnabled(!f);
+            drawRawGpsMaxLineLength.setEnabled(!(f || drawRawGpsLinesLocal.isSelected()));
+            drawRawGpsMaxLineLengthLocal.setEnabled(!f);
+            drawGpsArrows.setEnabled(!f);
+            drawGpsArrowsFast.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled());
+            drawGpsArrowsMinDist.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled());
         };
 
@@ -181,10 +175,7 @@
 
         // drawGpsArrows
-        drawGpsArrows.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                drawGpsArrowsFast.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled());
-                drawGpsArrowsMinDist.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled());
-            }
+        drawGpsArrows.addActionListener(e -> {
+            drawGpsArrowsFast.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled());
+            drawGpsArrowsMinDist.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled());
         });
         drawGpsArrows.setToolTipText(tr("Draw direction arrows for lines, connecting GPS points."));
@@ -231,17 +222,9 @@
         colorGroup.add(colorTypeTime);
 
-        colorTypeVelocity.addChangeListener(new ChangeListener() {
-            @Override
-            public void stateChanged(ChangeEvent e) {
-                colorTypeVelocityTune.setEnabled(colorTypeVelocity.isSelected());
-                colorDynamic.setEnabled(colorTypeVelocity.isSelected() || colorTypeDilution.isSelected());
-            }
+        colorTypeVelocity.addChangeListener(e -> {
+            colorTypeVelocityTune.setEnabled(colorTypeVelocity.isSelected());
+            colorDynamic.setEnabled(colorTypeVelocity.isSelected() || colorTypeDilution.isSelected());
         });
-        colorTypeDilution.addChangeListener(new ChangeListener() {
-            @Override
-            public void stateChanged(ChangeEvent e) {
-                colorDynamic.setEnabled(colorTypeVelocity.isSelected() || colorTypeDilution.isSelected());
-            }
-        });
+        colorTypeDilution.addChangeListener(e -> colorDynamic.setEnabled(colorTypeVelocity.isSelected() || colorTypeDilution.isSelected()));
 
         colorTypeNone.setToolTipText(tr("All points and track segments will have the same color. Can be customized in Layer Manager."));
@@ -283,10 +266,5 @@
             label.setLabelFor(waypointLabel);
             add(waypointLabel, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 0, 0, 5));
-            waypointLabel.addActionListener(new ActionListener() {
-                @Override
-                public void actionPerformed(ActionEvent e) {
-                    updateWaypointPattern(waypointLabel, waypointLabelPattern);
-                }
-            });
+            waypointLabel.addActionListener(e -> updateWaypointPattern(waypointLabel, waypointLabelPattern));
             updateWaypointLabelCombobox(waypointLabel, waypointLabelPattern, TemplateEntryProperty.forMarker(layerName));
             add(waypointLabelPattern, GBC.eol().fill(GBC.HORIZONTAL).insets(20, 0, 0, 5));
@@ -304,10 +282,5 @@
             label.setLabelFor(audioWaypointLabel);
             add(audioWaypointLabel, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 0, 0, 5));
-            audioWaypointLabel.addActionListener(new ActionListener() {
-                @Override
-                public void actionPerformed(ActionEvent e) {
-                    updateWaypointPattern(audioWaypointLabel, audioWaypointLabelPattern);
-                }
-            });
+            audioWaypointLabel.addActionListener(e -> updateWaypointPattern(audioWaypointLabel, audioWaypointLabelPattern));
             updateWaypointLabelCombobox(audioWaypointLabel, audioWaypointLabelPattern, TemplateEntryProperty.forAudioMarker(layerName));
             add(audioWaypointLabelPattern, GBC.eol().fill(GBC.HORIZONTAL).insets(20, 0, 0, 5));
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryPanel.java	(revision 10611)
@@ -9,6 +9,4 @@
 import javax.swing.AbstractButton;
 import javax.swing.JPanel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
@@ -56,10 +54,5 @@
 
     protected final void registerValidableComponent(AbstractButton component) {
-        component.addChangeListener(new ChangeListener() {
-            @Override
-            public void stateChanged(ChangeEvent e) {
-                notifyListeners();
-            }
-        });
+        component.addChangeListener(e -> notifyListeners());
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java	(revision 10611)
@@ -4,10 +4,4 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
 import java.io.IOException;
 import java.net.MalformedURLException;
@@ -75,82 +69,63 @@
         add(name, GBC.eop().fill());
 
-        getLayers.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                try {
-                    wms.attemptGetCapabilities(rawUrl.getText());
-                    tree.updateTree(wms);
-                    formats.setModel(new DefaultComboBoxModel<>(wms.getFormats().toArray(new String[0])));
-                    formats.setSelectedItem(wms.getPreferredFormats());
-                } catch (MalformedURLException ex) {
-                    Main.error(ex, false);
-                    JOptionPane.showMessageDialog(getParent(), tr("Invalid service URL."),
-                            tr("WMS Error"), JOptionPane.ERROR_MESSAGE);
-                } catch (IOException ex) {
-                    Main.error(ex, false);
-                    JOptionPane.showMessageDialog(getParent(), tr("Could not retrieve WMS layer list."),
-                            tr("WMS Error"), JOptionPane.ERROR_MESSAGE);
-                } catch (WMSImagery.WMSGetCapabilitiesException ex) {
-                    String incomingData = ex.getIncomingData().trim();
-                    String title = tr("WMS Error");
-                    String message = tr("Could not parse WMS layer list.");
-                    Main.error(ex, "Could not parse WMS layer list. Incoming data:\n"+incomingData);
-                    if ((incomingData.startsWith("<html>") || incomingData.startsWith("<HTML>"))
-                      && (incomingData.endsWith("</html>") || incomingData.endsWith("</HTML>"))) {
-                        GuiHelper.notifyUserHtmlError(AddWMSLayerPanel.this, title, message, incomingData);
-                    } else {
-                        if (ex.getMessage() != null) {
-                            message += '\n' + ex.getMessage();
-                        }
-                        JOptionPane.showMessageDialog(getParent(), message, title, JOptionPane.ERROR_MESSAGE);
+        getLayers.addActionListener(e -> {
+            try {
+                wms.attemptGetCapabilities(rawUrl.getText());
+                tree.updateTree(wms);
+                formats.setModel(new DefaultComboBoxModel<>(wms.getFormats().toArray(new String[0])));
+                formats.setSelectedItem(wms.getPreferredFormats());
+            } catch (MalformedURLException ex1) {
+                Main.error(ex1, false);
+                JOptionPane.showMessageDialog(getParent(), tr("Invalid service URL."),
+                        tr("WMS Error"), JOptionPane.ERROR_MESSAGE);
+            } catch (IOException ex2) {
+                Main.error(ex2, false);
+                JOptionPane.showMessageDialog(getParent(), tr("Could not retrieve WMS layer list."),
+                        tr("WMS Error"), JOptionPane.ERROR_MESSAGE);
+            } catch (WMSImagery.WMSGetCapabilitiesException ex3) {
+                String incomingData = ex3.getIncomingData().trim();
+                String title = tr("WMS Error");
+                String message = tr("Could not parse WMS layer list.");
+                Main.error(ex3, "Could not parse WMS layer list. Incoming data:\n"+incomingData);
+                if ((incomingData.startsWith("<html>") || incomingData.startsWith("<HTML>"))
+                  && (incomingData.endsWith("</html>") || incomingData.endsWith("</HTML>"))) {
+                    GuiHelper.notifyUserHtmlError(AddWMSLayerPanel.this, title, message, incomingData);
+                } else {
+                    if (ex3.getMessage() != null) {
+                        message += '\n' + ex3.getMessage();
                     }
+                    JOptionPane.showMessageDialog(getParent(), message, title, JOptionPane.ERROR_MESSAGE);
                 }
             }
         });
 
-        endpoint.addItemListener(new ItemListener() {
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                tree.getLayerTree().setEnabled(!endpoint.isSelected());
-                showBounds.setEnabled(!endpoint.isSelected());
-                wmsInstruction.setEnabled(!endpoint.isSelected());
-                formats.setEnabled(!endpoint.isSelected());
-                wmsUrl.setEnabled(!endpoint.isSelected());
-                if (endpoint.isSelected()) {
-                    URL url = wms.getServiceUrl();
-                    if (url != null) {
-                        name.setText(url.getHost());
-                    }
-                } else {
-                    onLayerSelectionChanged();
+        endpoint.addItemListener(e -> {
+            tree.getLayerTree().setEnabled(!endpoint.isSelected());
+            showBounds.setEnabled(!endpoint.isSelected());
+            wmsInstruction.setEnabled(!endpoint.isSelected());
+            formats.setEnabled(!endpoint.isSelected());
+            wmsUrl.setEnabled(!endpoint.isSelected());
+            if (endpoint.isSelected()) {
+                URL url = wms.getServiceUrl();
+                if (url != null) {
+                    name.setText(url.getHost());
                 }
-            }
-        });
-
-        tree.getLayerTree().addPropertyChangeListener("selectedLayers", new PropertyChangeListener() {
-            @Override
-            public void propertyChange(PropertyChangeEvent evt) {
+            } else {
                 onLayerSelectionChanged();
             }
         });
 
-        formats.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                onLayerSelectionChanged();
-            }
-        });
+        tree.getLayerTree().addPropertyChangeListener("selectedLayers", evt -> onLayerSelectionChanged());
 
-        showBounds.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if (tree.getSelectedLayers().get(0).bounds != null) {
-                    SlippyMapBBoxChooser mapPanel = new SlippyMapBBoxChooser();
-                    mapPanel.setBoundingBox(tree.getSelectedLayers().get(0).bounds);
-                    JOptionPane.showMessageDialog(null, mapPanel, tr("Show Bounds"), JOptionPane.PLAIN_MESSAGE);
-                } else {
-                    JOptionPane.showMessageDialog(null, tr("No bounding box was found for this layer."),
-                            tr("WMS Error"), JOptionPane.ERROR_MESSAGE);
-                }
+        formats.addActionListener(e -> onLayerSelectionChanged());
+
+        showBounds.addActionListener(e -> {
+            if (tree.getSelectedLayers().get(0).bounds != null) {
+                SlippyMapBBoxChooser mapPanel = new SlippyMapBBoxChooser();
+                mapPanel.setBoundingBox(tree.getSelectedLayers().get(0).bounds);
+                JOptionPane.showMessageDialog(null, mapPanel, tr("Show Bounds"), JOptionPane.PLAIN_MESSAGE);
+            } else {
+                JOptionPane.showMessageDialog(null, tr("No bounding box was found for this layer."),
+                        tr("WMS Error"), JOptionPane.ERROR_MESSAGE);
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/CacheContentsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/CacheContentsPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/CacheContentsPanel.java	(revision 10611)
@@ -8,5 +8,4 @@
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
@@ -51,11 +50,8 @@
     public CacheContentsPanel() {
         super(new GridBagLayout());
-        Main.worker.submit(new Runnable() {
-            @Override
-            public void run() {
-                addToPanel(TMSLayer.getCache(), "TMS");
-                addToPanel(WMSLayer.getCache(), "WMS");
-                addToPanel(WMTSLayer.getCache(), "WMTS");
-            }
+        Main.worker.submit(() -> {
+            addToPanel(TMSLayer.getCache(), "TMS");
+            addToPanel(WMSLayer.getCache(), "WMS");
+            addToPanel(WMTSLayer.getCache(), "WMTS");
         });
     }
@@ -65,15 +61,9 @@
         final TableModel tableModel = getTableModel(cache);
 
-        GuiHelper.runInEDT(new Runnable() {
-            @Override
-            public void run() {
-                add(
-                        new JLabel(tr("{0} cache, total cache size: {1} bytes", name, cacheSize)),
-                        GBC.eol().insets(5, 5, 0, 0));
-
-                add(
-                        new JScrollPane(getTableForCache(cache, tableModel)),
-                        GBC.eol().fill(GBC.BOTH));
-            }
+        GuiHelper.runInEDT(() -> {
+            add(new JLabel(tr("{0} cache, total cache size: {1} bytes", name, cacheSize)),
+                GBC.eol().insets(5, 5, 0, 0));
+            add(new JScrollPane(getTableForCache(cache, tableModel)),
+                GBC.eol().fill(GBC.BOTH));
         });
     }
@@ -88,5 +78,4 @@
                         return (Long) val;
                     }
-
                 }
             }
@@ -116,10 +105,5 @@
             sortedStats.add(new Pair<>(e.getKey(), e.getValue()[0]));
         }
-        Collections.sort(sortedStats, new Comparator<Pair<String, Integer>>() {
-            @Override
-            public int compare(Pair<String, Integer> o1, Pair<String, Integer> o2) {
-                return -1 * o1.b.compareTo(o2.b);
-            }
-        });
+        Collections.sort(sortedStats, (o1, o2) -> -1 * o1.b.compareTo(o2.b));
         String[][] ret = new String[sortedStats.size()][3];
         int index = 0;
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/CommonSettingsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/CommonSettingsPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/CommonSettingsPanel.java	(revision 10611)
@@ -6,6 +6,4 @@
 import java.awt.Color;
 import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.io.File;
 import java.io.FilenameFilter;
@@ -55,21 +53,16 @@
                 AbstractCachedTileSourceLayer.MAX_DISK_CACHE_SIZE.get().intValue(), 0, Integer.MAX_VALUE, 1));
 
-
         this.btnFadeColor = new JButton();
-
-        this.btnFadeColor.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                JColorChooser chooser = new JColorChooser(btnFadeColor.getBackground());
-                int answer = JOptionPane.showConfirmDialog(
-                        CommonSettingsPanel.this, chooser,
-                        tr("Choose a color for {0}", tr("imagery fade")),
-                        JOptionPane.OK_CANCEL_OPTION,
-                        JOptionPane.PLAIN_MESSAGE);
-                if (answer == JOptionPane.OK_OPTION) {
-                    Color colFadeColor = chooser.getColor();
-                    btnFadeColor.setBackground(colFadeColor);
-                    btnFadeColor.setText(ColorHelper.color2html(colFadeColor));
-                }
+        this.btnFadeColor.addActionListener(e -> {
+            JColorChooser chooser = new JColorChooser(btnFadeColor.getBackground());
+            int answer = JOptionPane.showConfirmDialog(
+                    CommonSettingsPanel.this, chooser,
+                    tr("Choose a color for {0}", tr("imagery fade")),
+                    JOptionPane.OK_CANCEL_OPTION,
+                    JOptionPane.PLAIN_MESSAGE);
+            if (answer == JOptionPane.OK_OPTION) {
+                Color colFadeColor = chooser.getColor();
+                btnFadeColor.setBackground(colFadeColor);
+                btnFadeColor.setText(ColorHelper.color2html(colFadeColor));
             }
         });
@@ -159,11 +152,5 @@
     private void removeCacheFiles(String path) {
         File directory = new File(path);
-        File[] cacheFiles = directory.listFiles(new FilenameFilter() {
-            @Override
-            public boolean accept(File dir, String name) {
-                return name.endsWith(".data") || name.endsWith(".key");
-            }
-
-        });
+        File[] cacheFiles = directory.listFiles((FilenameFilter) (dir, name) -> name.endsWith(".data") || name.endsWith(".key"));
         JCSCacheManager.shutdown(); // shutdown Cache - so files can by safely deleted
         for (File cacheFile: cacheFiles) {
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java	(revision 10611)
@@ -14,5 +14,4 @@
 import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.MouseEvent;
 import java.io.IOException;
@@ -41,6 +40,4 @@
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
 import javax.swing.table.DefaultTableCellRenderer;
 import javax.swing.table.DefaultTableModel;
@@ -312,21 +309,6 @@
             defaultTable = new JTable(defaultModel);
 
-            defaultModel.addTableModelListener(
-                    new TableModelListener() {
-                        @Override
-                        public void tableChanged(TableModelEvent e) {
-                            activeTable.repaint();
-                        }
-                    }
-                    );
-
-            activeModel.addTableModelListener(
-                    new TableModelListener() {
-                        @Override
-                        public void tableChanged(TableModelEvent e) {
-                            defaultTable.repaint();
-                        }
-                    }
-                    );
+            defaultModel.addTableModelListener(e -> activeTable.repaint());
+            activeModel.addTableModelListener(e -> defaultTable.repaint());
 
             TableColumnModel mod = defaultTable.getColumnModel();
@@ -839,24 +821,15 @@
             JButton add = new JButton(tr("Add"));
             buttonPanel.add(add, GBC.std().insets(0, 5, 0, 0));
-            add.addActionListener(new ActionListener() {
-                @Override
-                public void actionPerformed(ActionEvent e) {
-                    OffsetBookmark b = new OffsetBookmark(Main.getProjection().toCode(), "", "", 0, 0);
-                    model.addRow(b);
-                }
-            });
+            add.addActionListener(e -> model.addRow(new OffsetBookmark(Main.getProjection().toCode(), "", "", 0, 0)));
 
             JButton delete = new JButton(tr("Delete"));
             buttonPanel.add(delete, GBC.std().insets(0, 5, 0, 0));
-            delete.addActionListener(new ActionListener() {
-                @Override
-                public void actionPerformed(ActionEvent e) {
-                    if (list.getSelectedRow() == -1) {
-                        JOptionPane.showMessageDialog(gui, tr("Please select the row to delete."));
-                    } else {
-                        Integer i;
-                        while ((i = list.getSelectedRow()) != -1) {
-                            model.removeRow(i);
-                        }
+            delete.addActionListener(e -> {
+                if (list.getSelectedRow() == -1) {
+                    JOptionPane.showMessageDialog(gui, tr("Please select the row to delete."));
+                } else {
+                    Integer i;
+                    while ((i = list.getSelectedRow()) != -1) {
+                        model.removeRow(i);
                     }
                 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java	(revision 10611)
@@ -5,5 +5,4 @@
 
 import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 
@@ -101,13 +100,10 @@
         panel.add(notification, GBC.eop());
 
-        ActionListener autosaveEnabled = new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                boolean enabled = autosave.isSelected();
-                autosaveIntervalLabel.setEnabled(enabled);
-                autosaveInterval.setEnabled(enabled);
-                backupPerLayerLabel.setEnabled(enabled);
-                backupPerLayer.setEnabled(enabled);
-            }
+        ActionListener autosaveEnabled = e -> {
+            boolean enabled = autosave.isSelected();
+            autosaveIntervalLabel.setEnabled(enabled);
+            autosaveInterval.setEnabled(enabled);
+            backupPerLayerLabel.setEnabled(enabled);
+            backupPerLayer.setEnabled(enabled);
         };
         autosave.addActionListener(autosaveEnabled);
Index: trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java	(revision 10611)
@@ -33,5 +33,4 @@
 import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting;
 import org.openstreetmap.josm.tools.GBC;
-import org.openstreetmap.josm.tools.Predicate;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -233,11 +232,5 @@
             int insertionIdx = 0;
             for (final SourceEntry def : defaults) {
-                int i = Utils.indexOf(list,
-                        new Predicate<SourceEntry>() {
-                    @Override
-                    public boolean evaluate(SourceEntry se) {
-                        return Objects.equals(def.url, se.url);
-                    }
-                });
+                int i = Utils.indexOf(list, se -> Objects.equals(def.url, se.url));
                 if (i == -1 && !knownDefaults.contains(def.url)) {
                     def.active = false;
@@ -255,10 +248,5 @@
 
             // XML style is not bundled anymore
-            list.remove(Utils.find(list, new Predicate<SourceEntry>() {
-                            @Override
-                            public boolean evaluate(SourceEntry se) {
-                                return "resource://styles/standard/elemstyles.xml".equals(se.url);
-                            }
-                        }));
+            list.remove(Utils.find(list, se -> "resource://styles/standard/elemstyles.xml".equals(se.url)));
 
             return changed;
Index: trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java	(revision 10611)
@@ -15,7 +15,5 @@
 import javax.swing.SwingConstants;
 import javax.swing.SwingUtilities;
-import javax.swing.event.HyperlinkEvent;
 import javax.swing.event.HyperlinkEvent.EventType;
-import javax.swing.event.HyperlinkListener;
 
 import org.openstreetmap.josm.gui.widgets.HtmlPanel;
@@ -151,10 +149,7 @@
             HtmlPanel description = new HtmlPanel();
             description.setText(pi.getDescriptionAsHtml());
-            description.getEditorPane().addHyperlinkListener(new HyperlinkListener() {
-                @Override
-                public void hyperlinkUpdate(HyperlinkEvent e) {
-                    if (e.getEventType() == EventType.ACTIVATED) {
-                        OpenBrowser.displayUrl(e.getURL().toString());
-                    }
+            description.getEditorPane().addHyperlinkListener(e -> {
+                if (e.getEventType() == EventType.ACTIVATED) {
+                    OpenBrowser.displayUrl(e.getURL().toString());
                 }
             });
@@ -170,10 +165,5 @@
         repaint();
         if (visibleRect != null && visibleRect.width > 0 && visibleRect.height > 0) {
-            SwingUtilities.invokeLater(new Runnable() {
-                @Override
-                public void run() {
-                    scrollRectToVisible(visibleRect);
-                }
-            });
+            SwingUtilities.invokeLater(() -> scrollRectToVisible(visibleRect));
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java	(revision 10611)
@@ -150,16 +150,11 @@
         sb.append("</html>");
         if (!GraphicsEnvironment.isHeadless()) {
-            GuiHelper.runInEDTAndWait(new Runnable() {
-                @Override
-                public void run() {
-                    HelpAwareOptionPane.showOptionDialog(
-                            parent,
-                            sb.toString(),
-                            tr("Update plugins"),
-                            !failed.isEmpty() ? JOptionPane.WARNING_MESSAGE : JOptionPane.INFORMATION_MESSAGE,
-                                    HelpUtil.ht("/Preferences/Plugins")
-                            );
-                }
-            });
+            GuiHelper.runInEDTAndWait(() -> HelpAwareOptionPane.showOptionDialog(
+                    parent,
+                    sb.toString(),
+                    tr("Update plugins"),
+                    !failed.isEmpty() ? JOptionPane.WARNING_MESSAGE : JOptionPane.INFORMATION_MESSAGE,
+                            HelpUtil.ht("/Preferences/Plugins")
+                    ));
         }
     }
@@ -318,16 +313,10 @@
     public void readLocalPluginInformation() {
         final ReadLocalPluginInformationTask task = new ReadLocalPluginInformationTask();
-        Runnable r = new Runnable() {
-            @Override
-            public void run() {
-                if (!task.isCanceled()) {
-                    SwingUtilities.invokeLater(new Runnable() {
-                        @Override
-                        public void run() {
-                            model.setAvailablePlugins(task.getAvailablePlugins());
-                            pnlPluginPreferences.refreshView();
-                        }
-                    });
-                }
+        Runnable r = () -> {
+            if (!task.isCanceled()) {
+                SwingUtilities.invokeLater(() -> {
+                    model.setAvailablePlugins(task.getAvailablePlugins());
+                    pnlPluginPreferences.refreshView();
+                });
             }
         };
@@ -357,17 +346,11 @@
             }
             final ReadRemotePluginInformationTask task = new ReadRemotePluginInformationTask(pluginSites);
-            Runnable continuation = new Runnable() {
-                @Override
-                public void run() {
-                    if (!task.isCanceled()) {
-                        SwingUtilities.invokeLater(new Runnable() {
-                            @Override
-                            public void run() {
-                                model.updateAvailablePlugins(task.getAvailablePlugins());
-                                pnlPluginPreferences.refreshView();
-                                Main.pref.putInteger("pluginmanager.version", Version.getInstance().getVersion()); // fix #7030
-                            }
-                        });
-                    }
+            Runnable continuation = () -> {
+                if (!task.isCanceled()) {
+                    SwingUtilities.invokeLater(() -> {
+                        model.updateAvailablePlugins(task.getAvailablePlugins());
+                        pnlPluginPreferences.refreshView();
+                        Main.pref.putInteger("pluginmanager.version", Version.getInstance().getVersion()); // fix #7030
+                    });
                 }
             };
@@ -389,16 +372,11 @@
         protected void alertNothingToUpdate() {
             try {
-                SwingUtilities.invokeAndWait(new Runnable() {
-                    @Override
-                    public void run() {
-                        HelpAwareOptionPane.showOptionDialog(
-                                pnlPluginPreferences,
-                                tr("All installed plugins are up to date. JOSM does not have to download newer versions."),
-                                tr("Plugins up to date"),
-                                JOptionPane.INFORMATION_MESSAGE,
-                                null // FIXME: provide help context
-                                );
-                    }
-                });
+                SwingUtilities.invokeAndWait(() -> HelpAwareOptionPane.showOptionDialog(
+                        pnlPluginPreferences,
+                        tr("All installed plugins are up to date. JOSM does not have to download newer versions."),
+                        tr("Plugins up to date"),
+                        JOptionPane.INFORMATION_MESSAGE,
+                        null // FIXME: provide help context
+                        ));
             } catch (InterruptedException | InvocationTargetException e) {
                 Main.error(e);
@@ -421,53 +399,42 @@
             // to be run asynchronously after the plugin download
             //
-            final Runnable pluginDownloadContinuation = new Runnable() {
-                @Override
-                public void run() {
-                    if (pluginDownloadTask.isCanceled())
-                        return;
-                    boolean restartRequired = false;
-                    for (PluginInformation pi : pluginDownloadTask.getDownloadedPlugins()) {
-                        if (!model.getNewlyActivatedPlugins().contains(pi) || !pi.canloadatruntime) {
-                            restartRequired = true;
-                            break;
-                        }
-                    }
-                    notifyDownloadResults(pnlPluginPreferences, pluginDownloadTask, restartRequired);
-                    model.refreshLocalPluginVersion(pluginDownloadTask.getDownloadedPlugins());
-                    model.clearPendingPlugins(pluginDownloadTask.getDownloadedPlugins());
-                    GuiHelper.runInEDT(new Runnable() {
-                        @Override
-                        public void run() {
-                            pnlPluginPreferences.refreshView();
-                        }
-                    });
-                }
+            final Runnable pluginDownloadContinuation = () -> {
+                if (pluginDownloadTask.isCanceled())
+                    return;
+                boolean restartRequired = false;
+                for (PluginInformation pi : pluginDownloadTask.getDownloadedPlugins()) {
+                    if (!model.getNewlyActivatedPlugins().contains(pi) || !pi.canloadatruntime) {
+                        restartRequired = true;
+                        break;
+                    }
+                }
+                notifyDownloadResults(pnlPluginPreferences, pluginDownloadTask, restartRequired);
+                model.refreshLocalPluginVersion(pluginDownloadTask.getDownloadedPlugins());
+                model.clearPendingPlugins(pluginDownloadTask.getDownloadedPlugins());
+                GuiHelper.runInEDT(pnlPluginPreferences::refreshView);
             };
 
             // to be run asynchronously after the plugin list download
             //
-            final Runnable pluginInfoDownloadContinuation = new Runnable() {
-                @Override
-                public void run() {
-                    if (pluginInfoDownloadTask.isCanceled())
-                        return;
-                    model.updateAvailablePlugins(pluginInfoDownloadTask.getAvailablePlugins());
-                    // select plugins which actually have to be updated
-                    //
-                    Iterator<PluginInformation> it = toUpdate.iterator();
-                    while (it.hasNext()) {
-                        PluginInformation pi = it.next();
-                        if (!pi.isUpdateRequired()) {
-                            it.remove();
-                        }
-                    }
-                    if (toUpdate.isEmpty()) {
-                        alertNothingToUpdate();
-                        return;
-                    }
-                    pluginDownloadTask.setPluginsToDownload(toUpdate);
-                    Main.worker.submit(pluginDownloadTask);
-                    Main.worker.submit(pluginDownloadContinuation);
-                }
+            final Runnable pluginInfoDownloadContinuation = () -> {
+                if (pluginInfoDownloadTask.isCanceled())
+                    return;
+                model.updateAvailablePlugins(pluginInfoDownloadTask.getAvailablePlugins());
+                // select plugins which actually have to be updated
+                //
+                Iterator<PluginInformation> it = toUpdate.iterator();
+                while (it.hasNext()) {
+                    PluginInformation pi = it.next();
+                    if (!pi.isUpdateRequired()) {
+                        it.remove();
+                    }
+                }
+                if (toUpdate.isEmpty()) {
+                    alertNothingToUpdate();
+                    return;
+                }
+                pluginDownloadTask.setPluginsToDownload(toUpdate);
+                Main.worker.submit(pluginDownloadTask);
+                Main.worker.submit(pluginDownloadContinuation);
             };
 
@@ -476,5 +443,4 @@
         }
     }
-
 
     /**
@@ -509,15 +475,15 @@
 
         @Override
-        public void changedUpdate(DocumentEvent arg0) {
+        public void changedUpdate(DocumentEvent evt) {
             filter();
         }
 
         @Override
-        public void insertUpdate(DocumentEvent arg0) {
+        public void insertUpdate(DocumentEvent evt) {
             filter();
         }
 
         @Override
-        public void removeUpdate(DocumentEvent arg0) {
+        public void removeUpdate(DocumentEvent evt) {
             filter();
         }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java	(revision 10611)
@@ -6,5 +6,4 @@
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -150,11 +149,8 @@
         Collections.sort(
                 availablePlugins,
-                new Comparator<PluginInformation>() {
-                    @Override
-                    public int compare(PluginInformation o1, PluginInformation o2) {
-                        String n1 = o1.getName() == null ? "" : o1.getName().toLowerCase(Locale.ENGLISH);
-                        String n2 = o2.getName() == null ? "" : o2.getName().toLowerCase(Locale.ENGLISH);
-                        return n1.compareTo(n2);
-                    }
+                (o1, o2) -> {
+                    String n1 = o1.getName() == null ? "" : o1.getName().toLowerCase(Locale.ENGLISH);
+                    String n2 = o2.getName() == null ? "" : o2.getName().toLowerCase(Locale.ENGLISH);
+                    return n1.compareTo(n2);
                 }
         );
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java	(revision 10611)
@@ -7,5 +7,4 @@
 import java.awt.GridBagLayout;
 import java.awt.Insets;
-import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.util.Arrays;
@@ -113,21 +112,13 @@
 
             JButton btnCheck = new JButton(tr("Validate"));
-            btnCheck.addActionListener(new ActionListener() {
-                @Override
-                public void actionPerformed(ActionEvent e) {
-                    val.validate();
-                }
-            });
+            btnCheck.addActionListener(e -> val.validate());
             btnCheck.setLayout(new BorderLayout());
             btnCheck.setMargin(new Insets(-1, 0, -1, 0));
 
             JButton btnInfo = new JButton(tr("Parameter information..."));
-            btnInfo.addActionListener(new ActionListener() {
-                @Override
-                public void actionPerformed(ActionEvent e) {
-                    CustomProjectionChoice.ParameterInfoDialog dlg = new CustomProjectionChoice.ParameterInfoDialog();
-                    dlg.showDialog();
-                    dlg.toFront();
-                }
+            btnInfo.addActionListener(e -> {
+                CustomProjectionChoice.ParameterInfoDialog dlg = new CustomProjectionChoice.ParameterInfoDialog();
+                dlg.showDialog();
+                dlg.toFront();
             });
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java	(revision 10611)
@@ -6,5 +6,4 @@
 import java.awt.Component;
 import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.util.ArrayList;
@@ -449,10 +448,5 @@
             return;
 
-        final ActionListener listener = new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                updateMeta(pc);
-            }
-        };
+        final ActionListener listener = e -> updateMeta(pc);
 
         // Replace old panel with new one
@@ -485,10 +479,7 @@
             throw new RuntimeException("Couldn't find the current projection in the list of available projections!");
 
-        projectionCombo.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                ProjectionChoice pc = (ProjectionChoice) projectionCombo.getSelectedItem();
-                selectedProjectionChanged(pc);
-            }
+        projectionCombo.addActionListener(e -> {
+            ProjectionChoice pc1 = (ProjectionChoice) projectionCombo.getSelectedItem();
+            selectedProjectionChanged(pc1);
         });
         return pc;
Index: trunk/src/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreference.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreference.java	(revision 10611)
@@ -7,5 +7,4 @@
 import java.awt.Font;
 import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.io.IOException;
@@ -120,44 +119,33 @@
             wrapper.add(installCertificate, GBC.std().insets(5, 5, 0, 0));
             wrapper.add(uninstallCertificate, GBC.eol().insets(5, 5, 0, 0));
-            enableHttpsSupport.addActionListener(new ActionListener() {
-                @Override
-                public void actionPerformed(ActionEvent e) {
-                    installCertificate.setEnabled(enableHttpsSupport.isSelected());
+            enableHttpsSupport.addActionListener(e -> installCertificate.setEnabled(enableHttpsSupport.isSelected()));
+            installCertificate.addActionListener(e -> {
+                try {
+                    boolean changed = RemoteControlHttpsServer.setupPlatform(
+                            RemoteControlHttpsServer.loadJosmKeystore());
+                    String msg = changed ?
+                            tr("Certificate has been successfully installed.") :
+                            tr("Certificate is already installed. Nothing to do.");
+                    Main.info(msg);
+                    JOptionPane.showMessageDialog(wrapper, msg);
+                } catch (IOException | GeneralSecurityException ex) {
+                    Main.error(ex);
                 }
             });
-            installCertificate.addActionListener(new ActionListener() {
-                @Override
-                public void actionPerformed(ActionEvent e) {
-                    try {
-                        boolean changed = RemoteControlHttpsServer.setupPlatform(
-                                RemoteControlHttpsServer.loadJosmKeystore());
-                        String msg = changed ?
-                                tr("Certificate has been successfully installed.") :
-                                tr("Certificate is already installed. Nothing to do.");
-                        Main.info(msg);
-                        JOptionPane.showMessageDialog(wrapper, msg);
-                    } catch (IOException | GeneralSecurityException ex) {
-                        Main.error(ex);
+            uninstallCertificate.addActionListener(e -> {
+                try {
+                    String msg;
+                    KeyStore ks = PlatformHookWindows.getRootKeystore();
+                    if (ks.containsAlias(RemoteControlHttpsServer.ENTRY_ALIAS)) {
+                        Main.info(tr("Removing certificate {0} from root keystore.", RemoteControlHttpsServer.ENTRY_ALIAS));
+                        ks.deleteEntry(RemoteControlHttpsServer.ENTRY_ALIAS);
+                        msg = tr("Certificate has been successfully uninstalled.");
+                    } else {
+                        msg = tr("Certificate is not installed. Nothing to do.");
                     }
-                }
-            });
-            uninstallCertificate.addActionListener(new ActionListener() {
-                @Override
-                public void actionPerformed(ActionEvent e) {
-                    try {
-                        String msg;
-                        KeyStore ks = PlatformHookWindows.getRootKeystore();
-                        if (ks.containsAlias(RemoteControlHttpsServer.ENTRY_ALIAS)) {
-                            Main.info(tr("Removing certificate {0} from root keystore.", RemoteControlHttpsServer.ENTRY_ALIAS));
-                            ks.deleteEntry(RemoteControlHttpsServer.ENTRY_ALIAS);
-                            msg = tr("Certificate has been successfully uninstalled.");
-                        } else {
-                            msg = tr("Certificate is not installed. Nothing to do.");
-                        }
-                        Main.info(msg);
-                        JOptionPane.showMessageDialog(wrapper, msg);
-                    } catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | IOException ex) {
-                        Main.error(ex);
-                    }
+                    Main.info(msg);
+                    JOptionPane.showMessageDialog(wrapper, msg);
+                } catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | IOException ex) {
+                    Main.error(ex);
                 }
             });
@@ -181,17 +169,13 @@
         alwaysAskUserConfirm.setSelected(Main.pref.getBoolean(RequestHandler.globalConfirmationKey, RequestHandler.globalConfirmationDefault));
 
-        ActionListener remoteControlEnabled = new ActionListener() {
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                GuiHelper.setEnabledRec(wrapper, enableRemoteControl.isSelected());
-                // 'setEnabled(false)' does not work for JLabel with html text, so do it manually
-                // FIXME: use QuadStateCheckBox to make checkboxes unset when disabled
-                if (installCertificate != null && uninstallCertificate != null) {
-                    // Install certificate button is enabled if HTTPS is also enabled
-                    installCertificate.setEnabled(enableRemoteControl.isSelected() && enableHttpsSupport.isSelected());
-                    // Uninstall certificate button is always enabled
-                    uninstallCertificate.setEnabled(true);
-                }
+        ActionListener remoteControlEnabled = e -> {
+            GuiHelper.setEnabledRec(wrapper, enableRemoteControl.isSelected());
+            // 'setEnabled(false)' does not work for JLabel with html text, so do it manually
+            // FIXME: use QuadStateCheckBox to make checkboxes unset when disabled
+            if (installCertificate != null && uninstallCertificate != null) {
+                // Install certificate button is enabled if HTTPS is also enabled
+                installCertificate.setEnabled(enableRemoteControl.isSelected() && enableHttpsSupport.isSelected());
+                // Uninstall certificate button is always enabled
+                uninstallCertificate.setEnabled(true);
             }
         };
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/FeaturesPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/FeaturesPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/FeaturesPanel.java	(revision 10611)
@@ -10,6 +10,4 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
 
 import org.openstreetmap.josm.actions.downloadtasks.DownloadNotesTask;
@@ -44,10 +42,5 @@
         notifier = new JCheckBox(tr("Periodically check for new messages"));
         add(notifier, GBC.eol());
-        notifier.addChangeListener(new ChangeListener() {
-            @Override
-            public void stateChanged(ChangeEvent e) {
-                updateEnabledState();
-            }
-        });
+        notifier.addChangeListener(e -> updateEnabledState());
 
         intervalLabel = new JLabel(tr("Check interval (minutes):"));
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java	(revision 10611)
@@ -13,5 +13,4 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
@@ -78,10 +77,5 @@
         cbShowAdvancedParameters.setSelected(false);
         cbShowAdvancedParameters.addItemListener(
-                new ItemListener() {
-                    @Override
-                    public void itemStateChanged(ItemEvent evt) {
-                        pnlAdvancedProperties.setVisible(evt.getStateChange() == ItemEvent.SELECTED);
-                    }
-                }
+                evt -> pnlAdvancedProperties.setVisible(evt.getStateChange() == ItemEvent.SELECTED)
         );
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java	(revision 10611)
@@ -186,25 +186,19 @@
             final ApiUrlTestTask task = new ApiUrlTestTask(OsmApiUrlInputPanel.this, url);
             Main.worker.submit(task);
-            Runnable r = new Runnable() {
-                @Override
-                public void run() {
-                    if (task.isCanceled())
-                        return;
-                    Runnable r = new Runnable() {
-                        @Override
-                        public void run() {
-                            if (task.isSuccess()) {
-                                lblValid.setIcon(ImageProvider.get("dialogs", "valid"));
-                                lblValid.setToolTipText(tr("The API URL is valid."));
-                                lastTestedUrl = url;
-                                updateEnabledState();
-                            } else {
-                                lblValid.setIcon(ImageProvider.get("warning-small"));
-                                lblValid.setToolTipText(tr("Validation failed. The API URL seems to be invalid."));
-                            }
-                        }
-                    };
-                    SwingUtilities.invokeLater(r);
-                }
+            Runnable r = () -> {
+                if (task.isCanceled())
+                    return;
+                Runnable r1 = () -> {
+                    if (task.isSuccess()) {
+                        lblValid.setIcon(ImageProvider.get("dialogs", "valid"));
+                        lblValid.setToolTipText(tr("The API URL is valid."));
+                        lastTestedUrl = url;
+                        updateEnabledState();
+                    } else {
+                        lblValid.setIcon(ImageProvider.get("warning-small"));
+                        lblValid.setToolTipText(tr("Validation failed. The API URL seems to be invalid."));
+                    }
+                };
+                SwingUtilities.invokeLater(r1);
             };
             Main.worker.submit(r);
Index: trunk/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreference.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreference.java	(revision 10611)
@@ -5,5 +5,4 @@
 
 import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.util.ArrayList;
@@ -76,10 +75,5 @@
         testPanel.add(prefOtherUpload, GBC.eol());
 
-        ActionListener otherUploadEnabled = new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                prefOtherUpload.setEnabled(prefOther.isSelected());
-            }
-        };
+        ActionListener otherUploadEnabled = e -> prefOtherUpload.setEnabled(prefOther.isSelected());
         prefOther.addActionListener(otherUploadEnabled);
         otherUploadEnabled.actionPerformed(null);
Index: trunk/src/org/openstreetmap/josm/gui/progress/PleaseWaitProgressMonitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/progress/PleaseWaitProgressMonitor.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/progress/PleaseWaitProgressMonitor.java	(revision 10611)
@@ -4,5 +4,4 @@
 import java.awt.Component;
 import java.awt.GraphicsEnvironment;
-import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.WindowAdapter;
@@ -139,20 +138,12 @@
     }
 
-    private final ActionListener cancelListener = new ActionListener() {
-        @Override
-        public void actionPerformed(ActionEvent e) {
-            cancel();
-        }
-    };
-
-    private final ActionListener inBackgroundListener = new ActionListener() {
-        @Override
-        public void actionPerformed(ActionEvent e) {
-            isInBackground = true;
-            ProgressMonitorDialog dialog = getDialog();
-            if (dialog != null) {
-                reset();
-                dialog.setVisible(true);
-            }
+    private final ActionListener cancelListener = e -> cancel();
+
+    private final ActionListener inBackgroundListener = e -> {
+        isInBackground = true;
+        ProgressMonitorDialog dlg = getDialog();
+        if (dlg != null) {
+            reset();
+            dlg.setVisible(true);
         }
     };
@@ -174,27 +165,24 @@
     @Override
     public void doBeginTask() {
-        doInEDT(new Runnable() {
-            @Override
-            public void run() {
-                Main.currentProgressMonitor = PleaseWaitProgressMonitor.this;
-                if (GraphicsEnvironment.isHeadless()) {
-                    return;
-                }
-                if (dialogParent != null && dialog == null) {
-                    dialog = new PleaseWaitDialog(dialogParent);
-                } else
-                    throw new ProgressException("PleaseWaitDialog parent must be set");
-
-                if (windowTitle != null) {
-                    dialog.setTitle(windowTitle);
-                }
-                dialog.setCancelEnabled(cancelable);
-                dialog.setCancelCallback(cancelListener);
-                dialog.setInBackgroundCallback(inBackgroundListener);
-                dialog.setCustomText("");
-                dialog.addWindowListener(windowListener);
-                dialog.progress.setMaximum(PROGRESS_BAR_MAX);
-                dialog.setVisible(true);
-            }
+        doInEDT(() -> {
+            Main.currentProgressMonitor = PleaseWaitProgressMonitor.this;
+            if (GraphicsEnvironment.isHeadless()) {
+                return;
+            }
+            if (dialogParent != null && dialog == null) {
+                dialog = new PleaseWaitDialog(dialogParent);
+            } else
+                throw new ProgressException("PleaseWaitDialog parent must be set");
+
+            if (windowTitle != null) {
+                dialog.setTitle(windowTitle);
+            }
+            dialog.setCancelEnabled(cancelable);
+            dialog.setCancelCallback(cancelListener);
+            dialog.setInBackgroundCallback(inBackgroundListener);
+            dialog.setCustomText("");
+            dialog.addWindowListener(windowListener);
+            dialog.progress.setMaximum(PROGRESS_BAR_MAX);
+            dialog.setVisible(true);
         });
     }
@@ -210,11 +198,8 @@
         if (newValue != currentProgressValue) {
             currentProgressValue = newValue;
-            doInEDT(new Runnable() {
-                @Override
-                public void run() {
-                    ProgressMonitorDialog dialog = getDialog();
-                    if (dialog != null) {
-                        dialog.updateProgress(currentProgressValue);
-                    }
+            doInEDT(() -> {
+                ProgressMonitorDialog dlg = getDialog();
+                if (dlg != null) {
+                    dlg.updateProgress(currentProgressValue);
                 }
             });
@@ -226,11 +211,8 @@
         checkState(State.IN_TASK, State.IN_SUBTASK);
         this.customText = title;
-        doInEDT(new Runnable() {
-            @Override
-            public void run() {
-                ProgressMonitorDialog dialog = getDialog();
-                if (dialog != null) {
-                    dialog.setCustomText(title);
-                }
+        doInEDT(() -> {
+            ProgressMonitorDialog dlg = getDialog();
+            if (dlg != null) {
+                dlg.setCustomText(title);
             }
         });
@@ -241,11 +223,8 @@
         checkState(State.IN_TASK, State.IN_SUBTASK);
         this.title = title;
-        doInEDT(new Runnable() {
-            @Override
-            public void run() {
-                ProgressMonitorDialog dialog = getDialog();
-                if (dialog != null) {
-                    dialog.setCurrentAction(title);
-                }
+        doInEDT(() -> {
+            ProgressMonitorDialog dlg = getDialog();
+            if (dlg != null) {
+                dlg.setCurrentAction(title);
             }
         });
@@ -255,13 +234,10 @@
     protected void doSetIntermediate(final boolean value) {
         this.indeterminate = value;
-        doInEDT(new Runnable() {
-            @Override
-            public void run() {
-                // Enable only if progress is at the beginning. Doing intermediate progress in the middle
-                // will hide already reached progress
-                ProgressMonitorDialog dialog = getDialog();
-                if (dialog != null) {
-                    dialog.setIndeterminate(value && currentProgressValue == 0);
-                }
+        doInEDT(() -> {
+            // Enable only if progress is at the beginning. Doing intermediate progress in the middle
+            // will hide already reached progress
+            ProgressMonitorDialog dlg = getDialog();
+            if (dlg != null) {
+                dlg.setIndeterminate(value && currentProgressValue == 0);
             }
         });
@@ -270,11 +246,8 @@
     @Override
     public void appendLogMessage(final String message) {
-        doInEDT(new Runnable() {
-            @Override
-            public void run() {
-                ProgressMonitorDialog dialog = getDialog();
-                if (dialog != null) {
-                    dialog.appendLogMessage(message);
-                }
+        doInEDT(() -> {
+            ProgressMonitorDialog dlg = getDialog();
+            if (dlg != null) {
+                dlg.appendLogMessage(message);
             }
         });
@@ -299,23 +272,19 @@
             backgroundMonitor.setIndeterminate(indeterminate && currentProgressValue == 0);
         }
-
     }
 
     public void close() {
-        doInEDT(new Runnable() {
-            @Override
-            public void run() {
-                if (dialog != null) {
-                    dialog.setVisible(false);
-                    dialog.setCancelCallback(null);
-                    dialog.setInBackgroundCallback(null);
-                    dialog.removeWindowListener(windowListener);
-                    dialog.dispose();
-                    dialog = null;
-                    Main.currentProgressMonitor = null;
-                    MapFrame map = Main.map;
-                    if (map != null) {
-                        map.statusLine.progressMonitor.setVisible(false);
-                    }
+        doInEDT(() -> {
+            if (dialog != null) {
+                dialog.setVisible(false);
+                dialog.setCancelCallback(null);
+                dialog.setInBackgroundCallback(null);
+                dialog.removeWindowListener(windowListener);
+                dialog.dispose();
+                dialog = null;
+                Main.currentProgressMonitor = null;
+                MapFrame map = Main.map;
+                if (map != null) {
+                    map.statusLine.progressMonitor.setVisible(false);
                 }
             }
@@ -325,15 +294,11 @@
     public void showForegroundDialog() {
         isInBackground = false;
-        doInEDT(new Runnable() {
-            @Override
-            public void run() {
-                if (dialog != null) {
-                    dialog.setInBackgroundPossible(PleaseWaitProgressMonitor.this.taskId != null && Main.isDisplayingMapView());
-                    reset();
-                    getDialog();
-                }
-            }
-        });
-
+        doInEDT(() -> {
+            if (dialog != null) {
+                dialog.setInBackgroundPossible(PleaseWaitProgressMonitor.this.taskId != null && Main.isDisplayingMapView());
+                reset();
+                getDialog();
+            }
+        });
     }
 
@@ -341,10 +306,7 @@
     public void setProgressTaskId(ProgressTaskId taskId) {
         this.taskId = taskId;
-        doInEDT(new Runnable() {
-            @Override
-            public void run() {
-                if (dialog != null) {
-                    dialog.setInBackgroundPossible(PleaseWaitProgressMonitor.this.taskId != null && Main.isDisplayingMapView());
-                }
+        doInEDT(() -> {
+            if (dialog != null) {
+                dialog.setInBackgroundPossible(PleaseWaitProgressMonitor.this.taskId != null && Main.isDisplayingMapView());
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/progress/SwingRenderingProgressMonitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/progress/SwingRenderingProgressMonitor.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/progress/SwingRenderingProgressMonitor.java	(revision 10611)
@@ -32,10 +32,7 @@
     @Override
     public void doBeginTask() {
-        GuiHelper.runInEDT(new Runnable() {
-            @Override
-            public void run() {
-                delegate.setCustomText("");
-                delegate.setMaximum(PROGRESS_BAR_MAX);
-            }
+        GuiHelper.runInEDT(() -> {
+            delegate.setCustomText("");
+            delegate.setMaximum(PROGRESS_BAR_MAX);
         });
     }
@@ -51,10 +48,5 @@
         if (newValue != currentProgressValue) {
             currentProgressValue = newValue;
-            GuiHelper.runInEDT(new Runnable() {
-                @Override
-                public void run() {
-                    delegate.setValue(currentProgressValue);
-                }
-            });
+            GuiHelper.runInEDT(() -> delegate.setValue(currentProgressValue));
         }
     }
@@ -63,10 +55,5 @@
     protected void doSetCustomText(final String title) {
         checkState(State.IN_TASK, State.IN_SUBTASK);
-        GuiHelper.runInEDT(new Runnable() {
-            @Override
-            public void run() {
-                delegate.setCustomText(title);
-            }
-        });
+        GuiHelper.runInEDT(() -> delegate.setCustomText(title));
     }
 
@@ -74,20 +61,10 @@
     protected void doSetTitle(final String title) {
         checkState(State.IN_TASK, State.IN_SUBTASK);
-        GuiHelper.runInEDT(new Runnable() {
-            @Override
-            public void run() {
-                delegate.setTaskTitle(title);
-            }
-        });
+        GuiHelper.runInEDT(() -> delegate.setTaskTitle(title));
     }
 
     @Override
     protected void doSetIntermediate(final boolean value) {
-        GuiHelper.runInEDT(new Runnable() {
-            @Override
-            public void run() {
-                delegate.setIndeterminate(value);
-            }
-        });
+        GuiHelper.runInEDT(() -> delegate.setIndeterminate(value));
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java	(revision 10611)
@@ -9,5 +9,4 @@
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.EnumSet;
 import java.util.HashMap;
@@ -563,13 +562,5 @@
      */
     protected void sort() {
-        Collections.sort(
-                tags,
-                new Comparator<TagModel>() {
-                    @Override
-                    public int compare(TagModel self, TagModel other) {
-                        return self.getName().compareTo(other.getName());
-                    }
-                }
-        );
+        Collections.sort(tags, (self, other) -> self.getName().compareTo(other.getName()));
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorPanel.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorPanel.java	(revision 10611)
@@ -15,6 +15,4 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
 
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -125,10 +123,5 @@
 
         if (presetHandler != null) {
-            model.addTableModelListener(new TableModelListener() {
-                @Override
-                public void tableChanged(TableModelEvent e) {
-                    updatePresets();
-                }
-            });
+            model.addTableModelListener(e -> updatePresets());
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java	(revision 10611)
@@ -38,4 +38,5 @@
 import org.openstreetmap.josm.tools.MultiMap;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.tools.Utils.Function;
 
 /**
@@ -336,9 +337,5 @@
             for (TaggingPreset tp : presets) {
                 if (tp.roles != null) {
-                    list.add(Utils.transform(tp.roles.roles, new Utils.Function<Role, String>() {
-                        public String apply(Role x) {
-                            return x.key;
-                        }
-                    }), AutoCompletionItemPriority.IS_IN_STANDARD);
+                    list.add(Utils.transform(tp.roles.roles, (Function<Role, String>) x -> x.key), AutoCompletionItemPriority.IS_IN_STANDARD);
                 }
             }
Index: trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java	(revision 10611)
@@ -59,5 +59,5 @@
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
-import org.openstreetmap.josm.tools.ImageResource;
+import org.openstreetmap.josm.tools.ImageProvider.ImageResourceCallback;
 import org.openstreetmap.josm.tools.Predicate;
 import org.openstreetmap.josm.tools.Utils;
@@ -204,12 +204,9 @@
         imgProv.setArchive(arch);
         imgProv.setOptional(true);
-        imgProv.getInBackground(new ImageProvider.ImageResourceCallback() {
-            @Override
-            public void finished(final ImageResource result) {
-                if (result != null) {
-                    GuiHelper.runInEDT(() -> result.attachImageIcon(TaggingPreset.this));
-                } else {
-                    Main.warn(TaggingPreset.this + ": " + PRESET_ICON_ERROR_MSG_PREFIX + iconName);
-                }
+        imgProv.getInBackground((ImageResourceCallback) result -> {
+            if (result != null) {
+                GuiHelper.runInEDT(() -> result.attachImageIcon(TaggingPreset.this));
+            } else {
+                Main.warn(TaggingPreset.this + ": " + PRESET_ICON_ERROR_MSG_PREFIX + iconName);
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/util/AdjustmentSynchronizer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/util/AdjustmentSynchronizer.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/util/AdjustmentSynchronizer.java	(revision 10611)
@@ -8,5 +8,4 @@
 import java.awt.event.AdjustmentListener;
 import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -15,6 +14,4 @@
 
 import javax.swing.JCheckBox;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
 
 import org.openstreetmap.josm.tools.CheckParameterUtil;
@@ -125,34 +122,26 @@
         // register an item lister with the check box
         //
-        view.addItemListener(new ItemListener() {
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                switch(e.getStateChange()) {
-                case ItemEvent.SELECTED:
-                    if (!isParticipatingInSynchronizedScrolling(adjustable)) {
-                        setParticipatingInSynchronizedScrolling(adjustable, true);
-                    }
-                    break;
-                case ItemEvent.DESELECTED:
-                    if (isParticipatingInSynchronizedScrolling(adjustable)) {
-                        setParticipatingInSynchronizedScrolling(adjustable, false);
-                    }
-                    break;
-                default: // Do nothing
+        view.addItemListener(e -> {
+            switch(e.getStateChange()) {
+            case ItemEvent.SELECTED:
+                if (!isParticipatingInSynchronizedScrolling(adjustable)) {
+                    setParticipatingInSynchronizedScrolling(adjustable, true);
                 }
+                break;
+            case ItemEvent.DESELECTED:
+                if (isParticipatingInSynchronizedScrolling(adjustable)) {
+                    setParticipatingInSynchronizedScrolling(adjustable, false);
+                }
+                break;
+            default: // Do nothing
             }
         });
 
-        observable.addChangeListener(
-                new ChangeListener() {
-                    @Override
-                    public void stateChanged(ChangeEvent e) {
-                        boolean sync = isParticipatingInSynchronizedScrolling(adjustable);
-                        if (view.isSelected() != sync) {
-                            view.setSelected(sync);
-                        }
-                    }
-                }
-        );
+        observable.addChangeListener(e -> {
+            boolean sync = isParticipatingInSynchronizedScrolling(adjustable);
+            if (view.isSelected() != sync) {
+                view.setSelected(sync);
+            }
+        });
         setParticipatingInSynchronizedScrolling(adjustable, true);
         view.setSelected(true);
Index: trunk/src/org/openstreetmap/josm/gui/util/AdvancedKeyPressDetector.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/util/AdvancedKeyPressDetector.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/util/AdvancedKeyPressDetector.java	(revision 10611)
@@ -9,6 +9,4 @@
 import java.awt.Toolkit;
 import java.awt.event.AWTEventListener;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
 import java.util.List;
@@ -83,14 +81,9 @@
             Main.warn(ex);
         }
-        timer = new Timer(0, new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                timer.stop();
-                if (set.remove(releaseEvent.getKeyCode()) && enabled) {
-                    if (isFocusInMainWindow()) {
-                        for (KeyPressReleaseListener q: keyListeners) {
-                            q.doKeyReleased(releaseEvent);
-                        }
-                    }
+        timer = new Timer(0, e -> {
+            timer.stop();
+            if (set.remove(releaseEvent.getKeyCode()) && enabled && isFocusInMainWindow()) {
+                for (KeyPressReleaseListener q: keyListeners) {
+                    q.doKeyReleased(releaseEvent);
                 }
             }
Index: trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java	(revision 10611)
@@ -22,6 +22,4 @@
 import java.awt.Window;
 import java.awt.event.ActionListener;
-import java.awt.event.HierarchyEvent;
-import java.awt.event.HierarchyListener;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseAdapter;
@@ -91,10 +89,5 @@
 
     public static void executeByMainWorkerInEDT(final Runnable task) {
-        Main.worker.submit(new Runnable() {
-            @Override
-            public void run() {
-                runInEDTAndWait(task);
-            }
-        });
+        Main.worker.submit(() -> runInEDTAndWait(task));
     }
 
@@ -272,15 +265,12 @@
     public static Component prepareResizeableOptionPane(final Component pane, final Dimension minDimension) {
         if (pane != null) {
-            pane.addHierarchyListener(new HierarchyListener() {
-                @Override
-                public void hierarchyChanged(HierarchyEvent e) {
-                    Window window = SwingUtilities.getWindowAncestor(pane);
-                    if (window instanceof Dialog) {
-                        Dialog dialog = (Dialog) window;
-                        if (!dialog.isResizable()) {
-                            dialog.setResizable(true);
-                            if (minDimension != null) {
-                                dialog.setMinimumSize(minDimension);
-                            }
+            pane.addHierarchyListener(e -> {
+                Window window = SwingUtilities.getWindowAncestor(pane);
+                if (window instanceof Dialog) {
+                    Dialog dialog = (Dialog) window;
+                    if (!dialog.isResizable()) {
+                        dialog.setResizable(true);
+                        if (minDimension != null) {
+                            dialog.setMinimumSize(minDimension);
                         }
                     }
Index: trunk/src/org/openstreetmap/josm/gui/util/StayOpenCheckBoxMenuItem.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/util/StayOpenCheckBoxMenuItem.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/util/StayOpenCheckBoxMenuItem.java	(revision 10611)
@@ -6,6 +6,4 @@
 import javax.swing.MenuElement;
 import javax.swing.MenuSelectionManager;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
 
 /**
@@ -19,13 +17,9 @@
 
   {
-    getModel().addChangeListener(new ChangeListener() {
-
-      @Override
-      public void stateChanged(ChangeEvent e) {
+    getModel().addChangeListener(e -> {
         if (getModel().isArmed() && isShowing()) {
           path = MenuSelectionManager.defaultManager().getSelectedPath();
         }
-      }
-    });
+      });
   }
 
Index: trunk/src/org/openstreetmap/josm/gui/widgets/DateEditorWithSlider.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/DateEditorWithSlider.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/DateEditorWithSlider.java	(revision 10611)
@@ -16,5 +16,4 @@
 import javax.swing.JSpinner;
 import javax.swing.SpinnerDateModel;
-import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
@@ -52,29 +51,23 @@
 
         slider = new JSlider(0, MAX_SLIDER);
-        spinner.addChangeListener(new ChangeListener() {
-            @Override
-            public void stateChanged(ChangeEvent e) {
-                int i = slider.getValue();
-                Date d = (Date) spinner.getValue();
-                int j = intFromDate(d);
-                if (i != j) {
-                    watchSlider = false;
-                    slider.setValue(j);
-                    watchSlider = true;
-                }
-                for (ChangeListener l : listeners) {
-                    l.stateChanged(e);
-                }
+        spinner.addChangeListener(e -> {
+            int i = slider.getValue();
+            Date d = (Date) spinner.getValue();
+            int j = intFromDate(d);
+            if (i != j) {
+                watchSlider = false;
+                slider.setValue(j);
+                watchSlider = true;
+            }
+            for (ChangeListener l : listeners) {
+                l.stateChanged(e);
             }
         });
-        slider.addChangeListener(new ChangeListener() {
-            @Override
-            public void stateChanged(ChangeEvent e) {
-                if (!watchSlider) return;
-                Date d = (Date) spinner.getValue();
-                Date d1 = dateFromInt(slider.getValue());
-                if (!d.equals(d1)) {
-                    spinner.setValue(d1);
-                }
+        slider.addChangeListener(e -> {
+            if (!watchSlider) return;
+            Date d = (Date) spinner.getValue();
+            Date d1 = dateFromInt(slider.getValue());
+            if (!d.equals(d1)) {
+                spinner.setValue(d1);
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/widgets/EditableList.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/EditableList.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/EditableList.java	(revision 10611)
@@ -7,6 +7,4 @@
 import java.awt.Dimension;
 import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.util.ArrayList;
 import java.util.List;
@@ -46,64 +44,55 @@
         setLayout(new BorderLayout());
 
-        addSrcButton.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                String source = JOptionPane.showInputDialog(
-                        Main.parent,
+        addSrcButton.addActionListener(e -> {
+            String source = JOptionPane.showInputDialog(
+                    Main.parent,
+                    title,
+                    title,
+                    JOptionPane.QUESTION_MESSAGE);
+            if (source != null) {
+                ((DefaultListModel<String>) sourcesList.getModel()).addElement(source);
+            }
+            sourcesList.clearSelection();
+        });
+
+        editSrcButton.addActionListener(e -> {
+            int row = sourcesList.getSelectedIndex();
+            if (row == -1 && sourcesList.getModel().getSize() == 1) {
+                sourcesList.setSelectedIndex(0);
+                row = 0;
+            }
+            if (row == -1) {
+                if (sourcesList.getModel().getSize() == 0) {
+                    String source1 = JOptionPane.showInputDialog(Main.parent, title, title, JOptionPane.QUESTION_MESSAGE);
+                    if (source1 != null) {
+                        ((DefaultListModel<String>) sourcesList.getModel()).addElement(source1);
+                    }
+                } else {
+                    JOptionPane.showMessageDialog(
+                            Main.parent,
+                            tr("Please select the row to edit."),
+                            tr("Information"),
+                            JOptionPane.INFORMATION_MESSAGE
+                    );
+                }
+            } else {
+                String source2 = (String) JOptionPane.showInputDialog(Main.parent,
                         title,
                         title,
-                        JOptionPane.QUESTION_MESSAGE);
-                if (source != null) {
-                    ((DefaultListModel<String>) sourcesList.getModel()).addElement(source);
+                        JOptionPane.QUESTION_MESSAGE, null, null,
+                        sourcesList.getSelectedValue());
+                if (source2 != null) {
+                    ((DefaultListModel<String>) sourcesList.getModel()).setElementAt(source2, row);
                 }
-                sourcesList.clearSelection();
             }
+            sourcesList.clearSelection();
         });
 
-        editSrcButton.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                int row = sourcesList.getSelectedIndex();
-                if (row == -1 && sourcesList.getModel().getSize() == 1) {
-                    sourcesList.setSelectedIndex(0);
-                    row = 0;
-                }
-                if (row == -1) {
-                    if (sourcesList.getModel().getSize() == 0) {
-                        String source = JOptionPane.showInputDialog(Main.parent, title, title, JOptionPane.QUESTION_MESSAGE);
-                        if (source != null) {
-                            ((DefaultListModel<String>) sourcesList.getModel()).addElement(source);
-                        }
-                    } else {
-                        JOptionPane.showMessageDialog(
-                                Main.parent,
-                                tr("Please select the row to edit."),
-                                tr("Information"),
-                                JOptionPane.INFORMATION_MESSAGE
-                        );
-                    }
-                } else {
-                    String source = (String) JOptionPane.showInputDialog(Main.parent,
-                            title,
-                            title,
-                            JOptionPane.QUESTION_MESSAGE, null, null,
-                            sourcesList.getSelectedValue());
-                    if (source != null) {
-                        ((DefaultListModel<String>) sourcesList.getModel()).setElementAt(source, row);
-                    }
-                }
-                sourcesList.clearSelection();
-            }
-        });
-
-        deleteSrcButton.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if (sourcesList.getSelectedIndex() == -1) {
-                    JOptionPane.showMessageDialog(Main.parent, tr("Please select the row to delete."), tr("Information"),
-                            JOptionPane.QUESTION_MESSAGE);
-                } else {
-                    ((DefaultListModel<String>) sourcesList.getModel()).remove(sourcesList.getSelectedIndex());
-                }
+        deleteSrcButton.addActionListener(e -> {
+            if (sourcesList.getSelectedIndex() == -1) {
+                JOptionPane.showMessageDialog(Main.parent, tr("Please select the row to delete."), tr("Information"),
+                        JOptionPane.QUESTION_MESSAGE);
+            } else {
+                ((DefaultListModel<String>) sourcesList.getModel()).remove(sourcesList.getSelectedIndex());
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java	(revision 10611)
@@ -98,10 +98,5 @@
     @Override
     public void setFileFilter(final FileFilter cff) {
-        FilenameFilter filter = new FilenameFilter() {
-            @Override
-            public boolean accept(File directory, String fileName) {
-                return cff.accept(new File(directory.getAbsolutePath() + fileName));
-            }
-        };
+        FilenameFilter filter = (directory, fileName) -> cff.accept(new File(directory.getAbsolutePath() + fileName));
         fileDialog.setFilenameFilter(filter);
         fileFilter = cff;
Index: trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java	(revision 10609)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java	(revision 10611)
@@ -8,5 +8,4 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
-import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 
@@ -17,5 +16,4 @@
 import javax.swing.JPopupMenu;
 import javax.swing.KeyStroke;
-import javax.swing.event.UndoableEditEvent;
 import javax.swing.event.UndoableEditListener;
 import javax.swing.text.DefaultEditorKit;
@@ -51,20 +49,14 @@
     protected final UndoManager undo = new UndoManager();
 
-    protected final transient UndoableEditListener undoEditListener = new UndoableEditListener() {
-        @Override
-        public void undoableEditHappened(UndoableEditEvent e) {
-            undo.addEdit(e.getEdit());
-            undoAction.updateUndoState();
-            redoAction.updateRedoState();
-        }
+    protected final transient UndoableEditListener undoEditListener = e -> {
+        undo.addEdit(e.getEdit());
+        undoAction.updateUndoState();
+        redoAction.updateRedoState();
     };
 
-    protected final transient PropertyChangeListener propertyChangeListener = new PropertyChangeListener() {
-        @Override
-        public void propertyChange(PropertyChangeEvent evt) {
-            if (EDITABLE.equals(evt.getPropertyName())) {
-                removeAll();
-                addMenuEntries();
-            }
+    protected final transient PropertyChangeListener propertyChangeListener = evt -> {
+        if (EDITABLE.equals(evt.getPropertyName())) {
+            removeAll();
+            addMenuEntries();
         }
     };
