Author: centic
Date: Thu Feb 24 18:12:25 2022
New Revision: 1898383
URL: http://svn.apache.org/viewvc?rev=1898383&view=rev
Log:
Fix some SpotBugs reports
Modified:
poi/trunk/poi-integration/src/test/java/org/apache/poi/stress/AbstractFileHandler.java
poi/trunk/poi-integration/src/test/java/org/apache/poi/stress/FileHandlerKnown.java
Modified:
poi/trunk/poi-integration/src/test/java/org/apache/poi/stress/AbstractFileHandler.java
URL:
http://svn.apache.org/viewvc/poi/trunk/poi-integration/src/test/java/org/apache/poi/stress/AbstractFileHandler.java?rev=1898383&r1=1898382&r2=1898383&view=diff
==============================================================================
---
poi/trunk/poi-integration/src/test/java/org/apache/poi/stress/AbstractFileHandler.java
(original)
+++
poi/trunk/poi-integration/src/test/java/org/apache/poi/stress/AbstractFileHandler.java
Thu Feb 24 18:12:25 2022
@@ -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 ...
Modified:
poi/trunk/poi-integration/src/test/java/org/apache/poi/stress/FileHandlerKnown.java
URL:
http://svn.apache.org/viewvc/poi/trunk/poi-integration/src/test/java/org/apache/poi/stress/FileHandlerKnown.java?rev=1898383&r1=1898382&r2=1898383&view=diff
==============================================================================
---
poi/trunk/poi-integration/src/test/java/org/apache/poi/stress/FileHandlerKnown.java
(original)
+++
poi/trunk/poi-integration/src/test/java/org/apache/poi/stress/FileHandlerKnown.java
Thu Feb 24 18:12:25 2022
@@ -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();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]