Index: /trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java	(revision 12266)
+++ /trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java	(revision 12267)
@@ -4,5 +4,4 @@
 import java.io.File;
 import java.text.MessageFormat;
-import java.util.AbstractCollection;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -24,4 +23,5 @@
 import org.openstreetmap.josm.data.gpx.GpxTrack.GpxTrackChangeListener;
 import org.openstreetmap.josm.tools.ListenerList;
+import org.openstreetmap.josm.tools.ListeningCollection;
 
 /**
@@ -668,79 +668,4 @@
 
     /**
-     * This is a proxy of a collection that notifies a listener on every collection change
-     * @author Michael Zangl
-     *
-     * @param <T> The entry type
-     * @since 12156
-     */
-    private static class ListeningCollection<T> extends AbstractCollection<T> {
-        private final ArrayList<T> base;
-        private final Runnable runOnModification;
-
-        ListeningCollection(ArrayList<T> base, Runnable runOnModification) {
-            this.base = base;
-            this.runOnModification = runOnModification;
-        }
-
-        @Override
-        public Iterator<T> iterator() {
-            Iterator<T> it = base.iterator();
-            return new Iterator<T>() {
-                private T cursor;
-
-                @Override
-                public boolean hasNext() {
-                    return it.hasNext();
-                }
-
-                @Override
-                public T next() {
-                    cursor = it.next();
-                    return cursor;
-                }
-
-                @Override
-                public void remove() {
-                    if (cursor != null) {
-                        removed(cursor);
-                        cursor = null;
-                    }
-                    it.remove();
-                }
-            };
-        }
-
-        @Override
-        public int size() {
-            return base.size();
-        }
-
-        @Override
-        @SuppressWarnings("unchecked")
-        public boolean remove(Object o) {
-            boolean remove = base.remove(o);
-            if (remove) {
-                removed((T) o);
-            }
-            return remove;
-        }
-
-        @Override
-        public boolean add(T e) {
-            boolean add = base.add(e);
-            added(e);
-            return add;
-        }
-
-        protected void removed(T cursor) {
-            runOnModification.run();
-        }
-
-        protected void added(T cursor) {
-            runOnModification.run();
-        }
-    }
-
-    /**
      * A listener that listens to GPX data changes.
      * @author Michael Zangl
Index: /trunk/src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 12266)
+++ /trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 12267)
@@ -784,10 +784,8 @@
         }
         // if this is really a change (and not the first active layer)
-        if (e.getPreviousActiveLayer() != null) {
-            if (!modeChanged && mapMode != null) {
-                // Let mapmodes know about new active layer
-                mapMode.exitMode();
-                mapMode.enterMode();
-            }
+        if (e.getPreviousActiveLayer() != null && !modeChanged && mapMode != null) {
+            // Let mapmodes know about new active layer
+            mapMode.exitMode();
+            mapMode.enterMode();
         }
 
Index: /trunk/src/org/openstreetmap/josm/io/session/ImagerySessionExporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/session/ImagerySessionExporter.java	(revision 12266)
+++ /trunk/src/org/openstreetmap/josm/io/session/ImagerySessionExporter.java	(revision 12267)
@@ -98,5 +98,5 @@
     }
 
-    private void addAttributes(Element element, Map<String, String> props, ExportSupport support) {
+    private static void addAttributes(Element element, Map<String, String> props, ExportSupport support) {
         for (Map.Entry<String, String> entry : props.entrySet()) {
             Element attrElem = support.createElement(entry.getKey());
Index: /trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java	(revision 12266)
+++ /trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java	(revision 12267)
@@ -59,5 +59,5 @@
     }
 
-    private Map<String, String> readProperties(Element elem) {
+    private static Map<String, String> readProperties(Element elem) {
         Map<String, String> attributes = new HashMap<>();
         NodeList nodes = elem.getChildNodes();
Index: /trunk/src/org/openstreetmap/josm/tools/ListeningCollection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/ListeningCollection.java	(revision 12267)
+++ /trunk/src/org/openstreetmap/josm/tools/ListeningCollection.java	(revision 12267)
@@ -0,0 +1,95 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.tools;
+
+import java.util.AbstractCollection;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * This is a proxy of a collection that notifies a listener on every collection change
+ * @author Michael Zangl
+ *
+ * @param <T> The entry type
+ * @since 12267 (extracted from GpxData)
+ * @since 12156
+ */
+public class ListeningCollection<T> extends AbstractCollection<T> {
+    private final ArrayList<T> base;
+    private final Runnable runOnModification;
+
+    /**
+     * Constructs a new {@code ListeningCollection}.
+     * @param base base collection
+     * @param runOnModification runnable run at each modification
+     */
+    public ListeningCollection(ArrayList<T> base, Runnable runOnModification) {
+        this.base = base;
+        this.runOnModification = runOnModification;
+    }
+
+    @Override
+    public final Iterator<T> iterator() {
+        Iterator<T> it = base.iterator();
+        return new Iterator<T>() {
+            private T object;
+
+            @Override
+            public boolean hasNext() {
+                return it.hasNext();
+            }
+
+            @Override
+            public T next() {
+                object = it.next();
+                return object;
+            }
+
+            @Override
+            public void remove() {
+                if (object != null) {
+                    removed(object);
+                    object = null;
+                }
+                it.remove();
+            }
+        };
+    }
+
+    @Override
+    public final int size() {
+        return base.size();
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public final boolean remove(Object o) {
+        boolean remove = base.remove(o);
+        if (remove) {
+            removed((T) o);
+        }
+        return remove;
+    }
+
+    @Override
+    public final boolean add(T e) {
+        boolean add = base.add(e);
+        added(e);
+        return add;
+    }
+
+    /**
+     * Called when an object is removed.
+     * @param object the removed object
+     */
+    protected void removed(T object) {
+        runOnModification.run();
+    }
+
+    /**
+     * Called when an object is added.
+     * @param object the added object
+     */
+    protected void added(T object) {
+        runOnModification.run();
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java	(revision 12266)
+++ /trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java	(revision 12267)
@@ -174,5 +174,5 @@
                         || (javaVersion == 9 && javaUpdate == 0 && javaBuild < 171))) {
                     // Workaround from https://bugs.openjdk.java.net/browse/JDK-8179014
-                    UIManager.put("FileChooser.useSystemExtensionHiding", false);
+                    UIManager.put("FileChooser.useSystemExtensionHiding", Boolean.FALSE);
                 }
             } catch (NumberFormatException | ReflectiveOperationException e) {
