]> source.dussan.org Git - poi.git/commitdiff
Fix some SpotBugs reports
authorDominik Stadler <centic@apache.org>
Thu, 24 Feb 2022 18:12:25 +0000 (18:12 +0000)
committerDominik Stadler <centic@apache.org>
Thu, 24 Feb 2022 18:12:25 +0000 (18:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898383 13f79535-47bb-0310-9956-ffa450edef68

poi-integration/src/test/java/org/apache/poi/stress/AbstractFileHandler.java
poi-integration/src/test/java/org/apache/poi/stress/FileHandlerKnown.java

index fec396281d199474cf6a675a3c38efc66704026f..4bc11d0c40d528d2b3d76764af2764cb07bb0809 100644 (file)
@@ -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 ...
 
index e7b1a8e7eb4b0d6a0b89cfd9f6821d7e50ff119b..c3f1e11137594db68fbcc41afe2067cea105302c 100644 (file)
@@ -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();
         }
     }