diff options
author | Manuel Bentele | 2021-05-21 08:26:45 +0200 |
---|---|---|
committer | Manuel Bentele | 2021-05-21 08:26:59 +0200 |
commit | c20eb8597d962fd99b4b6950adfd90ba8b9a17b1 (patch) | |
tree | ec26ba11d65fc7025bbfc1e781900a275eb42401 | |
parent | Rename 'vm.disk' package to 'virtualization.disk' (diff) | |
download | master-sync-shared-c20eb8597d962fd99b4b6950adfd90ba8b9a17b1.tar.gz master-sync-shared-c20eb8597d962fd99b4b6950adfd90ba8b9a17b1.tar.xz master-sync-shared-c20eb8597d962fd99b4b6950adfd90ba8b9a17b1.zip |
Remove error printing in low level XML helper method
The needless error printing during parsing of a XML document can be
removed since an failed attempt to parse the document will be reported
outside of the XML helper method.
Fixes: #3855 (partly)
-rw-r--r-- | src/main/java/org/openslx/util/XmlHelper.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main/java/org/openslx/util/XmlHelper.java b/src/main/java/org/openslx/util/XmlHelper.java index 4e814a0..6039b7b 100644 --- a/src/main/java/org/openslx/util/XmlHelper.java +++ b/src/main/java/org/openslx/util/XmlHelper.java @@ -89,14 +89,19 @@ public class XmlHelper public static Document parseDocumentFromStream( InputStream is ) { Document doc = null; + + // read document from stream try { doc = dBuilder.parse( is ); } catch ( SAXException | IOException e ) { - LOGGER.error( "Failed to parse input stream to document." ); + doc = null; } - if ( doc == null ) - return null; - doc.getDocumentElement().normalize(); + + // normalize parsed document + if ( doc != null ) { + doc.getDocumentElement().normalize(); + } + return doc; } |