From 9e542ab541b715be44f5a6fcc47b9e7e67e5f989 Mon Sep 17 00:00:00 2001 From: afischerdev Date: Tue, 14 Mar 2023 17:35:16 +0100 Subject: [PATCH] rework downloader new array --- .../src/main/java/btools/routingapp/DownloadWorker.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brouter-routing-app/src/main/java/btools/routingapp/DownloadWorker.java b/brouter-routing-app/src/main/java/btools/routingapp/DownloadWorker.java index ca29c28..775b4d9 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/DownloadWorker.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/DownloadWorker.java @@ -175,7 +175,7 @@ public class DownloadWorker extends Worker { return Result.failure(output.build()); } - if (downloadAll != VALUE_SEGMENT_ALL) { + if (!versionChanged && downloadAll != VALUE_SEGMENT_ALL) { List tmpSegementNames = new ArrayList<>(); File segmentFolder = new File(baseDir, SEGMENTS_DIR); File[] files = segmentFolder.listFiles(new FileFilter() { @@ -196,7 +196,7 @@ public class DownloadWorker extends Worker { return Result.failure(output.build()); } if (downloadAll == VALUE_SEGMENT_DIFFS) { - tmpSegementNames.toArray(segmentNames); + segmentNames = tmpSegementNames.toArray(new String[0]); } else if (downloadAll == VALUE_SEGMENT_DROPDIFFS) { for (String segmentName : tmpSegementNames) { File segmentFile = new File(baseDir, SEGMENTS_DIR + segmentName + SEGMENT_SUFFIX);