aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2021-01-15 23:50:42 +0000
committerAndreas Beeker <kiwiwings@apache.org>2021-01-15 23:50:42 +0000
commit309e657b0d8479583847d684febc3db10f12b4c4 (patch)
tree071abc4dfe85ac20704cd2689620b72c464c4e95 /src/java/org/apache/poi
parentca71e9dacf96e9739581568c10d3b3954f12bb5e (diff)
downloadpoi-309e657b0d8479583847d684febc3db10f12b4c4.tar.gz
poi-309e657b0d8479583847d684febc3db10f12b4c4.zip
#65046 - Simplify integration tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885538 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi')
-rw-r--r--src/java/org/apache/poi/util/Configurator.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/java/org/apache/poi/util/Configurator.java b/src/java/org/apache/poi/util/Configurator.java
index 7831f0d320..98595babbc 100644
--- a/src/java/org/apache/poi/util/Configurator.java
+++ b/src/java/org/apache/poi/util/Configurator.java
@@ -24,13 +24,15 @@ public class Configurator {
private static POILogger logger = POILogFactory.getLogger(Configurator.class);
public static int getIntValue(String systemProperty, int defaultValue) {
- int result = defaultValue;
String property = System.getProperty(systemProperty);
+ if (property == null || "".equals(property) || "null".equals(property)) {
+ return defaultValue;
+ }
try {
- result = Integer.parseInt(property);
+ return Integer.parseInt(property);
} catch (Exception e) {
logger.log(POILogger.ERROR, "System property -D", systemProperty, " does not contains a valid integer: ", property);
+ return defaultValue;
}
- return result;
}
}