diff options
author | PJ Fanning <fanningpj@apache.org> | 2022-07-17 01:53:18 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2022-07-17 01:53:18 +0000 |
commit | c589f0ee7a9c5c104244373720ddd6bf0ab68ca9 (patch) | |
tree | 88967bf7b53e347252d69837dbb6cc486dad3973 /poi-examples | |
parent | dc7e2de82eef66051ae7684a9fae15f7540e4460 (diff) | |
download | poi-c589f0ee7a9c5c104244373720ddd6bf0ab68ca9.tar.gz poi-c589f0ee7a9c5c104244373720ddd6bf0ab68ca9.zip |
[github-339] Add extra methods to StringUtil and refactor some code to use them. Thanks to XenoAmess. This closes #339
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1902789 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-examples')
-rw-r--r-- | poi-examples/src/main/java/org/apache/poi/examples/xssf/eventusermodel/FromHowTo.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xssf/eventusermodel/FromHowTo.java b/poi-examples/src/main/java/org/apache/poi/examples/xssf/eventusermodel/FromHowTo.java index 60246e07a3..14d5fbd9e8 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/xssf/eventusermodel/FromHowTo.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/xssf/eventusermodel/FromHowTo.java @@ -25,6 +25,7 @@ import javax.xml.parsers.ParserConfigurationException; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackageAccess; +import org.apache.poi.util.StringUtil; import org.apache.poi.util.XMLHelper; import org.apache.poi.xssf.eventusermodel.XSSFReader; import org.apache.poi.xssf.model.SharedStrings; @@ -132,7 +133,7 @@ public class FromHowTo { throws SAXException { // Process the last contents as required. // Do now, as characters() may be called more than once - if(nextIsString && !lastContents.trim().isEmpty()) { + if(nextIsString && StringUtil.isNotBlank(lastContents)) { Integer idx = Integer.valueOf(lastContents); lastContents = lruCache.get(idx); if (lastContents == null && !lruCache.containsKey(idx)) { |