aboutsummaryrefslogtreecommitdiffstats
path: root/poi-excelant/src
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2021-11-14 10:18:40 +0000
committerPJ Fanning <fanningpj@apache.org>2021-11-14 10:18:40 +0000
commit8365ee1611c87346277854f3333d3c5f3668e7b9 (patch)
tree68e624e50f3bed91e6622207708452ae8de96a80 /poi-excelant/src
parent20c0ac1637acb8069b656452ff39eb0dbf9baef1 (diff)
downloadpoi-8365ee1611c87346277854f3333d3c5f3668e7b9.tar.gz
poi-8365ee1611c87346277854f3333d3c5f3668e7b9.zip
[github-278] Resolve all SpotBugs P1 issues in Main and Test. Thanks to Andreas Reichel. This closes #278
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895016 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-excelant/src')
-rw-r--r--poi-excelant/src/test/java/org/apache/poi/ss/excelant/MockExcelAntWorkbookHandler.java11
-rw-r--r--poi-excelant/src/test/java/org/apache/poi/ss/excelant/TestBuildFile.java4
2 files changed, 8 insertions, 7 deletions
diff --git a/poi-excelant/src/test/java/org/apache/poi/ss/excelant/MockExcelAntWorkbookHandler.java b/poi-excelant/src/test/java/org/apache/poi/ss/excelant/MockExcelAntWorkbookHandler.java
index d6a3a74b7d..a75506f97b 100644
--- a/poi-excelant/src/test/java/org/apache/poi/ss/excelant/MockExcelAntWorkbookHandler.java
+++ b/poi-excelant/src/test/java/org/apache/poi/ss/excelant/MockExcelAntWorkbookHandler.java
@@ -22,18 +22,19 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.apache.poi.ss.usermodel.Workbook;
public class MockExcelAntWorkbookHandler implements IExcelAntWorkbookHandler {
- public static boolean executed;
- public static Workbook workbook;
+ public boolean executed = false;
+ public Workbook workbook = null;
+ public final static MockExcelAntWorkbookHandler instance = new MockExcelAntWorkbookHandler();
@Override
public void setWorkbook(Workbook workbook) {
- MockExcelAntWorkbookHandler.workbook = workbook;
+ instance.workbook = workbook;
}
@Override
public void execute() {
- executed = true;
- assertNotNull(workbook);
+ instance.executed = true;
+ assertNotNull(instance.workbook);
}
}
diff --git a/poi-excelant/src/test/java/org/apache/poi/ss/excelant/TestBuildFile.java b/poi-excelant/src/test/java/org/apache/poi/ss/excelant/TestBuildFile.java
index b8f34fa30c..9e580bd48e 100644
--- a/poi-excelant/src/test/java/org/apache/poi/ss/excelant/TestBuildFile.java
+++ b/poi-excelant/src/test/java/org/apache/poi/ss/excelant/TestBuildFile.java
@@ -312,8 +312,8 @@ public class TestBuildFile {
assertLogContaining("Using input file: " + TestBuildFile.getDataDir() + "/spreadsheet/excelant.xls");
assertLogContaining("Succeeded when evaluating 'MortgageCalculator'!$B$4.");
- assertNotNull(MockExcelAntWorkbookHandler.workbook, "The workbook should have been passed to the handler");
- assertTrue(MockExcelAntWorkbookHandler.executed, "The handler should have been executed");
+ assertNotNull(MockExcelAntWorkbookHandler.instance.workbook, "The workbook should have been passed to the handler");
+ assertTrue(MockExcelAntWorkbookHandler.instance.executed, "The handler should have been executed");
}
@Test