From cf22371d3e3cb36d84e03a09396df9e1c9c10c1a Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 14 Oct 2018 12:10:50 +0200 Subject: [PATCH] Catch IllegalArgumentException in XmlUtil clinit Fixes SMACK-833. --- .../src/main/java/org/jivesoftware/smack/util/XmlUtil.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/XmlUtil.java b/smack-core/src/main/java/org/jivesoftware/smack/util/XmlUtil.java index 7fc081b43..b55297d6e 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/util/XmlUtil.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/util/XmlUtil.java @@ -35,7 +35,11 @@ public class XmlUtil { private static final TransformerFactory transformerFactory = TransformerFactory.newInstance(); static { - transformerFactory.setAttribute("indent-number", 2); + try { + transformerFactory.setAttribute("indent-number", 2); + } catch (IllegalArgumentException e) { + LOGGER.log(Level.INFO, "XML TransformerFactory does not support indent-number attribute", e); + } } public static String prettyFormatXml(CharSequence xml) {