Index: /trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyle.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyle.java	(revision 18010)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyle.java	(revision 18011)
@@ -17,4 +17,5 @@
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Objects;
 import java.util.Optional;
@@ -24,8 +25,6 @@
 import javax.imageio.ImageIO;
 import javax.json.Json;
-import javax.json.JsonArray;
 import javax.json.JsonObject;
 import javax.json.JsonReader;
-import javax.json.JsonStructure;
 import javax.json.JsonValue;
 
@@ -60,6 +59,5 @@
                     BufferedReader reader = style.getContentReader();
                     JsonReader jsonReader = Json.createReader(reader)) {
-                JsonStructure structure = jsonReader.read();
-                return new MapboxVectorStyle(structure.asJsonObject());
+                return new MapboxVectorStyle(jsonReader.read().asJsonObject());
             } catch (IOException e) {
                 Logging.error(e);
@@ -100,6 +98,6 @@
             final List<Source> sourceList;
             if (jsonObject.containsKey("sources") && jsonObject.get("sources").getValueType() == JsonValue.ValueType.OBJECT) {
-                final JsonObject sourceObj = jsonObject.getJsonObject("sources");
-                sourceList = sourceObj.entrySet().stream().filter(entry -> entry.getValue().getValueType() == JsonValue.ValueType.OBJECT)
+                sourceList = jsonObject.getJsonObject("sources").entrySet().stream()
+                  .filter(entry -> entry.getValue().getValueType() == JsonValue.ValueType.OBJECT)
                   .map(entry -> {
                       try {
@@ -119,6 +117,6 @@
             final List<Layers> layers;
             if (jsonObject.containsKey("layers") && jsonObject.get("layers").getValueType() == JsonValue.ValueType.ARRAY) {
-                JsonArray lArray = jsonObject.getJsonArray("layers");
-                layers = lArray.stream().filter(JsonObject.class::isInstance).map(JsonObject.class::cast).map(obj -> new Layers(id, obj))
+                layers = jsonObject.getJsonArray("layers").stream()
+                  .filter(JsonObject.class::isInstance).map(JsonObject.class::cast).map(obj -> new Layers(id, obj))
                   .collect(Collectors.toList());
             } else {
@@ -130,5 +128,5 @@
             // Abuse HashMap null (null == default)
             this.sources = new LinkedHashMap<>();
-            for (Map.Entry<Optional<Source>, List<Layers>> entry : sourceLayer.entrySet()) {
+            for (Entry<Optional<Source>, List<Layers>> entry : sourceLayer.entrySet()) {
                 final Source source = entry.getKey().orElse(null);
                 final String data = entry.getValue().stream().map(Layers::toString).collect(Collectors.joining());
@@ -159,5 +157,5 @@
         // HiDPI images first -- if this succeeds, don't bother with the lower resolution (JOSM has no method to switch)
         try (CachedFile spriteJson = new CachedFile(this.spriteUrl + "@2x.json");
-          CachedFile spritePng = new CachedFile(this.spriteUrl + "@2x.png")) {
+             CachedFile spritePng = new CachedFile(this.spriteUrl + "@2x.png")) {
             if (parseSprites(spriteJson, spritePng)) {
                 return;
@@ -165,5 +163,5 @@
         }
         try (CachedFile spriteJson = new CachedFile(this.spriteUrl + ".json");
-        CachedFile spritePng = new CachedFile(this.spriteUrl + ".png")) {
+             CachedFile spritePng = new CachedFile(this.spriteUrl + ".png")) {
             parseSprites(spriteJson, spritePng);
         }
@@ -193,5 +191,5 @@
             return false;
         }
-        for (Map.Entry<String, JsonValue> entry : spriteObject.entrySet()) {
+        for (Entry<String, JsonValue> entry : spriteObject.entrySet()) {
             final JsonObject info = entry.getValue().asJsonObject();
             int width = info.getInt("width");
@@ -218,4 +216,5 @@
         }
         final File toSave = new File(location, name);
+        Logging.debug("Saving {0} to {1}...", object.getClass().getSimpleName(), toSave);
         try {
             if (object instanceof BufferedImage) {
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 18010)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 18011)
@@ -95,6 +95,5 @@
     static final Set<String> SUPPORTED_KEYS = new HashSet<>();
     static {
-        Field[] declaredFields = StyleKeys.class.getDeclaredFields();
-        for (Field f : declaredFields) {
+        for (Field f : StyleKeys.class.getDeclaredFields()) {
             try {
                 SUPPORTED_KEYS.add((String) f.get(null));
Index: /trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyleTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyleTest.java	(revision 18010)
+++ /trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyleTest.java	(revision 18011)
@@ -21,4 +21,5 @@
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -127,16 +128,20 @@
         MapCSSStyleSource styleSource2 = (MapCSSStyleSource) sources.get(source2).getStyleSources().get(0);
 
+        awaitSaveFinished();
+
+        assertTrue(styleSource1.url.endsWith("source1.mapcss"));
+        assertTrue(styleSource2.url.endsWith("source2.mapcss"));
+
+        MapCSSStyleSource mapCSSStyleSource1 = new MapCSSStyleSource(styleSource1.url, styleSource1.name, styleSource1.title);
+        MapCSSStyleSource mapCSSStyleSource2 = new MapCSSStyleSource(styleSource2.url, styleSource2.name, styleSource2.title);
+
+        assertEquals(styleSource1, mapCSSStyleSource1);
+        assertEquals(styleSource2, mapCSSStyleSource2);
+    }
+
+    private static void awaitSaveFinished() {
         AtomicBoolean saveFinished = new AtomicBoolean();
         MainApplication.worker.execute(() -> saveFinished.set(true));
         Awaitility.await().atMost(Durations.ONE_SECOND).until(saveFinished::get);
-
-        assertTrue(styleSource1.url.endsWith("source1.mapcss"));
-        assertTrue(styleSource2.url.endsWith("source2.mapcss"));
-
-        MapCSSStyleSource mapCSSStyleSource1 = new MapCSSStyleSource(styleSource1.url, styleSource1.name, styleSource1.title);
-        MapCSSStyleSource mapCSSStyleSource2 = new MapCSSStyleSource(styleSource2.url, styleSource2.name, styleSource2.title);
-
-        assertEquals(styleSource1, mapCSSStyleSource1);
-        assertEquals(styleSource2, mapCSSStyleSource2);
     }
 
@@ -165,7 +170,5 @@
         assertEquals(spritePath, style.getSpriteUrl());
 
-        AtomicBoolean saveFinished = new AtomicBoolean();
-        MainApplication.worker.execute(() -> saveFinished.set(true));
-        Awaitility.await().atMost(Durations.ONE_SECOND).until(saveFinished::get);
+        awaitSaveFinished();
 
         int scalar = 28; // 255 / 9 (could be 4, but this was a nicer number)
@@ -246,6 +249,10 @@
         assertNotNull(mapillarySource, style.toString());
         mapillarySource.getStyleSources().forEach(StyleSource::loadStyleSource);
-        assertEquals(1, mapillarySource.getStyleSources().size());
-        final MapCSSStyleSource mapillaryCssSource = (MapCSSStyleSource) mapillarySource.getStyleSources().get(0);
+        List<StyleSource> styleSources = mapillarySource.getStyleSources();
+        assertEquals(1, styleSources.size());
+        final MapCSSStyleSource mapillaryCssSource = (MapCSSStyleSource) styleSources.get(0);
+
+        awaitSaveFinished();
+
         assertTrue(mapillaryCssSource.getErrors().isEmpty(), mapillaryCssSource.getErrors().toString());
         final MapCSSRule mapillaryOverview = getRule(mapillaryCssSource, "node", "mapillary-overview");
