Index: trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java	(revision 10314)
+++ trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java	(revision 10315)
@@ -218,12 +218,5 @@
         protected int getNumDataLayers() {
             if (!Main.isDisplayingMapView()) return 0;
-            int count = 0;
-            Collection<Layer> layers = Main.map.mapView.getAllLayers();
-            for (Layer layer : layers) {
-                if (layer instanceof OsmDataLayer) {
-                    count++;
-                }
-            }
-            return count;
+            return Utils.filteredCollection(Main.map.mapView.getAllLayers(), OsmDataLayer.class).size();
         }
 
Index: trunk/src/org/openstreetmap/josm/io/OsmServerLocationReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmServerLocationReader.java	(revision 10314)
+++ trunk/src/org/openstreetmap/josm/io/OsmServerLocationReader.java	(revision 10315)
@@ -6,5 +6,5 @@
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
@@ -178,5 +178,5 @@
             in = getInputStream(url, progressMonitor.createSubTaskMonitor(1, true));
             if (in == null) {
-                return new ArrayList<>();
+                return Collections.emptyList();
             }
             progressMonitor.subTask(tr("Downloading OSM notes..."));
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 10314)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 10315)
@@ -395,5 +395,5 @@
             return Arrays.copyOf(array, array.length);
         }
-        return null;
+        return array;
     }
 
@@ -408,5 +408,5 @@
             return Arrays.copyOf(array, array.length);
         }
-        return null;
+        return array;
     }
 
@@ -421,5 +421,5 @@
             return Arrays.copyOf(array, array.length);
         }
-        return null;
+        return array;
     }
 
