diff --git a/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/filter/AttributeFilter.java b/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/filter/AttributeFilter.java index e0e2281912..cf6ebb39e1 100644 --- a/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/filter/AttributeFilter.java +++ b/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/filter/AttributeFilter.java @@ -95,16 +95,12 @@ public void filter(Document document, Map cleaningParameters) xPathFactory = (XPathFactory) executionContext.getProperty(XPathFactory.class.getName()); if (xPathFactory == null) { - synchronized (XPathFactory.class) { - xPathFactory = XPathFactory.newInstance(); - } + xPathFactory = XPathFactory.newInstance(); executionContext.newProperty(XPathFactory.class.getName()).type(XPathFactory.class).inherited() .nonNull().initial(xPathFactory).makeFinal().declare(); } } else { - synchronized (XPathFactory.class) { - xPathFactory = XPathFactory.newInstance(); - } + xPathFactory = XPathFactory.newInstance(); }