Index: /trunk/README
===================================================================
--- /trunk/README	(revision 18069)
+++ /trunk/README	(revision 18070)
@@ -170,5 +170,4 @@
     -> http://commons.apache.org/proper/commons-validator
 * SVG Salamander: Support for SVG image format
-    src/com/kitfox/svg
     -> https://github.com/blackears/svgSalamander
 * Metadata Extractor: Read EXIF Metadata of photos
Index: /trunk/ivy.xml
===================================================================
--- /trunk/ivy.xml	(revision 18069)
+++ /trunk/ivy.xml	(revision 18070)
@@ -30,4 +30,5 @@
         <dependency conf="api->default" org="com.adobe.xmp" name="xmpcore" rev="6.1.11"/>
         <dependency conf="api->default" org="com.drewnoakes" name="metadata-extractor" rev="2.16.0" transitive="false"/>
+        <dependency conf="api->default" org="com.formdev" name="svgSalamander" rev="1.1.2.4"/>
         <dependency conf="api->default" org="ch.poole" name="OpeningHoursParser" rev="0.23.4"/>
         <dependency conf="api->default" org="oauth.signpost" name="signpost-core" rev="2.1.1"/>
@@ -43,4 +44,5 @@
         <dependency conf="sources->sources" org="com.adobe.xmp" name="xmpcore" rev="6.1.11"/>
         <dependency conf="sources->sources" org="com.drewnoakes" name="metadata-extractor" rev="2.16.0" transitive="false"/>
+        <dependency conf="sources->default" org="com.formdev" name="svgSalamander" rev="1.1.2.4"/>
         <dependency conf="sources->sources" org="ch.poole" name="OpeningHoursParser" rev="0.23.4"/>
         <dependency conf="sources->sources" org="oauth.signpost" name="signpost-core" rev="2.1.1"/>
Index: /trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 18069)
+++ /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 18070)
@@ -16,4 +16,5 @@
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Method;
 import java.net.MalformedURLException;
 import java.net.URI;
@@ -69,6 +70,4 @@
 import org.openstreetmap.josm.spi.preferences.Config;
 
-import com.kitfox.svg.xml.XMLParseUtil;
-
 /**
  * Basic utils, that can be useful in different parts of the program.
@@ -98,4 +97,17 @@
     private static final double TO_DEGREES = 180.0 / Math.PI;
     private static final double TO_RADIANS = Math.PI / 180.0;
+
+    /**
+     * A reference to {@code Map.ofEntries()} available since Java 9
+     */
+    static final Method mapOfEntries = mapOfEntriesMethod();
+
+    private static Method mapOfEntriesMethod() {
+        try {
+            return Map.class.getMethod("ofEntries", Map.Entry[].class);
+        } catch (NoSuchMethodException e) {
+            return null;
+        }
+    }
 
     private Utils() {
@@ -659,5 +671,18 @@
      */
     public static <K, V> Map<K, V> toUnmodifiableMap(Map<K, V> map) {
-        return XMLParseUtil.toUnmodifiableMap(map);
+        if (map == null || map.isEmpty()) {
+            return Collections.emptyMap();
+        } else if (map.size() == 1) {
+            final Map.Entry<K, V> entry = map.entrySet().iterator().next();
+            return Collections.singletonMap(entry.getKey(), entry.getValue());
+        } else if (mapOfEntries != null) {
+            try {
+                // Java 9: use Map.ofEntries(...)
+                return (Map<K, V>) mapOfEntries.invoke(null, new Object[]{map.entrySet().toArray(new Map.Entry[0])});
+            } catch (Exception ignore) {
+                Logging.trace(ignore);
+            }
+        }
+        return Collections.unmodifiableMap(map);
     }
 
