Index: trunk/src/org/openstreetmap/josm/io/OsmJsonReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmJsonReader.java	(revision 18655)
+++ trunk/src/org/openstreetmap/josm/io/OsmJsonReader.java	(revision 18656)
@@ -4,4 +4,5 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.io.IOException;
 import java.io.InputStream;
 import java.util.Collection;
@@ -10,4 +11,5 @@
 import javax.json.Json;
 import javax.json.JsonArray;
+import javax.json.JsonException;
 import javax.json.JsonNumber;
 import javax.json.JsonObject;
@@ -179,8 +181,19 @@
     @Override
     protected DataSet doParseDataSet(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException {
-        return doParseDataSet(source, progressMonitor, ir -> {
-            setParser(Json.createParser(ir));
-            parse();
-        });
+        try {
+            return doParseDataSet(source, progressMonitor, ir -> {
+                setParser(Json.createParser(ir));
+                parse();
+            });
+        } catch (JsonException exception) {
+            if (exception.getCause() instanceof IOException) {
+                IllegalDataException ide = new IllegalDataException(exception.getCause());
+                // PMD 7 should be able to figure out that this is not an issue. See https://github.com/pmd/pmd/issues/2134 .
+                ide.addSuppressed(exception);
+                throw ide; // NOPMD
+            } else {
+                throw exception;
+            }
+        }
     }
 
Index: trunk/src/org/openstreetmap/josm/tools/HttpClient.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/HttpClient.java	(revision 18655)
+++ trunk/src/org/openstreetmap/josm/tools/HttpClient.java	(revision 18656)
@@ -34,5 +34,4 @@
 import org.openstreetmap.josm.io.auth.DefaultAuthenticator;
 import org.openstreetmap.josm.spi.preferences.Config;
-import org.openstreetmap.josm.tools.TextUtils;
 
 /**
