From cb6d768d105abbe2f4458dbd0e14f695de11c7ea Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Tue, 19 Mar 2024 14:28:48 +0100 Subject: [PATCH] Update metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java Co-authored-by: Jens Wille --- .../main/java/org/metafacture/xml/SimpleXmlEncoder.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java b/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java index 7b317b754..b55955ea3 100644 --- a/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java +++ b/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java @@ -224,18 +224,12 @@ public void setNamespaces(final Map namespaces) { */ public void setNamespaces(final String namespacesString) { final Properties properties = new Properties(); - final StringReader sr = new StringReader(namespacesString); - try { + try (StringReader sr = new StringReader(namespacesString)) { properties.load(sr); } catch (final IOException e) { throw new MetafactureException("Failed to create namespace list"); } - finally { - if (sr != null) { - sr.close(); - } - } propertiesToMap(properties); }