From 586b303d74d1e7137e81aa51f7529ce167bd1ce2 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Thu, 29 Jun 2017 08:15:50 +0000 Subject: [PATCH] Remove old XSSFWorkbook wb.xssfSheetIterator method git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800248 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/xssf/usermodel/XSSFWorkbook.java | 68 ------------------- .../poi/xssf/usermodel/TestXSSFWorkbook.java | 11 +-- .../hssf/converter/AbstractExcelUtils.java | 1 - .../ss/usermodel/BaseTestSheetShiftRows.java | 1 - 4 files changed, 1 insertion(+), 80 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java index fe6bba6ea0..dcfeb5a616 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java @@ -1238,74 +1238,6 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook { } } - /** - * xssfSheetIterator was added to make transitioning to the new Iterator iterator() - * interface less painful for projects currently using POI. - * - * If your code was written using a for-each loop: - *

-     *  for (XSSFSheet sh : wb) {
-     *      sh.createRow(0);
-     *  }
-     *  
- * - * There are two ways to upgrade your code: - * // Option A: - *

-     *  for (XSSFSheet sh : (Iterable) (Iterable) wb) {
-     *      sh.createRow(0);
-     *  }
-     *  
- * - * // Option B (preferred for new code): - *

-     *  for (Sheet sh : wb) {
-     *      sh.createRow(0);
-     *  }
-     *  
- * - * - * - * If your code was written using an iterator variable: - *

-     *  Iterator it = wb.iterator();
-     *  XSSFSheet sh = it.next();
-     *  sh.createRow(0);
-     *  
- * - * There are three ways to upgrade your code: - * // Option A: - *

-     *  Iterator it = (Iterator) (Iterator) wb.iterator();
-     *  XSSFSheet sh = it.next();
-     *  sh.createRow(0);
-     *  
- * - * // Option B: - *

-     *  @SuppressWarnings("deprecation")
-     *  Iterator it = wb.xssfSheetIterator();
-     *  XSSFSheet sh = it.next();
-     *  sh.createRow(0);
-     *  
- * - * // Option C (preferred for new code): - *

-     *  Iterator it = wb.iterator();
-     *  Sheet sh = it.next();
-     *  sh.createRow(0);
-     *  
- * - * @deprecated 3.13. New projects should use the preferred options. Note: XSSFWorkbook.xssfSheetIterator - * is deprecated and will be removed in 3.15. - * - * @return an iterator of the sheets. - */ - @Deprecated - public Iterator xssfSheetIterator() { - return new SheetIterator(); - } - /** * Are we a normal workbook (.xlsx), or a * macro enabled workbook (.xlsm)? diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java index 8b0c335330..365ca6a6f2 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java @@ -52,7 +52,6 @@ import org.apache.poi.openxml4j.opc.PackagingURIHelper; import org.apache.poi.openxml4j.opc.internal.FileHelper; import org.apache.poi.openxml4j.opc.internal.MemoryPackagePart; import org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart; -import org.apache.poi.ss.SpreadsheetVersion; import org.apache.poi.ss.usermodel.BaseTestXWorkbook; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; @@ -999,15 +998,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook { sh.createRow(0); } - // Option B: - { - @SuppressWarnings("deprecation") - Iterator it = wb.xssfSheetIterator(); - XSSFSheet sh = it.next(); - sh.createRow(0); - } - - // Option C (preferred for new code): + // Option B (preferred for new code): { Iterator it = wb.iterator(); Sheet sh = it.next(); diff --git a/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelUtils.java b/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelUtils.java index e9bd91b534..08b4796456 100644 --- a/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelUtils.java +++ b/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelUtils.java @@ -20,7 +20,6 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.util.HSSFColor; diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java index 556e89b43a..cf910d4620 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java @@ -36,7 +36,6 @@ import org.apache.poi.ss.ITestDataProvider; import org.apache.poi.ss.util.CellAddress; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellReference; -import org.junit.Ignore; import org.junit.Test; /**