Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java	(revision 27506)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java	(revision 27507)
@@ -5,10 +5,9 @@
 import java.awt.Image;
 import java.io.IOException;
-import java.io.StringReader;
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
-import java.util.Scanner;
 import java.util.concurrent.Callable;
 import java.util.concurrent.Executors;
@@ -29,6 +28,4 @@
 
 import org.openstreetmap.gui.jmapviewer.Coordinate;
-import org.openstreetmap.josm.io.CacheCustomContent;
-import org.openstreetmap.josm.io.UTFInputStreamReader;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
@@ -52,22 +49,5 @@
     }
 
-    private static class BingAttributionData extends CacheCustomContent<IOException> {
-
-        public BingAttributionData() {
-            super("bing.attribution.xml", CacheCustomContent.INTERVAL_WEEKLY);
-        }
-
-        @Override
-        protected byte[] updateData() throws IOException {
-            URL u = new URL("http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Aerial?include=ImageryProviders&output=xml&key="
-                    + API_KEY);
-            UTFInputStreamReader in = UTFInputStreamReader.create(u.openStream(), "utf-8");
-            String r = new Scanner(in).useDelimiter("\\A").next();
-            System.out.println("Successfully loaded Bing attribution data.");
-            return r.getBytes("utf-8");
-        }
-    }
-
-    class Attribution {
+    protected class Attribution {
         String attribution;
         int minZoom;
@@ -89,9 +69,14 @@
     }
 
-    private List<Attribution> parseAttributionText(String xml) throws IOException {
+    protected URL getAttributionUrl() throws MalformedURLException {
+        return new URL("http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Aerial?include=ImageryProviders&output=xml&key="
+                + API_KEY);
+    }
+
+    protected List<Attribution> parseAttributionText(InputSource xml) throws IOException {
         try {
             DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
             DocumentBuilder builder = factory.newDocumentBuilder();
-            Document document = builder.parse(new InputSource(new StringReader(xml)));
+            Document document = builder.parse(xml);
 
             XPathFactory xPathFactory = XPathFactory.newInstance();
@@ -205,25 +190,30 @@
     }
 
+    protected Callable<List<Attribution>> getAttributionLoaderCallable() {
+        return new Callable<List<Attribution>>() {
+
+            @Override
+            public List<Attribution> call() throws Exception {
+                int waitTimeSec = 1;
+                while (true) {
+                    try {
+                        InputSource xml = new InputSource(getAttributionUrl().openStream());
+                        List<Attribution> r = parseAttributionText(xml);
+                        System.out.println("Successfully loaded Bing attribution data.");
+                        return r;
+                    } catch (IOException ex) {
+                        System.err.println("Could not connect to Bing API. Will retry in " + waitTimeSec + " seconds.");
+                        Thread.sleep(waitTimeSec * 1000L);
+                        waitTimeSec *= 2;
+                    }
+                }
+            }
+        };
+    }
+
     @Override
     public String getAttributionText(int zoom, Coordinate topLeft, Coordinate botRight) {
         if (attributions == null) {
-            attributions = Executors.newSingleThreadExecutor().submit(new Callable<List<Attribution>>() {
-
-                @Override
-                public List<Attribution> call() throws Exception {
-                    BingAttributionData attributionLoader = new BingAttributionData();
-                    int waitTimeSec = 1;
-                    while (true) {
-                        try {
-                            return parseAttributionText(attributionLoader.updateIfRequiredString());
-                        } catch (IOException ex) {
-                            System.err.println("Could not connect to Bing API. Will retry in " + waitTimeSec + " seconds.");
-                            Thread.sleep(waitTimeSec * 1000L);
-                            waitTimeSec *= 2;
-                            ex.printStackTrace();
-                        }
-                    }
-                }
-            });
+            attributions = Executors.newSingleThreadExecutor().submit(getAttributionLoaderCallable());
         }
         try {
