Ensure that the counter for unique ids is only ever advanced once

This fixes JOSM-18601, if the analysis was correct.

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head
Taylor Smock 2020-01-23 07:42:06 -07:00
rodzic 582bf0c640
commit 68a81a1e4e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -36,7 +36,10 @@ public class BoundingBoxMapWithAIDownloader extends BoundingBoxDownloader {
@Override
protected DataSet parseDataSet(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException {
DataSet ds = OsmReaderCustom.parseDataSet(source, progressMonitor, true);
DataSet ds;
synchronized (BoundingBoxMapWithAIDownloader.class) {
ds = OsmReaderCustom.parseDataSet(source, progressMonitor, true);
}
GetDataRunnable.addMapWithAISourceTag(ds, MapWithAIPreferenceHelper.getMapWithAIUrl().stream()
.filter(map -> map.getOrDefault("url", "no-url").equals(url))
.map(map -> map.getOrDefault("source", MapWithAIPlugin.NAME)).findFirst().orElse(MapWithAIPlugin.NAME));