From cd7628ae3de3a3479a6ae56a3146f035aca92003 Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Fri, 2 Feb 2018 14:25:53 +0200 Subject: [PATCH] Fix concurrent modification exception --- .../net/osmand/plus/resources/IncrementalChangesManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java b/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java index be1e017631..4136e75e72 100644 --- a/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java @@ -88,7 +88,8 @@ public class IncrementalChangesManager { if (!regionUpdateFiles.dayUpdates.isEmpty()) { ArrayList list = new ArrayList(regionUpdateFiles.dayUpdates.keySet()); for (String month : list) { - Iterator it = regionUpdateFiles.dayUpdates.get(month).iterator(); + List newList = new ArrayList<>(regionUpdateFiles.dayUpdates.get(month)); + Iterator it = newList.iterator(); RegionUpdate monthRu = regionUpdateFiles.monthUpdates.get(month); while (it.hasNext()) { RegionUpdate ru = it.next(); @@ -100,6 +101,7 @@ public class IncrementalChangesManager { log.info("Delete overlapping day update " + ru.file.getName()); } } + regionUpdateFiles.dayUpdates.put(month, newList); } } }