From a338a96f1db7bf4ff0b42a4a8d6169c9861a0e12 Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Thu, 18 Jun 2020 15:56:25 -0600 Subject: [PATCH] Update MapWithAIInfo when preferences are null Signed-off-by: Taylor Smock --- .../josm/plugins/mapwithai/data/mapwithai/MapWithAIInfo.java | 4 +++- .../plugins/mapwithai/data/mapwithai/MapWithAILayerInfo.java | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/data/mapwithai/MapWithAIInfo.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/data/mapwithai/MapWithAIInfo.java index 4788062..8fda7cd 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/data/mapwithai/MapWithAIInfo.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/data/mapwithai/MapWithAIInfo.java @@ -270,7 +270,9 @@ public class MapWithAIInfo extends && Objects.equals(this.conflationUrl, other.conflationUrl) && Objects.equals(this.conflationParameters, other.conflationParameters) && Objects.equals(this.categories, other.categories) - && Objects.equals(this.alreadyConflatedKey, other.alreadyConflatedKey); + && Objects.equals(this.alreadyConflatedKey, other.alreadyConflatedKey) + && ((this.parameters == null && other.parameters == null) + || Objects.equals(this.parameters, other.parameters)); // CHECKSTYLE.ON: BooleanExpressionComplexity } diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/data/mapwithai/MapWithAILayerInfo.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/data/mapwithai/MapWithAILayerInfo.java index 9f0f970..ed2a3ff 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/data/mapwithai/MapWithAILayerInfo.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/data/mapwithai/MapWithAILayerInfo.java @@ -444,9 +444,7 @@ public class MapWithAILayerInfo { } public static void addLayers(Collection infos) { - for (MapWithAIInfo i : infos) { - instance.add(i); - } + infos.forEach(instance::add); instance.save(); Collections.sort(instance.layers); }