aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java2
-rw-r--r--poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFBugs.java5
-rw-r--r--poi/src/test/java/org/apache/poi/hssf/model/TestRVA.java8
-rw-r--r--poi/src/test/java/org/apache/poi/hssf/usermodel/TestMatrixFormulasFromBinarySpreadsheet.java4
-rw-r--r--poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java4
5 files changed, 17 insertions, 6 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java
index 58fa5b0747..729651e868 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java
@@ -39,7 +39,7 @@ public class XWPFPictureData extends POIXMLDocumentPart {
private static int MAX_IMAGE_SIZE = DEFAULT_MAX_IMAGE_SIZE;
/**
- * @param length the max image size allowed for XSSF pictures
+ * @param length the max image size allowed for XWPF pictures
*/
public static void setMaxImageSize(int length) {
MAX_IMAGE_SIZE = length;
diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
index 7b5093d13e..8a2802f1b9 100644
--- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
+++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
@@ -36,6 +36,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
+import java.time.Duration;
import java.time.Instant;
import java.time.LocalDateTime;
import java.util.*;
@@ -3312,7 +3313,9 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
LOG.atInfo().log(between(start, now()));
- assertTrue(between(start, now()).getSeconds() < 25);
+ assertTrue(between(start, now()).getSeconds() < 25,
+ "Had start: " + start + ", now: " + now() +
+ ", diff: " + Duration.between(start, now()).getSeconds());
}
}
diff --git a/poi/src/test/java/org/apache/poi/hssf/model/TestRVA.java b/poi/src/test/java/org/apache/poi/hssf/model/TestRVA.java
index fd94e0be19..97ec3f25dc 100644
--- a/poi/src/test/java/org/apache/poi/hssf/model/TestRVA.java
+++ b/poi/src/test/java/org/apache/poi/hssf/model/TestRVA.java
@@ -53,8 +53,12 @@ final class TestRVA {
@AfterAll
public static void closeResource() throws Exception {
- workbook.close();
- poifs.close();
+ if (workbook != null) {
+ workbook.close();
+ }
+ if (poifs != null) {
+ poifs.close();
+ }
}
public static Stream<Arguments> data() throws Exception {
diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestMatrixFormulasFromBinarySpreadsheet.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestMatrixFormulasFromBinarySpreadsheet.java
index d56c3d6134..081635d85a 100644
--- a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestMatrixFormulasFromBinarySpreadsheet.java
+++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestMatrixFormulasFromBinarySpreadsheet.java
@@ -101,7 +101,9 @@ final class TestMatrixFormulasFromBinarySpreadsheet {
@AfterAll
public static void closeResource() throws Exception {
LocaleUtil.setUserLocale(userLocale);
- workbook.close();
+ if (workbook != null) {
+ workbook.close();
+ }
}
/* generating parameter instances */
diff --git a/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java b/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java
index 98e10c0edc..fa5052458b 100644
--- a/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java
+++ b/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java
@@ -100,7 +100,9 @@ public final class TestFormulasFromSpreadsheet {
@AfterAll
public static void closeResource() throws Exception {
LocaleUtil.setUserLocale(userLocale);
- workbook.close();
+ if (workbook != null) {
+ workbook.close();
+ }
}
public static Stream<Arguments> data() {