Index: trunk/src/org/openstreetmap/josm/data/imagery/CachedAttributionBingAerialTileSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/CachedAttributionBingAerialTileSource.java	(revision 19179)
+++ trunk/src/org/openstreetmap/josm/data/imagery/CachedAttributionBingAerialTileSource.java	(revision 19180)
@@ -10,8 +10,10 @@
 import java.nio.charset.StandardCharsets;
 import java.util.List;
+import java.util.Objects;
 import java.util.Timer;
 import java.util.TimerTask;
 import java.util.concurrent.Callable;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 
@@ -89,5 +91,5 @@
     protected Callable<List<Attribution>> getAttributionLoaderCallable() {
         final AtomicReference<List<Attribution>> attributions = new AtomicReference<>();
-        final AtomicBoolean finished = new AtomicBoolean();
+        final CountDownLatch finished = new CountDownLatch(1);
         return () -> {
             final PleaseWaitProgressMonitor monitor = new PleaseWaitProgressMonitor();
@@ -95,11 +97,12 @@
             final Timer timer = new Timer(Thread.currentThread().getName() + "-timer", true);
             timer.schedule(new AttributionTimerTask(monitor, timer, 1, attributions, finished), 0);
-            synchronized (finished) {
-                while (!finished.get() && !monitor.isCanceled()) {
-                    finished.wait(1000);
+            try {
+                while (!monitor.isCanceled() && !finished.await(1, TimeUnit.SECONDS)) {
+                    // Do nothing; we are waiting on the CountDownLatch to hit zero.
                 }
+            } finally {
+                monitor.finishTask();
+                monitor.close();
             }
-            monitor.finishTask();
-            monitor.close();
             return attributions.get();
         };
@@ -114,5 +117,5 @@
         private final int waitTimeSec;
         private final AtomicReference<List<Attribution>> attributions;
-        private final AtomicBoolean finished;
+        private final CountDownLatch finished;
 
         /**
@@ -125,5 +128,5 @@
          */
         AttributionTimerTask(ProgressMonitor monitor, Timer timer, int waitTimeSec,
-                             AtomicReference<List<Attribution>> attributions, AtomicBoolean finished) {
+                             AtomicReference<List<Attribution>> attributions, CountDownLatch finished) {
             this.monitor = monitor;
             this.timer = timer;
@@ -138,4 +141,5 @@
             try {
                 String xml = attributionLoader.updateIfRequiredString();
+                Objects.requireNonNull(xml);
                 List<Attribution> ret;
                 try (StringReader sr = new StringReader(xml)) {
@@ -147,10 +151,10 @@
                 }
                 this.attributions.set(ret);
-                this.finished.set(true);
+                this.finished.countDown();
             } catch (IOException ex) {
                 final String message = tr("Could not connect to Bing API. Will retry in {0} seconds.", waitTimeSec);
                 Logging.log(Logging.LEVEL_WARN, message, ex);
                 if (this.monitor.isCanceled()) {
-                    this.finished.set(true);
+                    this.finished.countDown();
                     return;
                 }
@@ -160,8 +164,4 @@
                 this.timer.schedule(new AttributionTimerTask(this.monitor, this.timer, newWaitTimeSec, this.attributions, this.finished),
                         newWaitTimeSec * 1000L);
-            } finally {
-                synchronized (this.finished) {
-                    this.finished.notifyAll();
-                }
             }
         }
Index: trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledTiledMapRenderer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledTiledMapRenderer.java	(revision 19179)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledTiledMapRenderer.java	(revision 19180)
@@ -251,6 +251,6 @@
         temporaryView.zoomTo(bounds.getCenter().getEastNorth(ProjectionRegistry.getProjection()), mapState.getScale());
         BufferedImage bufferedImage = Optional.ofNullable(nc.getGraphicsConfiguration())
-                .map(gc -> gc.createCompatibleImage(tileSize * xCount + xCount, tileSize * yCount + xCount, Transparency.TRANSLUCENT))
-                .orElseGet(() -> new BufferedImage(tileSize * xCount + xCount, tileSize * yCount + xCount, BufferedImage.TYPE_INT_ARGB));
+                .map(gc -> gc.createCompatibleImage(tileSize * xCount + xCount, tileSize * yCount + yCount, Transparency.TRANSLUCENT))
+                .orElseGet(() -> new BufferedImage(tileSize * xCount + xCount, tileSize * yCount + yCount, BufferedImage.TYPE_INT_ARGB));
         Graphics2D g2d = bufferedImage.createGraphics();
         try {
@@ -335,5 +335,5 @@
          * @param tImage The tile image for this job
          */
-        private synchronized void cacheTile(BufferedImage tImage) {
+        private void cacheTile(BufferedImage tImage) {
             cache.put(tile, new ImageCache(tImage, null, false));
             done = true;
Index: trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 19179)
+++ trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 19180)
@@ -1342,4 +1342,5 @@
         // 256 is the "target" size, (TODO check HiDPI!)
         final int targetSize = Config.getPref().getInt("mappaint.fast_render.tile_size", 256);
+        CheckParameterUtil.ensureThat(targetSize > 0, "mappaint.fast_render.tile_size should be > 0 (default 256)");
         final double topResolution = 2 * Math.PI * OsmMercator.EARTH_RADIUS / targetSize;
         int zoom;
