Index: src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
===================================================================
--- src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java	(revision 17476)
+++ src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java	(working copy)
@@ -323,7 +323,7 @@
                 threadsNumber, Utils.newThreadFactory(getClass() + "-%d", Thread.NORM_PRIORITY));
         CompletionService<FetchResult> ecs = new ExecutorCompletionService<>(exec);
         List<Future<FetchResult>> jobs = new ArrayList<>();
-        while (!toFetch.isEmpty()) {
+        while (!toFetch.isEmpty() && !isCanceled()) {
             jobs.add(ecs.submit(new Fetcher(type, extractIdPackage(toFetch), progressMonitor)));
         }
         // Run the fetchers
@@ -555,23 +555,22 @@
         public DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException {
             // This method is implemented because of the OsmServerReader inheritance, but not used,
             // as the main target of this class is the call() method.
-            return fetch(progressMonitor).dataSet;
+            return fetch().dataSet;
         }
 
         @Override
         public FetchResult call() throws Exception {
-            return fetch(progressMonitor);
+            return fetch();
         }
 
         /**
          * fetches the requested primitives and updates the specified progress monitor.
-         * @param progressMonitor the progress monitor
          * @return the {@link FetchResult} of this operation
          * @throws OsmTransferException if an error occurs while communicating with the API server
          */
-        protected FetchResult fetch(ProgressMonitor progressMonitor) throws OsmTransferException {
+        protected FetchResult fetch() throws OsmTransferException {
             try {
-                return multiGetIdPackage(type, pkg, progressMonitor);
+                return multiGetIdPackage(type, pkg);
             } catch (OsmApiException e) {
                 if (e.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
                     if (pkg.size() > 4) {
@@ -585,7 +584,7 @@
                         return res;
                     } else {
                         Logging.info(tr("Server replied with response code 404, retrying with an individual request for each object."));
-                        return singleGetIdPackage(type, pkg, progressMonitor);
+                        return singleGetIdPackage(type, pkg);
                     }
                 } else {
                     throw e;
@@ -605,12 +604,12 @@
          * @param type The primitive type. Must be one of {@link OsmPrimitiveType#NODE NODE}, {@link OsmPrimitiveType#WAY WAY},
          * {@link OsmPrimitiveType#RELATION RELATION}
          * @param pkg the package of ids
-         * @param progressMonitor progress monitor
          * @return the {@link FetchResult} of this operation
          * @throws OsmTransferException if an error occurs while communicating with the API server
          */
-        protected FetchResult multiGetIdPackage(OsmPrimitiveType type, Set<Long> pkg, ProgressMonitor progressMonitor)
-                throws OsmTransferException {
+        protected FetchResult multiGetIdPackage(OsmPrimitiveType type, Set<Long> pkg) throws OsmTransferException {
+            if (isCanceled())
+                return new FetchResult(null, null);
             String request = buildRequestString(type, pkg);
             FetchResult result = null;
             try (InputStream in = getInputStream(request, NullProgressMonitor.INSTANCE)) {
@@ -635,11 +634,10 @@
          * @param type The primitive type. Must be one of {@link OsmPrimitiveType#NODE NODE}, {@link OsmPrimitiveType#WAY WAY},
          * {@link OsmPrimitiveType#RELATION RELATION}
          * @param id the id
-         * @param progressMonitor progress monitor
          * @return the {@link DataSet} resulting of this operation
          * @throws OsmTransferException if an error occurs while communicating with the API server
          */
-        protected DataSet singleGetId(OsmPrimitiveType type, long id, ProgressMonitor progressMonitor) throws OsmTransferException {
+        protected DataSet singleGetId(OsmPrimitiveType type, long id) throws OsmTransferException {
             String request = buildRequestString(type, Collections.singleton(id));
             DataSet result = null;
             try (InputStream in = getInputStream(request, NullProgressMonitor.INSTANCE)) {
@@ -667,15 +665,15 @@
          * @param type The primitive type. Must be one of {@link OsmPrimitiveType#NODE NODE}, {@link OsmPrimitiveType#WAY WAY},
          * {@link OsmPrimitiveType#RELATION RELATION}
          * @param pkg the set of ids
-         * @param progressMonitor progress monitor
          * @return the {@link FetchResult} of this operation
          * @throws OsmTransferException if an error occurs while communicating with the API server
          */
-        protected FetchResult singleGetIdPackage(OsmPrimitiveType type, Set<Long> pkg, ProgressMonitor progressMonitor)
+        protected FetchResult singleGetIdPackage(OsmPrimitiveType type, Set<Long> pkg)
                 throws OsmTransferException {
             FetchResult result = new FetchResult(new DataSet(), new HashSet<PrimitiveId>());
             String baseUrl = OsmApi.getOsmApi().getBaseUrl();
             for (long id : pkg) {
+                if (isCanceled()) return result;
                 try {
                     String msg;
                     switch (type) {
@@ -687,7 +685,7 @@
                         default: throw new AssertionError();
                     }
                     progressMonitor.setCustomText(msg);
-                    result.dataSet.mergeFrom(singleGetId(type, id, progressMonitor));
+                    result.dataSet.mergeFrom(singleGetId(type, id));
                 } catch (OsmApiException e) {
                     if (e.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
                         Logging.info(tr("Server replied with response code 404 for id {0}. Skipping.", Long.toString(id)));
@@ -699,5 +697,10 @@
             }
             return result;
         }
+
+        @Override
+        public boolean isCanceled() {
+            return super.isCanceled() || progressMonitor.isCanceled();
+        }
     }
 }
