This is an automated email from the ASF dual-hosted git repository. juanpablo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit 3d61f0184c1908a90e42208ece540d77d4158a09 Author: Juan Pablo Santos RodrÃguez <[email protected]> AuthorDate: Fri Dec 31 16:19:06 2021 +0100 format, fix some typos, use log placeholders --- .../src/main/java/org/apache/wiki/util/XmlUtil.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/jspwiki-util/src/main/java/org/apache/wiki/util/XmlUtil.java b/jspwiki-util/src/main/java/org/apache/wiki/util/XmlUtil.java index 1b48cb6..cf9258f 100644 --- a/jspwiki-util/src/main/java/org/apache/wiki/util/XmlUtil.java +++ b/jspwiki-util/src/main/java/org/apache/wiki/util/XmlUtil.java @@ -63,16 +63,15 @@ public final class XmlUtil { * @param requestedNodes requested nodes on the xml file * @return the requested nodes of the XML file. */ - public static List<Element> parse( final String xml, final String requestedNodes ) - { + public static List< Element > parse( final String xml, final String requestedNodes ) { if( StringUtils.isNotEmpty( xml ) && StringUtils.isNotEmpty( requestedNodes ) ) { - final Set<Element> readed = new HashSet<>(); + final Set< Element > readed = new HashSet<>(); final SAXBuilder builder = new SAXBuilder(); try { final Enumeration< URL > resources = XmlUtil.class.getClassLoader().getResources( xml ); while( resources.hasMoreElements() ) { final URL resource = resources.nextElement(); - LOG.debug( "reading " + resource.toString() ); + LOG.debug( "reading {}", resource.toString() ); final Document doc = builder.build( resource ); final XPathFactory xpfac = XPathFactory.instance(); final XPathExpression<Element> xp = xpfac.compile( requestedNodes, Filters.element() ); @@ -80,9 +79,9 @@ public final class XmlUtil { } return new ArrayList<>( readed ); } catch( final IOException ioe ) { - LOG.error( "Couldn't load all " + xml + " resources", ioe ); + LOG.error( "Couldn't load all {} resources", xml, ioe ); } catch( final JDOMException jdome ) { - LOG.error( "error parsing " + xml + " resources", jdome ); + LOG.error( "error parsing {} resources", xml, jdome ); } } return Collections.emptyList(); @@ -102,19 +101,19 @@ public final class XmlUtil { try { final Document doc = builder.build( xmlStream ); final XPathFactory xpfac = XPathFactory.instance(); - final XPathExpression< Element > xp = xpfac.compile( requestedNodes,Filters.element() ); + final XPathExpression< Element > xp = xpfac.compile( requestedNodes, Filters.element() ); return xp.evaluate( doc ); } catch( final IOException ioe ) { - LOG.error( "Couldn't load all " + xmlStream + " resources", ioe ); + LOG.error( "Couldn't load all {} resources", xmlStream, ioe ); } catch( final JDOMException jdome ) { - LOG.error( "error parsing " + xmlStream + " resources", jdome ); + LOG.error( "error parsing {} resources", xmlStream, jdome ); } } return Collections.emptyList(); } /** - * Renders all the text() nodes from the DOM tree. This is very useful for cleaning away all of the XHTML. + * Renders all the text() nodes from the DOM tree. This is very useful for cleaning away all the XHTML. * * @param doc Dom tree * @return String containing only the text from the provided Dom tree.
