diff options
author | Dominik Stadler <centic@apache.org> | 2022-02-24 18:12:25 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2022-02-24 18:12:25 +0000 |
commit | 25769795de779a2a90829a61bfc74196b43abdc2 (patch) | |
tree | be4cf585df8e100d6ec2f08e054692d649fcdd35 /poi-integration | |
parent | bb18d585f8994fc619bc6d54ebc2030cbc041022 (diff) | |
download | poi-25769795de779a2a90829a61bfc74196b43abdc2.tar.gz poi-25769795de779a2a90829a61bfc74196b43abdc2.zip |
Fix some SpotBugs reports
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898383 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-integration')
-rw-r--r-- | poi-integration/src/test/java/org/apache/poi/stress/AbstractFileHandler.java | 3 | ||||
-rw-r--r-- | poi-integration/src/test/java/org/apache/poi/stress/FileHandlerKnown.java | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/poi-integration/src/test/java/org/apache/poi/stress/AbstractFileHandler.java b/poi-integration/src/test/java/org/apache/poi/stress/AbstractFileHandler.java index fec396281d..4bc11d0c40 100644 --- a/poi-integration/src/test/java/org/apache/poi/stress/AbstractFileHandler.java +++ b/poi-integration/src/test/java/org/apache/poi/stress/AbstractFileHandler.java @@ -44,7 +44,8 @@ import org.apache.poi.util.IOUtils; * in the integration tests, mostly text-extraction related at the moment. */ public abstract class AbstractFileHandler implements FileHandler { - public static final Set<String> EXPECTED_EXTRACTOR_FAILURES = new HashSet<>(Arrays.asList( + // some FileHandlers extend this list!?! + protected static final Set<String> EXPECTED_EXTRACTOR_FAILURES = new HashSet<>(Arrays.asList( // password protected files without password // ... currently none ... diff --git a/poi-integration/src/test/java/org/apache/poi/stress/FileHandlerKnown.java b/poi-integration/src/test/java/org/apache/poi/stress/FileHandlerKnown.java index e7b1a8e7eb..c3f1e11137 100644 --- a/poi-integration/src/test/java/org/apache/poi/stress/FileHandlerKnown.java +++ b/poi-integration/src/test/java/org/apache/poi/stress/FileHandlerKnown.java @@ -18,7 +18,7 @@ package org.apache.poi.stress; import java.io.File; import java.io.InputStream; -import java.util.function.Supplier; +import java.lang.reflect.InvocationTargetException; @SuppressWarnings("unused") public enum FileHandlerKnown { @@ -46,7 +46,8 @@ public enum FileHandlerKnown { // Because of no-scratchpad handling, we need to resort to reflection here String n = name().replace("NULL", "Null"); return (FileHandler)Class.forName("org.apache.poi.stress." + n + "FileHandler").getDeclaredConstructor().newInstance(); - } catch (Exception e) { + } catch (RuntimeException | ClassNotFoundException | NoSuchMethodException | InstantiationException | + IllegalAccessException | InvocationTargetException e) { return new NullFileHandler(); } } |