diff --git a/platform/libs.jsvg/external/binaries-list b/platform/libs.jsvg/external/binaries-list
index 9076715ac7c0..dbeb5596c0f3 100644
--- a/platform/libs.jsvg/external/binaries-list
+++ b/platform/libs.jsvg/external/binaries-list
@@ -15,4 +15,4 @@
# specific language governing permissions and limitations
# under the License.
-A84D34480044DB51A1448E9C0E32BD284B797288 com.github.weisj:jsvg:1.6.1
+2B5F6F42F2B26EE72F6405F66F839DEF459CCA3C com.github.weisj:jsvg:1.7.1
diff --git a/platform/libs.jsvg/external/jsvg-1.6.1-license.txt b/platform/libs.jsvg/external/jsvg-1.7.1-license.txt
similarity index 97%
rename from platform/libs.jsvg/external/jsvg-1.6.1-license.txt
rename to platform/libs.jsvg/external/jsvg-1.7.1-license.txt
index 3b8f0f662212..a98fab3f70e5 100644
--- a/platform/libs.jsvg/external/jsvg-1.6.1-license.txt
+++ b/platform/libs.jsvg/external/jsvg-1.7.1-license.txt
@@ -1,10 +1,10 @@
Name: JSVG
-Version: 1.6.1
+Version: 1.7.1
Description: JSVG - A Java SVG implementation
License: MIT-jsvg
Origin: JSVG
URL: https://github.com/weisJ/jsvg
-Files: jsvg-1.6.1.jar
+Files: jsvg-1.7.1.jar
MIT License
diff --git a/platform/libs.jsvg/manifest.mf b/platform/libs.jsvg/manifest.mf
index c0657cdc1e4c..6df9e8ba5d85 100644
--- a/platform/libs.jsvg/manifest.mf
+++ b/platform/libs.jsvg/manifest.mf
@@ -1,5 +1,6 @@
Manifest-Version: 1.0
-OpenIDE-Module: org.netbeans.libs.jsvg
-OpenIDE-Module-Implementation-Version: 1
+OpenIDE-Module: org.netbeans.libs.jsvg/2
+OpenIDE-Module-Implementation-Version: 1.7.1
+OpenIDE-Module-Specification-Version: 2.0
OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/jsvg/Bundle.properties
AutoUpdate-Show-In-Client: false
diff --git a/platform/libs.jsvg/nbproject/project.properties b/platform/libs.jsvg/nbproject/project.properties
index 3bacf6f03dbe..0b817fe8d124 100644
--- a/platform/libs.jsvg/nbproject/project.properties
+++ b/platform/libs.jsvg/nbproject/project.properties
@@ -15,12 +15,13 @@
# specific language governing permissions and limitations
# under the License.
-file.reference.jsvg-1.6.1.jar=external/jsvg-1.6.1.jar
-release.external/jsvg-1.6.1.jar=modules/ext/jsvg-1.6.1.jar
+file.reference.jsvg-1.7.1.jar=external/jsvg-1.7.1.jar
+release.external/jsvg-1.7.1.jar=modules/ext/jsvg-1.7.1.jar
is.autoload=true
javac.source=1.8
nbm.homepage=https://github.com/weisJ/jsvg
+
sigtest.gen.fail.on.error=false
-spec.version.base=1.23.0
+spec.version.base.fatal.warning=false
diff --git a/platform/libs.jsvg/nbproject/project.xml b/platform/libs.jsvg/nbproject/project.xml
index 0053019fd856..2096518136be 100644
--- a/platform/libs.jsvg/nbproject/project.xml
+++ b/platform/libs.jsvg/nbproject/project.xml
@@ -56,8 +56,8 @@
com.github.weisj.jsvg.util
- ext/jsvg-1.6.1.jar
- external/jsvg-1.6.1.jar
+ ext/jsvg-1.7.1.jar
+ external/jsvg-1.7.1.jar
diff --git a/platform/openide.util.ui.svg/nbproject/project.xml b/platform/openide.util.ui.svg/nbproject/project.xml
index 251685f9ec8d..971390819d97 100644
--- a/platform/openide.util.ui.svg/nbproject/project.xml
+++ b/platform/openide.util.ui.svg/nbproject/project.xml
@@ -30,7 +30,8 @@
- 1.0
+ 2
+ 2.0
diff --git a/platform/openide.util.ui.svg/src/org/openide/util/svg/SVGIcon.java b/platform/openide.util.ui.svg/src/org/openide/util/svg/SVGIcon.java
index 48a04ec64b49..85d8087c4eaa 100644
--- a/platform/openide.util.ui.svg/src/org/openide/util/svg/SVGIcon.java
+++ b/platform/openide.util.ui.svg/src/org/openide/util/svg/SVGIcon.java
@@ -37,6 +37,7 @@
import com.github.weisj.jsvg.SVGDocument;
import com.github.weisj.jsvg.geometry.size.FloatSize;
import com.github.weisj.jsvg.parser.LoaderContext;
+import com.github.weisj.jsvg.parser.ParsedDocument;
import com.github.weisj.jsvg.parser.ResourceLoader;
import com.github.weisj.jsvg.parser.SVGLoader;
import com.github.weisj.jsvg.renderer.awt.NullPlatformSupport;
@@ -128,14 +129,13 @@ private static SVGDocument loadSVGDocument(URL url, Dimension toSize) throws IOE
final SVGDocument svgDocument;
FloatSize documentSize;
- InputStream is = url.openStream();
- try {
+ try (InputStream is = url.openStream()) {
// Explicitly deny loading of external URLs.
/* Handle e.g. elements. Tested in
testLoadImageWithExternalImageHref. */
List externalResourceExceptions = new ArrayList<>();
- ResourceLoader resourceLoader = (URI nnuri) -> {
+ ResourceLoader resourceLoader = (ParsedDocument nnpd, URI nnuri) -> {
IOException e = new IOException("External resource loading from SVG file not permitted ("+
nnuri + " from " + url + ")");
externalResourceExceptions.add(e);
@@ -168,8 +168,6 @@ private static SVGDocument loadSVGDocument(URL url, Dimension toSize) throws IOE
} catch (RuntimeException e) {
/* Rethrow any uncaught exceptions that could be thrown when parsing invalid SVG files. */
throw new IOException("Error parsing SVG file", e);
- } finally {
- is.close();
}
if (toSize != null) {
int width = (int) Math.ceil(documentSize.getWidth());