aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2020-07-15 23:11:33 +0000
committerPJ Fanning <fanningpj@apache.org>2020-07-15 23:11:33 +0000
commit0bcb28936555c76824cc72c0890a9c01635304b3 (patch)
treeeb7dc187c83998f6b6bd2764fe60d60de3eed4d9 /src/examples
parentd1d90ed1717c0be7629fd4fd46c228ce784db0f0 (diff)
downloadpoi-0bcb28936555c76824cc72c0890a9c01635304b3.tar.gz
poi-0bcb28936555c76824cc72c0890a9c01635304b3.zip
try to make examples more robust - to fix integration tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1879913 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java2
-rw-r--r--src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java b/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java
index 8540cb237b..5b9a519b28 100644
--- a/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java
+++ b/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java
@@ -132,7 +132,7 @@ public class XLSX2CSV {
//noinspection ResultOfMethodCallIgnored
Double.parseDouble(formattedValue);
output.append(formattedValue);
- } catch (NumberFormatException e) {
+ } catch (Exception e) {
output.append('"');
output.append(formattedValue);
output.append('"');
diff --git a/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java b/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java
index 9f4d1e629b..3c79e1c4fa 100644
--- a/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java
+++ b/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java
@@ -133,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.isEmpty()) {
+ if(nextIsString && !lastContents.trim().isEmpty()) {
Integer idx = Integer.valueOf(lastContents);
lastContents = lruCache.get(idx);
if (lastContents == null && !lruCache.containsKey(idx)) {