aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi/hssf/usermodel
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/poi/hssf/usermodel')
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFCell.java27
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFEvaluationCell.java15
2 files changed, 22 insertions, 20 deletions
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java b/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
index 4d711f0415..b18320c61b 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
@@ -55,6 +55,7 @@ import org.apache.poi.ss.util.CellReference;
import org.apache.poi.ss.util.NumberToTextConverter;
import org.apache.poi.util.Internal;
import org.apache.poi.util.LocaleUtil;
+import org.apache.poi.util.Removal;
/**
* High level representation of a cell in a row of a spreadsheet.
@@ -1145,18 +1146,21 @@ public class HSSFCell implements Cell {
/**
* Only valid for formula cells
- *
- * Will return {@link CellType} in a future version of POI.
- * For forwards compatibility, do not hard-code cell type literals in your code.
- *
* @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
* {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
* on the cached value of the formula
- * @deprecated 3.15. Will return a {@link CellType} enum in the future.
+ *
+ * @since POI 4.0
+ * @return <code>CellType</code> depending
+ * on the cached value of the formula
*/
@Override
- public int getCachedFormulaResultType() {
- return getCachedFormulaResultTypeEnum().getCode();
+ public CellType getCachedFormulaResultType() {
+ if (_cellType != CellType.FORMULA) {
+ throw new IllegalStateException("Only formula cells have cached results");
+ }
+ int code = ((FormulaRecordAggregate)_record).getFormulaRecord().getCachedResultType();
+ return CellType.forInt(code);
}
/**
@@ -1165,15 +1169,14 @@ public class HSSFCell implements Cell {
* {@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() {
- if (_cellType != CellType.FORMULA) {
- throw new IllegalStateException("Only formula cells have cached results");
- }
- int code = ((FormulaRecordAggregate)_record).getFormulaRecord().getCachedResultType();
- return CellType.forInt(code);
+ return getCachedFormulaResultType();
}
void setCellArrayFormula(CellRangeAddress range) {
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFEvaluationCell.java b/src/java/org/apache/poi/hssf/usermodel/HSSFEvaluationCell.java
index 368b8abdc1..0cb4950300 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFEvaluationCell.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFEvaluationCell.java
@@ -21,6 +21,7 @@ import org.apache.poi.ss.formula.EvaluationCell;
import org.apache.poi.ss.formula.EvaluationSheet;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.util.Removal;
/**
* HSSF wrapper for a cell under evaluation
@@ -107,23 +108,21 @@ final class HSSFEvaluationCell implements EvaluationCell {
}
/**
- * Will return {@link CellType} in a future version of POI.
- * For forwards compatibility, do not hard-code cell type literals in your code.
- *
+ * @since POI 4.0
* @return cell type of cached formula result
- * @deprecated 3.15. Will return a {@link CellType} enum in the future.
*/
@Override
- public int getCachedFormulaResultType() {
- return _cell.getCachedFormulaResultType();
- }
+ public CellType getCachedFormulaResultType() { return _cell.getCachedFormulaResultType(); }
+
/**
* @since POI 3.15 beta 3
* @deprecated POI 3.15 beta 3.
* Will be deleted when we make the CellType enum transition. See bug 59791.
*/
+ @Deprecated
+ @Removal(version = "4.2")
@Override
public CellType getCachedFormulaResultTypeEnum() {
- return _cell.getCachedFormulaResultTypeEnum();
+ return getCachedFormulaResultType();
}
}