﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
21886	[patch] Download Dialog incorrectly reports note area rejection	gaben	team	"==== What steps will reproduce the problem?
1. Open download dialog
2. Play with the bounding box while only the OSM data download checked
3. Repeat step 2 with notes checked only

==== What is the expected result?
For note download the allowed bounding box is 100x greater than data, so the message should reflect that.

==== What happens instead?
The note's allowed bounding box size (25) ignored, the data restrictions (0.25) used instead.

==== Please provide any additional information below. Attach a screenshot if possible.
This patch fixes the issue, but the existing code not working as expected. See the comment.

{{{#!patch
Index: src/org/openstreetmap/josm/gui/download/OSMDownloadSource.java
===================================================================
--- src/org/openstreetmap/josm/gui/download/OSMDownloadSource.java	(revision 18382)
+++ src/org/openstreetmap/josm/gui/download/OSMDownloadSource.java	(working copy)
@@ -340,6 +340,8 @@
             }
 
             displaySizeCheckResult(DOWNLOAD_SOURCES.stream()
+                    // this line doesn't work, but should: .filter(IDownloadSourceType::isEnabled)
+                    .filter(type -> type.getCheckBox().isSelected())    //this works
                     .anyMatch(type -> type.isDownloadAreaTooLarge(bbox)));
         }
 
@@ -414,7 +416,7 @@
         @Override
         public boolean isDownloadAreaTooLarge(Bounds bound) {
             // see max_request_area in
-            // https://github.com/openstreetmap/openstreetmap-website/blob/master/config/example.application.yml
+            // https://github.com/openstreetmap/openstreetmap-website/blob/master/config/settings.yml
             return bound.getArea() > Config.getPref().getDouble(""osm-server.max-request-area"", 0.25);
         }
     }
@@ -492,7 +494,7 @@
         @Override
         public boolean isDownloadAreaTooLarge(Bounds bound) {
             // see max_note_request_area in
-            // https://github.com/openstreetmap/openstreetmap-website/blob/master/config/example.application.yml
+            // https://github.com/openstreetmap/openstreetmap-website/blob/master/config/settings.yml
             return bound.getArea() > Config.getPref().getDouble(""osm-server.max-request-area-notes"", 25);
         }
     }
}}}"	defect	closed	minor	23.05	Core		fixed	template_report download note area reject	
