Index: /trunk/src/org/openstreetmap/josm/gui/download/OSMDownloadSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/download/OSMDownloadSource.java	(revision 16503)
+++ /trunk/src/org/openstreetmap/josm/gui/download/OSMDownloadSource.java	(revision 16504)
@@ -11,8 +11,10 @@
 import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
+import java.util.stream.Collectors;
 
 import javax.swing.Icon;
@@ -131,6 +133,5 @@
 
     /**
-     * @return The possible downloads that JOSM can make in the default Download
-     *         screen
+     * @return The possible downloads that JOSM can make in the default Download screen
      * @since 16503
      */
@@ -153,15 +154,12 @@
     /**
      * @param type The IDownloadSourceType object to remove
-     * @return true See {@link List#remove}, but it also returns false if the
-     * parameter is a class from JOSM core.
+     * @return {@code true} if this download types contained the specified object
      * @since 16503
      */
     public static boolean removeDownloadType(IDownloadSourceType type) {
-        boolean modified = false;
-        if (!(type instanceof OsmDataDownloadType) && !(type instanceof GpsDataDownloadType)
-                && !(type instanceof NotesDataDownloadType)) {
-            modified = DOWNLOAD_SOURCES.remove(type);
-        }
-        return modified;
+        if (type instanceof OsmDataDownloadType || type instanceof GpsDataDownloadType || type instanceof NotesDataDownloadType) {
+            throw new IllegalArgumentException(type.getClass().getName());
+        }
+        return DOWNLOAD_SOURCES.remove(type);
     }
 
@@ -170,19 +168,14 @@
      *
      * @param type The initialized type to download
-     * @return See {@link List#add}, but it also returns false if the class
-     * already has an instance in the list or it is a class from JOSM core.
+     * @return {@code true} (as specified by {@link Collection#add}), but it also returns false if the class already has an instance in the list
      * @since 16503
      */
     public static boolean addDownloadType(IDownloadSourceType type) {
-        boolean modified = false;
-        if (!(type instanceof OsmDataDownloadType) && !(type instanceof GpsDataDownloadType)
-                && !(type instanceof NotesDataDownloadType)
-                || DOWNLOAD_SOURCES.stream()
-                        .noneMatch(possibility -> type.getClass().isInstance(possibility))) {
-            modified = DOWNLOAD_SOURCES.add(type);
-        } else {
-            throw new IllegalArgumentException("There can only be one instance of a class added, and it cannot be a built-in class.");
-        }
-        return modified;
+        if (type instanceof OsmDataDownloadType || type instanceof GpsDataDownloadType || type instanceof NotesDataDownloadType) {
+            throw new IllegalArgumentException(type.getClass().getName());
+        } else if (getDownloadType(type.getClass()) != null) {
+            return false;
+        }
+        return DOWNLOAD_SOURCES.add(type);
     }
 
@@ -195,7 +188,7 @@
 
         /** This is used to keep track of the components for download sources, and to dynamically update/remove them */
-        private JPanel downloadSourcesPanel;
-
-        private ChangeListener checkboxChangeListener;
+        private final JPanel downloadSourcesPanel;
+
+        private final ChangeListener checkboxChangeListener;
 
         /**
@@ -285,16 +278,14 @@
              */
             if (DOWNLOAD_SOURCES.stream().noneMatch(IDownloadSourceType::isEnabled)) {
-                StringBuilder line1 = new StringBuilder("<html>").append(tr("None of"));
-                StringBuilder line2 = new StringBuilder(tr("Please choose to either download"));
-
-                DOWNLOAD_SOURCES.forEach(type -> {
-                    line1.append(" <strong>").append(type.getCheckBox().getText()).append("</strong> ");
-                    line2.append(' ').append(type.getCheckBox().getText()).append(tr(", or"));
-                });
-                line1.append(tr("is enabled.")).append("<br>");
-                line2.append(tr(" all.")).append("</html>");
+                String sources = DOWNLOAD_SOURCES.stream()
+                        .map(type -> type.getCheckBox().getText())
+                        .collect(Collectors.joining(", "));
+                String message = "<html>"
+                        + tr("None of {0} is enabled!", sources)
+                        + "<br>"
+                        + tr("Please select at least one of {0}.", sources);
                 JOptionPane.showMessageDialog(
                         this.getParent(),
-                        line1.append(line2).toString(),
+                        message,
                         tr("Error"),
                         JOptionPane.ERROR_MESSAGE
@@ -313,10 +304,9 @@
          *
          * @return true if the user selected to download OSM data
-         * @deprecated since xxx -- use {@link OSMDownloadSource#getDownloadTypes} with
-         *             {@code get(0).getCheckBox().isSelected()}
+         * @deprecated since xxx -- use {@code getDownloadType(OsmDataDownloadType.class).getCheckBox().isSelected()}
          */
         @Deprecated
         public boolean isDownloadOsmData() {
-            return DOWNLOAD_SOURCES.get(0).getCheckBox().isSelected();
+            return getDownloadType(OsmDataDownloadType.class).getCheckBox().isSelected();
         }
 
@@ -325,10 +315,9 @@
          *
          * @return true if the user selected to download GPX data
-         * @deprecated since xxx -- use {@link OSMDownloadSource#getDownloadTypes} with
-         *             {@code get(1).getCheckBox().isSelected()}
+         * @deprecated since xxx -- use {@code getDownloadType(GpsDataDownloadType.class).getCheckBox().isSelected()}
          */
         @Deprecated
         public boolean isDownloadGpxData() {
-            return DOWNLOAD_SOURCES.get(1).getCheckBox().isSelected();
+            return getDownloadType(GpsDataDownloadType.class).getCheckBox().isSelected();
         }
 
@@ -337,10 +326,9 @@
          *
          * @return true if user selected to download notes
-         * @deprecated since xxx -- use {@link OSMDownloadSource#getDownloadTypes} with
-         *             {@code get(2).getCheckBox().isSelected()}
+         * @deprecated since xxx -- use {@code getDownloadType(NotesDataDownloadType.class).getCheckBox().isSelected()}
          */
         @Deprecated
         public boolean isDownloadNotes() {
-            return DOWNLOAD_SOURCES.get(2).getCheckBox().isSelected();
+            return getDownloadType(NotesDataDownloadType.class).getCheckBox().isSelected();
         }
 
@@ -388,5 +376,5 @@
     static class OSMDownloadData {
 
-        private List<IDownloadSourceType> downloadPossibilities;
+        private final List<IDownloadSourceType> downloadPossibilities;
 
         /**
