Remove old XSSFWorkbook wb.xssfSheetIterator method

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800248 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2017-06-29 08:15:50 +00:00
parent 4bcc0f4eb1
commit 657784ce1a
4 changed files with 1 additions and 80 deletions

View File

@ -1238,74 +1238,6 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook {
}
}
/**
* xssfSheetIterator was added to make transitioning to the new Iterator<Sheet> iterator()
* interface less painful for projects currently using POI.
*
* If your code was written using a for-each loop:
* <pre><code>
* for (XSSFSheet sh : wb) {
* sh.createRow(0);
* }
* </code></pre>
*
* There are two ways to upgrade your code:
* // Option A:
* <pre><code>
* for (XSSFSheet sh : (Iterable<XSSFSheet>) (Iterable<? extends Sheet>) wb) {
* sh.createRow(0);
* }
* </code></pre>
*
* // Option B (preferred for new code):
* <pre><code>
* for (Sheet sh : wb) {
* sh.createRow(0);
* }
* </code></pre>
*
*
*
* If your code was written using an iterator variable:
* <pre><code>
* Iterator<XSSFSheet> it = wb.iterator();
* XSSFSheet sh = it.next();
* sh.createRow(0);
* </code></pre>
*
* There are three ways to upgrade your code:
* // Option A:
* <pre><code>
* Iterator<XSSFSheet> it = (Iterator<XSSFSheet>) (Iterator<? extends Sheet>) wb.iterator();
* XSSFSheet sh = it.next();
* sh.createRow(0);
* </code></pre>
*
* // Option B:
* <pre><code>
* &#64;SuppressWarnings("deprecation")
* Iterator<XSSFSheet> it = wb.xssfSheetIterator();
* XSSFSheet sh = it.next();
* sh.createRow(0);
* </code></pre>
*
* // Option C (preferred for new code):
* <pre><code>
* Iterator<Sheet> it = wb.iterator();
* Sheet sh = it.next();
* sh.createRow(0);
* </code></pre>
*
* @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<XSSFSheet> xssfSheetIterator() {
return new SheetIterator<XSSFSheet>();
}
/**
* Are we a normal workbook (.xlsx), or a
* macro enabled workbook (.xlsm)?

View File

@ -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<XSSFSheet> it = wb.xssfSheetIterator();
XSSFSheet sh = it.next();
sh.createRow(0);
}
// Option C (preferred for new code):
// Option B (preferred for new code):
{
Iterator<Sheet> it = wb.iterator();
Sheet sh = it.next();

View File

@ -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;

View File

@ -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;
/**