From b2e807c0050f3f81db7786d6bf4e3102fdfa9dfe Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Thu, 19 Jan 2017 08:51:04 +0000 Subject: [PATCH] bug 60601: allow SXSSFITestDataProvider.writeOutAndReadBack(Workbook wb) to work on SXSSFWorkbooks and XSSFWorkbooks git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1779433 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/xssf/SXSSFITestDataProvider.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ooxml/testcases/org/apache/poi/xssf/SXSSFITestDataProvider.java b/src/ooxml/testcases/org/apache/poi/xssf/SXSSFITestDataProvider.java index 4f2eb40f9..ab84979d0 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/SXSSFITestDataProvider.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/SXSSFITestDataProvider.java @@ -64,7 +64,10 @@ public final class SXSSFITestDataProvider implements ITestDataProvider { */ @Override public XSSFWorkbook writeOutAndReadBack(Workbook wb) { - if(!(wb instanceof SXSSFWorkbook)) { + // wb is usually an SXSSFWorkbook, but must also work on an XSSFWorkbook + // since workbooks must be able to be written out and read back + // several times in succession + if(!(wb instanceof SXSSFWorkbook || wb instanceof XSSFWorkbook)) { throw new IllegalArgumentException("Expected an instance of SXSSFWorkbook"); }