Index: /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 9410)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 9411)
@@ -1319,6 +1319,6 @@
         private final String url;
         private final List<SourceProvider> sourceProviders;
-        private BufferedReader reader;
-        private boolean canceled;
+        private transient CachedFile cachedFile;
+        private transient boolean canceled;
         private final List<ExtendedSourceEntry> sources = new ArrayList<>();
 
@@ -1332,5 +1332,5 @@
         protected void cancel() {
             canceled = true;
-            Utils.close(reader);
+            Utils.close(cachedFile);
         }
 
@@ -1356,5 +1356,4 @@
         @Override
         protected void realRun() throws SAXException, IOException, OsmTransferException {
-            String lang = LanguageInfo.getLanguageCodeXML();
             try {
                 sources.addAll(getDefault());
@@ -1367,7 +1366,19 @@
                     }
                 }
-
-                InputStream stream = new CachedFile(url).getInputStream();
-                reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8));
+                readFile();
+            } catch (IOException e) {
+                if (canceled)
+                    // ignore the exception and return
+                    return;
+                OsmTransferException ex = new OsmTransferException(e);
+                ex.setUrl(url);
+                warn(ex);
+            }
+        }
+
+        protected void readFile() throws IOException {
+            final String lang = LanguageInfo.getLanguageCodeXML();
+            cachedFile = new CachedFile(url);
+            try (final BufferedReader reader = cachedFile.getContentReader()) {
 
                 String line;
@@ -1434,12 +1445,4 @@
                     }
                 }
-            } catch (IOException e) {
-                if (canceled)
-                    // ignore the exception and return
-                    return;
-                OsmTransferException ex = new OsmTransferException(e);
-                ex.setUrl(url);
-                warn(ex);
-                return;
             }
         }
Index: /trunk/src/org/openstreetmap/josm/io/CachedFile.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/CachedFile.java	(revision 9410)
+++ /trunk/src/org/openstreetmap/josm/io/CachedFile.java	(revision 9411)
@@ -5,4 +5,6 @@
 
 import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.Closeable;
 import java.io.File;
 import java.io.FileInputStream;
@@ -41,5 +43,5 @@
  * you can also get the mirrored copy with {@link #getFile()}.
  */
-public class CachedFile {
+public class CachedFile implements Closeable {
 
     /**
@@ -67,4 +69,5 @@
     protected CachingStrategy cachingStrategy;
 
+    private transient HttpClient activeConnection;
     protected File cacheFile;
     protected boolean initialized;
@@ -197,4 +200,17 @@
         }
         return new FileInputStream(file);
+    }
+
+    /**
+     * Returns {@link #getInputStream()} wrapped in a buffered reader.
+     * <p/>
+     * Detects Unicode charset in use utilizing {@link UTFInputStreamReader}.
+     *
+     * @return buffered reader
+     * @throws IOException if any I/O error occurs
+     * @since 9411
+     */
+    public BufferedReader getContentReader() throws IOException {
+        return new BufferedReader(UTFInputStreamReader.create(getInputStream()));
     }
 
@@ -413,9 +429,9 @@
         destDirFile = new File(destDir, localPath + ".tmp");
         try {
-            final HttpClient.Response con = HttpClient.create(url)
+            activeConnection = HttpClient.create(url)
                     .setAccept(httpAccept)
                     .setIfModifiedSince(ifModifiedSince == null ? 0L : ifModifiedSince)
-                    .setHeaders(httpHeaders)
-                    .connect();
+                    .setHeaders(httpHeaders);
+            final HttpClient.Response con = activeConnection.connect();
             if (ifModifiedSince != null && con.getResponseCode() == HttpURLConnection.HTTP_NOT_MODIFIED) {
                 if (Main.isDebugEnabled()) {
@@ -431,4 +447,5 @@
                 Files.copy(bis, destDirFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
             }
+            activeConnection = null;
             localFile = new File(destDir, localPath);
             if (Main.platform.rename(destDirFile, localFile)) {
@@ -456,3 +473,14 @@
     }
 
+    /**
+     * Attempts to disconnect an URL connection.
+     * @see HttpClient#disconnect()
+     * @since 9411
+     */
+    @Override
+    public void close() {
+        if (activeConnection != null) {
+            activeConnection.disconnect();
+        }
+    }
 }
