diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2019-12-03 21:56:47 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2019-12-03 21:56:47 +0000 |
commit | 08159e66a738c291572745cee8cc3617777dc2b5 (patch) | |
tree | 849e1239faa41d3493e57a0141a1c3d6b598fd9f /src/ooxml/java/org/apache/poi/xssf/eventusermodel | |
parent | dd3279df30eb9656c3a72f4a6a2445f777c7dd5a (diff) | |
download | poi-08159e66a738c291572745cee8cc3617777dc2b5.tar.gz poi-08159e66a738c291572745cee8cc3617777dc2b5.zip |
Sonar Fixes + Refactor scattered XML initializations to XMLHelper
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1870769 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi/xssf/eventusermodel')
-rw-r--r-- | src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java | 7 | ||||
-rw-r--r-- | src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java index 09191f9abf..17013e7333 100644 --- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java @@ -18,18 +18,19 @@ package org.apache.poi.xssf.eventusermodel; import static org.apache.poi.xssf.usermodel.XSSFRelation.NS_SPREADSHEETML; -import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; import java.io.InputStream; import java.io.PushbackInputStream; import java.util.ArrayList; import java.util.List; +import javax.xml.parsers.ParserConfigurationException; + import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackagePart; -import org.apache.poi.ooxml.util.SAXHelper; import org.apache.poi.ss.usermodel.RichTextString; import org.apache.poi.util.Removal; +import org.apache.poi.util.XMLHelper; import org.apache.poi.xssf.model.SharedStrings; import org.apache.poi.xssf.usermodel.XSSFRelation; import org.apache.poi.xssf.usermodel.XSSFRichTextString; @@ -173,7 +174,7 @@ public class ReadOnlySharedStringsTable extends DefaultHandler implements Shared pis.unread(emptyTest); InputSource sheetSource = new InputSource(pis); try { - XMLReader sheetParser = SAXHelper.newXMLReader(); + XMLReader sheetParser = XMLHelper.newXMLReader(); sheetParser.setContentHandler(this); sheetParser.parse(sheetSource); } catch(ParserConfigurationException e) { diff --git a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java index 8d1ce1a949..b239951c43 100644 --- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java +++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java @@ -16,7 +16,6 @@ ==================================================================== */ package org.apache.poi.xssf.eventusermodel; -import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; @@ -30,6 +29,8 @@ import java.util.List; import java.util.Map; import java.util.Set; +import javax.xml.parsers.ParserConfigurationException; + import org.apache.poi.ooxml.POIXMLException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.exceptions.OpenXML4JException; @@ -42,7 +43,7 @@ import org.apache.poi.openxml4j.opc.PackageRelationshipTypes; import org.apache.poi.openxml4j.opc.PackagingURIHelper; import org.apache.poi.util.POILogFactory; import org.apache.poi.util.POILogger; -import org.apache.poi.ooxml.util.SAXHelper; +import org.apache.poi.util.XMLHelper; import org.apache.poi.xssf.model.CommentsTable; import org.apache.poi.xssf.model.SharedStringsTable; import org.apache.poi.xssf.model.StylesTable; @@ -253,7 +254,7 @@ public class XSSFReader { XMLSheetRefReader xmlSheetRefReader = new XMLSheetRefReader(); XMLReader xmlReader; try { - xmlReader = SAXHelper.newXMLReader(); + xmlReader = XMLHelper.newXMLReader(); } catch (ParserConfigurationException | SAXException e) { throw new POIXMLException(e); } |