Browse Source

remove some deprecated methods from Cell

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1879266 13f79535-47bb-0310-9956-ffa450edef68
tags/before_ooxml_3rd_edition
PJ Fanning 3 years ago
parent
commit
19c97f3285

+ 1
- 16
src/java/org/apache/poi/hssf/usermodel/HSSFCell.java View File

@@ -652,6 +652,7 @@ public class HSSFCell extends CellBase {
+ " " + (isFormulaCell ? "formula " : "") + "cell";
return new IllegalStateException(msg);
}

private static void checkFormulaCachedValueType(CellType expectedTypeCode, FormulaRecord fr) {
CellType cachedValueType = fr.getCachedResultTypeEnum();
if (cachedValueType != expectedTypeCode) {
@@ -1178,22 +1179,6 @@ public class HSSFCell extends CellBase {
return ((FormulaRecordAggregate)_record).getFormulaRecord().getCachedResultTypeEnum();
}

/**
* Only valid for formula cells
* @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
* {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
* on the cached value of the formula
* @since POI 3.15 beta 3
* @deprecated use <code>getCachedFormulaResultType</code>
* Will be deleted when we make the CellType enum transition. See bug 59791.
*/
@Deprecated
@Removal(version="4.2")
@Override
public CellType getCachedFormulaResultTypeEnum() {
return getCachedFormulaResultType();
}

void setCellArrayFormula(CellRangeAddress range) {
int row = _record.getRow();
short col = _record.getColumn();

+ 0
- 31
src/java/org/apache/poi/ss/usermodel/Cell.java View File

@@ -112,24 +112,6 @@ public interface Cell {
*/
CellType getCellType();

/**
* Return the cell type. Tables in an array formula return
* {@link CellType#FORMULA} for all cells, even though the formula is only defined
* in the OOXML file for the top left cell of the array.
* <p>
* NOTE: POI does not support data table formulas.
* Cells in a data table appear to POI as plain cells typed from their cached value.
*
* @return the cell type
* @since POI 3.15 beta 3
* @deprecated will be removed in 4.2
* Use <code>getCellType()</code>
* Was renamed to <code>getCellType()</code> when we made the CellType enum transition in POI 4.0. See bug 59791.
*/
@Deprecated
@Removal(version="4.2")
CellType getCellTypeEnum();

/**
* Only valid for formula cells
*
@@ -139,19 +121,6 @@ public interface Cell {
*/
CellType getCachedFormulaResultType();

/**
* Only valid for formula cells
* @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
* {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
* on the cached value of the formula
* @since POI 3.15 beta 3
* @deprecated will be removed in 4.2
* Will be renamed to <code>getCachedFormulaResultType()</code> when we make the CellType enum transition in POI 4.0. See bug 59791.
*/
@Deprecated
@Removal(version = "4.2")
CellType getCachedFormulaResultTypeEnum();

/**
* Set a numeric value for the cell.
*

+ 0
- 10
src/java/org/apache/poi/ss/usermodel/CellBase.java View File

@@ -126,16 +126,6 @@ public abstract class CellBase implements Cell {
setCellFormulaImpl(formula);
}

/**
* {@inheritDoc}
*/
@Deprecated
@Removal(version = "4.2")
@Override
public final CellType getCellTypeEnum() {
return getCellType();
}

/**
* Implementation-specific setting the formula. Formula is not null.
* Shall not change the value.

+ 0
- 15
src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFCell.java View File

@@ -149,21 +149,6 @@ public class SXSSFCell extends CellBase {
return ((FormulaValue)_value).getFormulaType();
}

/**
* Only valid for formula cells
* @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
* {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
* on the cached value of the formula
* @since POI 3.15 beta 3
* @deprecated use <code>getCachedFormulaResultType</code> instead
*/
@Deprecated
@Removal(version = "4.2")
@Override
public CellType getCachedFormulaResultTypeEnum() {
return getCachedFormulaResultType();
}

/**
* {@inheritDoc}
*/

+ 0
- 16
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java View File

@@ -697,22 +697,6 @@ public final class XSSFCell extends CellBase {

return getBaseCellType(false);
}
/**
* Only valid for formula cells
* @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
* {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
* on the cached value of the formula
* @since POI 3.15 beta 3
* @deprecated use <code>getCachedFormulaResultType</code> instead
* Will be deleted when we make the CellType enum transition. See bug 59791.
*/
@Deprecated
@Removal(version = "4.2")
@Override
public CellType getCachedFormulaResultTypeEnum() {
return getCachedFormulaResultType();
}

/**
* Detect cell type based on the "t" attribute of the CTCell bean

+ 0
- 17
src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFCell.java View File

@@ -95,23 +95,6 @@ public class TestSXSSFCell extends BaseTestXCell {
}
}

@Test
public void getCellTypeEnumDelegatesToGetCellType() {
SXSSFCell instance = spy(new SXSSFCell(null, CellType.BLANK));
CellType result = instance.getCellType();
verify(instance).getCellType();
assertEquals(CellType.BLANK, result);
}

@Test
public void getCachedFormulaResultTypeEnum_delegatesTo_getCachedFormulaResultType() {
SXSSFCell instance = spy(new SXSSFCell(null, CellType.BLANK));
instance.setCellFormula("");
//noinspection deprecation
instance.getCachedFormulaResultTypeEnum();
verify(instance).getCachedFormulaResultType();
}

@Test(expected = IllegalStateException.class)
public void getCachedFormulaResultType_throwsISE_whenNotAFormulaCell() {
SXSSFCell instance = new SXSSFCell(null, CellType.BLANK);

Loading…
Cancel
Save