diff --git a/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java b/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java
index 5c6fa9fa44..c64508a7be 100644
--- a/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java
+++ b/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java
@@ -179,7 +179,7 @@ public class ExcelComparator {
private void compareDataInCell(Locator loc1, Locator loc2) {
if (isCellTypeMatches(loc1, loc2)) {
- final CellType loc1cellType = loc1.cell.getCellTypeEnum();
+ final CellType loc1cellType = loc1.cell.getCellType();
switch(loc1cellType) {
case BLANK:
case STRING:
@@ -579,8 +579,8 @@ public class ExcelComparator {
* Checks if cell type matches.
*/
private boolean isCellTypeMatches(Locator loc1, Locator loc2) {
- CellType type1 = loc1.cell.getCellTypeEnum();
- CellType type2 = loc2.cell.getCellTypeEnum();
+ CellType type1 = loc1.cell.getCellType();
+ CellType type2 = loc2.cell.getCellType();
if (type1 == type2) return true;
addMessage(loc1, loc2,
"Cell Data-Type does not Match in :: ",
diff --git a/src/java/org/apache/poi/common/usermodel/Hyperlink.java b/src/java/org/apache/poi/common/usermodel/Hyperlink.java
index 648227b152..edb57bc645 100644
--- a/src/java/org/apache/poi/common/usermodel/Hyperlink.java
+++ b/src/java/org/apache/poi/common/usermodel/Hyperlink.java
@@ -56,16 +56,17 @@ public interface Hyperlink {
*
* @return the type of this hyperlink
* @see HyperlinkType#forInt(int)
- * @deprecated POI 3.15 beta 3. Use {@link #getTypeEnum()}
- * getType will return a HyperlinkType enum in the future.
*/
- public int getType();
+ public HyperlinkType getType();
/**
* Return the type of this hyperlink
*
* @return the type of this hyperlink
* @since POI 3.15 beta 3
+ * @deprecated use getType()
instead
*/
+ @Deprecated
+ @Removal(version = "4.2")
public HyperlinkType getTypeEnum();
}
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFHyperlink.java b/src/java/org/apache/poi/hssf/usermodel/HSSFHyperlink.java
index 137a681914..4b947959e6 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFHyperlink.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFHyperlink.java
@@ -20,6 +20,7 @@ import org.apache.poi.common.usermodel.HyperlinkType;
import org.apache.poi.hssf.record.HyperlinkRecord;
import org.apache.poi.ss.usermodel.Hyperlink;
import org.apache.poi.util.Internal;
+import org.apache.poi.util.Removal;
/**
* Represents an Excel hyperlink.
@@ -258,22 +259,23 @@ public class HSSFHyperlink implements Hyperlink {
*
* @return the type of this hyperlink
* @see HyperlinkType#forInt
- * @deprecated POI 3.15. Use {@link #getTypeEnum()} instead.
- * getType will return a HyperlinkType enum in the future.
*/
@Override
- public int getType() {
- return link_type.getCode();
+ public HyperlinkType getType() {
+ return link_type;
}
/**
* Return the type of this hyperlink
*
* @return the type of this hyperlink
+ * @deprecated use getType()
instead
*/
+ @Deprecated
+ @Removal(version = "4.2")
@Override
public HyperlinkType getTypeEnum() {
- return link_type;
+ return getType();
}
/**
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFOptimiser.java b/src/java/org/apache/poi/hssf/usermodel/HSSFOptimiser.java
index be1f3044f2..c38fd375b2 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFOptimiser.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFOptimiser.java
@@ -142,7 +142,7 @@ public class HSSFOptimiser {
HSSFSheet s = workbook.getSheetAt(sheetNum);
for (Row row : s) {
for (Cell cell : row) {
- if(cell.getCellTypeEnum() == CellType.STRING) {
+ if(cell.getCellType() == CellType.STRING) {
HSSFRichTextString rtr = (HSSFRichTextString)cell.getRichStringCellValue();
UnicodeString u = rtr.getRawUnicodeString();
diff --git a/src/java/org/apache/poi/ss/usermodel/Cell.java b/src/java/org/apache/poi/ss/usermodel/Cell.java
index d77efed56f..13ddfd6518 100644
--- a/src/java/org/apache/poi/ss/usermodel/Cell.java
+++ b/src/java/org/apache/poi/ss/usermodel/Cell.java
@@ -208,7 +208,7 @@ public interface Cell {
* Return a formula for the cell, for example, SUM(C4:E4)
*
* @return a formula for the cell
- * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} is not {@link CellType#FORMULA}
+ * @throws IllegalStateException if the cell type returned by {@link #getCellType()} is not {@link CellType#FORMULA}
*/
String getCellFormula();
@@ -219,7 +219,7 @@ public interface Cell {
* For formulas or error cells we return the precalculated value;
*
double
.
* @see DataFormatter for turning this number into a string similar to that which Excel would render this number as.
*/
@@ -231,7 +231,7 @@ public interface Cell {
* For strings we throw an exception. For blank cells we return a null.
*
* @return the value of the cell as a date
- * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} is {@link CellType#STRING}
+ * @throws IllegalStateException if the cell type returned by {@link #getCellType()} is {@link CellType#STRING}
* @exception NumberFormatException if the cell value isn't a parsable double
.
* @see DataFormatter for formatting this date into a string similar to how excel does.
*/
@@ -283,7 +283,7 @@ public interface Cell {
* For strings, numbers, and errors, we throw an exception. For blank cells we return a false.
*
* @return the value of the cell as a boolean
- * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()}
+ * @throws IllegalStateException if the cell type returned by {@link #getCellType()}
* is not {@link CellType#BOOLEAN}, {@link CellType#BLANK} or {@link CellType#FORMULA}
*/
boolean getBooleanCellValue();
@@ -296,7 +296,7 @@ public interface Cell {
*
*
* @return the value of the cell as an error code
- * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} isn't {@link CellType#ERROR}
+ * @throws IllegalStateException if the cell type returned by {@link #getCellType()} isn't {@link CellType#ERROR}
* @see FormulaError for error codes
*/
byte getErrorCellValue();
diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFHyperlink.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFHyperlink.java
index c0e029fed7..d5d0d4c6cb 100644
--- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFHyperlink.java
+++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFHyperlink.java
@@ -26,6 +26,7 @@ import org.apache.poi.openxml4j.opc.TargetMode;
import org.apache.poi.sl.usermodel.Hyperlink;
import org.apache.poi.sl.usermodel.Slide;
import org.apache.poi.util.Internal;
+import org.apache.poi.util.Removal;
import org.openxmlformats.schemas.drawingml.x2006.main.CTHyperlink;
public class XSLFHyperlink implements HyperlinkSUM(C4:E4)
*
* @return a formula for the cell
- * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} is not CellType.FORMULA
+ * @throws IllegalStateException if the cell type returned by {@link #getCellType()} is not CellType.FORMULA
*/
@Override
public String getCellFormula()
@@ -360,14 +360,14 @@ public class SXSSFCell implements Cell {
* For formulas or error cells we return the precalculated value;
*
* @return the value of the cell as a number
- * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} is CellType.STRING
+ * @throws IllegalStateException if the cell type returned by {@link #getCellType()} is CellType.STRING
* @exception NumberFormatException if the cell value isn't a parsable double
.
* @see org.apache.poi.ss.usermodel.DataFormatter for turning this number into a string similar to that which Excel would render this number as.
*/
@Override
public double getNumericCellValue()
{
- CellType cellType = getCellTypeEnum();
+ CellType cellType = getCellType();
switch(cellType)
{
case BLANK:
@@ -399,7 +399,7 @@ public class SXSSFCell implements Cell {
@Override
public Date getDateCellValue()
{
- CellType cellType = getCellTypeEnum();
+ CellType cellType = getCellType();
if (cellType == CellType.BLANK)
{
return null;
@@ -421,8 +421,8 @@ public class SXSSFCell implements Cell {
@Override
public RichTextString getRichStringCellValue()
{
- CellType cellType = getCellTypeEnum();
- if(getCellTypeEnum() != CellType.STRING)
+ CellType cellType = getCellType();
+ if(getCellType() != CellType.STRING)
throw typeMismatch(CellType.STRING, cellType, false);
StringValue sval = (StringValue)_value;
@@ -446,7 +446,7 @@ public class SXSSFCell implements Cell {
@Override
public String getStringCellValue()
{
- CellType cellType = getCellTypeEnum();
+ CellType cellType = getCellType();
switch(cellType)
{
case BLANK:
@@ -518,7 +518,7 @@ public class SXSSFCell implements Cell {
@Override
public boolean getBooleanCellValue()
{
- CellType cellType = getCellTypeEnum();
+ CellType cellType = getCellType();
switch(cellType)
{
case BLANK:
@@ -553,7 +553,7 @@ public class SXSSFCell implements Cell {
@Override
public byte getErrorCellValue()
{
- CellType cellType = getCellTypeEnum();
+ CellType cellType = getCellType();
switch(cellType)
{
case BLANK:
@@ -746,7 +746,7 @@ public class SXSSFCell implements Cell {
case STRING:
return getRichStringCellValue().toString();
default:
- return "Unknown Cell Type: " + getCellTypeEnum();
+ return "Unknown Cell Type: " + getCellType();
}
}
@@ -979,7 +979,7 @@ public class SXSSFCell implements Cell {
}
private boolean convertCellValueToBoolean() {
- CellType cellType = getCellTypeEnum();
+ CellType cellType = getCellType();
if (cellType == CellType.FORMULA) {
cellType = getCachedFormulaResultType();
@@ -1002,7 +1002,7 @@ public class SXSSFCell implements Cell {
}
private String convertCellValueToString() {
- CellType cellType = getCellTypeEnum();
+ CellType cellType = getCellType();
return convertCellValueToString(cellType);
}
private String convertCellValueToString(CellType cellType) {
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFHyperlink.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFHyperlink.java
index 1065fc60c7..be7f6c397c 100644
--- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFHyperlink.java
+++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFHyperlink.java
@@ -25,6 +25,7 @@ import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.ss.usermodel.Hyperlink;
import org.apache.poi.ss.util.CellReference;
import org.apache.poi.util.Internal;
+import org.apache.poi.util.Removal;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTHyperlink;
/**
@@ -108,13 +109,13 @@ public class XSSFHyperlink implements Hyperlink {
public XSSFHyperlink(Hyperlink other) {
if (other instanceof XSSFHyperlink) {
XSSFHyperlink xlink = (XSSFHyperlink) other;
- _type = xlink.getTypeEnum();
+ _type = xlink.getType();
_location = xlink._location;
_externalRel = xlink._externalRel;
_ctHyperlink = (CTHyperlink) xlink._ctHyperlink.copy();
}
else {
- _type = other.getTypeEnum();
+ _type = other.getType();
_location = other.getAddress();
_externalRel = null;
_ctHyperlink = CTHyperlink.Factory.newInstance();
@@ -156,22 +157,23 @@ public class XSSFHyperlink implements Hyperlink {
*
* @return the type of this hyperlink
* @see HyperlinkType#forInt
- * @deprecated POI 3.15 beta 3. Use {@link #getTypeEnum()} instead.
- * getType will return a HyperlinkType enum in the future.
*/
@Override
- public int getType() {
- return _type.getCode();
+ public HyperlinkType getType() {
+ return _type;
}
/**
* Return the type of this hyperlink
*
* @return the type of this hyperlink
+ * @deprecated use getType
instead
*/
+ @Deprecated
+ @Removal(version = "4.2")
@Override
public HyperlinkType getTypeEnum() {
- return _type;
+ return getType();
}
/**
diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFHyperlink.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFHyperlink.java
index 746c1bb124..4c4152badb 100644
--- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFHyperlink.java
+++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFHyperlink.java
@@ -147,13 +147,13 @@ public class TestXSLFHyperlink {
hl1 = tb1.getTextParagraphs().get(0).getTextRuns().get(0).getHyperlink();
assertNotNull(hl1);
assertEquals("dev@poi.apache.org", hl1.getLabel());
- assertEquals(HyperlinkType.EMAIL, hl1.getTypeEnum());
+ assertEquals(HyperlinkType.EMAIL, hl1.getType());
tb2 = (XSLFTextBox)slides.get(1).getShapes().get(0);
hl2 = tb2.getTextParagraphs().get(0).getTextRuns().get(0).getHyperlink();
assertNotNull(hl2);
assertEquals("lastslide", hl2.getXmlObject().getAction().split("=")[1]);
- assertEquals(HyperlinkType.DOCUMENT, hl2.getTypeEnum());
+ assertEquals(HyperlinkType.DOCUMENT, hl2.getType());
tb3 = (XSLFTextBox)slides.get(2).getShapes().get(0);
XSLFHyperlink hl3 = tb3.getTextParagraphs().get(0).getTextRuns().get(1).getHyperlink();
@@ -161,19 +161,19 @@ public class TestXSLFHyperlink {
hl3 = tb3.getTextParagraphs().get(0).getTextRuns().get(3).getHyperlink();
assertNotNull(hl3);
assertEquals("/ppt/slides/slide1.xml", hl3.getAddress());
- assertEquals(HyperlinkType.DOCUMENT, hl3.getTypeEnum());
+ assertEquals(HyperlinkType.DOCUMENT, hl3.getType());
tb4 = (XSLFTextBox)slides.get(3).getShapes().get(0);
hl4 = tb4.getTextParagraphs().get(0).getTextRuns().get(0).getHyperlink();
assertNotNull(hl4);
assertEquals("http://poi.apache.org", hl4.getLabel());
- assertEquals(HyperlinkType.URL, hl4.getTypeEnum());
+ assertEquals(HyperlinkType.URL, hl4.getType());
tb5 = (XSLFTextBox)slides.get(4).getShapes().get(0);
hl5 = tb5.getHyperlink();
assertNotNull(hl5);
assertEquals("firstslide", hl5.getXmlObject().getAction().split("=")[1]);
- assertEquals(HyperlinkType.DOCUMENT, hl5.getTypeEnum());
+ assertEquals(HyperlinkType.DOCUMENT, hl5.getType());
ppt2.close();
}
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/model/TestCalculationChain.java b/src/ooxml/testcases/org/apache/poi/xssf/model/TestCalculationChain.java
index d2fd60f3ea..42cf2714a5 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/model/TestCalculationChain.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/model/TestCalculationChain.java
@@ -42,7 +42,7 @@ public final class TestCalculationChain extends TestCase {
XSSFSheet sheet = wb.getSheet("Test");
XSSFCell cell = sheet.getRow(0).getCell(4);
- assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
+ assertEquals(CellType.FORMULA, cell.getCellType());
cell.setCellFormula(null);
//the count of items is less by one
@@ -53,9 +53,9 @@ public final class TestCalculationChain extends TestCase {
assertEquals(10, c.getI());
assertEquals("C1", c.getR());
- assertEquals(CellType.STRING, cell.getCellTypeEnum());
+ assertEquals(CellType.STRING, cell.getCellType());
cell.setCellValue("ABC");
- assertEquals(CellType.STRING, cell.getCellTypeEnum());
+ assertEquals(CellType.STRING, cell.getCellType());
}
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestMatrixFormulasFromXMLSpreadsheet.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestMatrixFormulasFromXMLSpreadsheet.java
index 39e3cb87f6..0f6b1e2a52 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestMatrixFormulasFromXMLSpreadsheet.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestMatrixFormulasFromXMLSpreadsheet.java
@@ -165,7 +165,7 @@ public final class TestMatrixFormulasFromXMLSpreadsheet {
Cell c = sheet.getRow(rowNum).getCell(colNum);
- if (c == null || c.getCellTypeEnum() != CellType.FORMULA) {
+ if (c == null || c.getCellType() != CellType.FORMULA) {
continue;
}
@@ -178,27 +178,27 @@ public final class TestMatrixFormulasFromXMLSpreadsheet {
assertNotNull(msg + " - Bad setup data expected value is null", expValue);
assertNotNull(msg + " - actual value was null", actValue);
- final CellType cellType = expValue.getCellTypeEnum();
+ final CellType cellType = expValue.getCellType();
switch (cellType) {
case BLANK:
- assertEquals(msg, CellType.BLANK, actValue.getCellTypeEnum());
+ assertEquals(msg, CellType.BLANK, actValue.getCellType());
break;
case BOOLEAN:
- assertEquals(msg, CellType.BOOLEAN, actValue.getCellTypeEnum());
+ assertEquals(msg, CellType.BOOLEAN, actValue.getCellType());
assertEquals(msg, expValue.getBooleanCellValue(), actValue.getBooleanValue());
break;
case ERROR:
- assertEquals(msg, CellType.ERROR, actValue.getCellTypeEnum());
+ assertEquals(msg, CellType.ERROR, actValue.getCellType());
assertEquals(msg, ErrorEval.getText(expValue.getErrorCellValue()), ErrorEval.getText(actValue.getErrorValue()));
break;
case FORMULA: // will never be used, since we will call method after formula evaluation
fail("Cannot expect formula as result of formula evaluation: " + msg);
case NUMERIC:
- assertEquals(msg, CellType.NUMERIC, actValue.getCellTypeEnum());
+ assertEquals(msg, CellType.NUMERIC, actValue.getCellType());
TestMathX.assertEquals(msg, expValue.getNumericCellValue(), actValue.getNumberValue(), TestMathX.POS_ZERO, TestMathX.DIFF_TOLERANCE_FACTOR);
break;
case STRING:
- assertEquals(msg, CellType.STRING, actValue.getCellTypeEnum());
+ assertEquals(msg, CellType.STRING, actValue.getCellType());
assertEquals(msg, expValue.getRichStringCellValue().getString(), actValue.getStringValue());
break;
default:
@@ -222,15 +222,15 @@ public final class TestMatrixFormulasFromXMLSpreadsheet {
System.err.println("Warning - Row " + r.getRowNum() + " has no cell " + Navigator.START_OPERATORS_COL_INDEX + ", can't figure out function name");
return null;
}
- if(cell.getCellTypeEnum() == CellType.BLANK) {
+ if(cell.getCellType() == CellType.BLANK) {
return null;
}
- if(cell.getCellTypeEnum() == CellType.STRING) {
+ if(cell.getCellType() == CellType.STRING) {
return cell.getRichStringCellValue().getString();
}
throw new AssertionFailedError("Bad cell type for 'function name' column: ("
- + cell.getCellTypeEnum() + ") row (" + (r.getRowNum() +1) + ")");
+ + cell.getCellType() + ") row (" + (r.getRowNum() +1) + ")");
}
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestMultiSheetFormulaEvaluatorOnXSSF.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestMultiSheetFormulaEvaluatorOnXSSF.java
index bdd85130c8..74648bb7e6 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestMultiSheetFormulaEvaluatorOnXSSF.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestMultiSheetFormulaEvaluatorOnXSSF.java
@@ -176,7 +176,7 @@ public final class TestMultiSheetFormulaEvaluatorOnXSSF {
Cell c = r.getCell(SS.COLUMN_INDEX_ACTUAL_VALUE);
assumeNotNull(c);
- assumeTrue(c.getCellTypeEnum() == CellType.FORMULA);
+ assumeTrue(c.getCellType() == CellType.FORMULA);
CellValue actValue = evaluator.evaluate(c);
@@ -185,17 +185,17 @@ public final class TestMultiSheetFormulaEvaluatorOnXSSF {
assertNotNull(msg + " - actual value was null", actValue);
- final CellType expectedCellType = expValue.getCellTypeEnum();
+ final CellType expectedCellType = expValue.getCellType();
switch (expectedCellType) {
case BLANK:
- assertEquals(msg, CellType.BLANK, actValue.getCellTypeEnum());
+ assertEquals(msg, CellType.BLANK, actValue.getCellType());
break;
case BOOLEAN:
- assertEquals(msg, CellType.BOOLEAN, actValue.getCellTypeEnum());
+ assertEquals(msg, CellType.BOOLEAN, actValue.getCellType());
assertEquals(msg, expValue.getBooleanCellValue(), actValue.getBooleanValue());
break;
case ERROR:
- assertEquals(msg, CellType.ERROR, actValue.getCellTypeEnum());
+ assertEquals(msg, CellType.ERROR, actValue.getCellType());
// if(false) { // TODO: fix ~45 functions which are currently returning incorrect error values
// assertEquals(msg, expected.getErrorCellValue(), actual.getErrorValue());
// }
@@ -203,14 +203,14 @@ public final class TestMultiSheetFormulaEvaluatorOnXSSF {
case FORMULA: // will never be used, since we will call method after formula evaluation
fail("Cannot expect formula as result of formula evaluation: " + msg);
case NUMERIC:
- assertEquals(msg, CellType.NUMERIC, actValue.getCellTypeEnum());
+ assertEquals(msg, CellType.NUMERIC, actValue.getCellType());
TestMathX.assertEquals(msg, expValue.getNumericCellValue(), actValue.getNumberValue(), TestMathX.POS_ZERO, TestMathX.DIFF_TOLERANCE_FACTOR);
// double delta = Math.abs(expected.getNumericCellValue()-actual.getNumberValue());
// double pctExpected = Math.abs(0.00001*expected.getNumericCellValue());
// assertTrue(msg, delta <= pctExpected);
break;
case STRING:
- assertEquals(msg, CellType.STRING, actValue.getCellTypeEnum());
+ assertEquals(msg, CellType.STRING, actValue.getCellType());
assertEquals(msg, expValue.getRichStringCellValue().getString(), actValue.getStringValue());
break;
default:
@@ -231,15 +231,15 @@ public final class TestMultiSheetFormulaEvaluatorOnXSSF {
logger.log(POILogger.WARN, "Warning - Row " + r.getRowNum() + " has no cell " + SS.COLUMN_INDEX_FUNCTION_NAME + ", can't figure out function name");
return null;
}
- if(cell.getCellTypeEnum() == CellType.BLANK) {
+ if(cell.getCellType() == CellType.BLANK) {
return null;
}
- if(cell.getCellTypeEnum() == CellType.STRING) {
+ if(cell.getCellType() == CellType.STRING) {
return cell.getRichStringCellValue().getString();
}
fail("Bad cell type for 'function name' column: ("
- + cell.getCellTypeEnum() + ") row (" + (r.getRowNum() +1) + ")");
+ + cell.getCellType() + ") row (" + (r.getRowNum() +1) + ")");
return "";
}
/**
@@ -255,15 +255,15 @@ public final class TestMultiSheetFormulaEvaluatorOnXSSF {
logger.log(POILogger.WARN, "Warning - Row " + r.getRowNum() + " has no cell " + SS.COLUMN_INDEX_TEST_NAME + ", can't figure out test name");
return null;
}
- if(cell.getCellTypeEnum() == CellType.BLANK) {
+ if(cell.getCellType() == CellType.BLANK) {
return null;
}
- if(cell.getCellTypeEnum() == CellType.STRING) {
+ if(cell.getCellType() == CellType.STRING) {
return cell.getRichStringCellValue().getString();
}
fail("Bad cell type for 'test name' column: ("
- + cell.getCellTypeEnum() + ") row (" + (r.getRowNum() +1) + ")");
+ + cell.getCellType() + ") row (" + (r.getRowNum() +1) + ")");
return "";
}
diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFHyperlink.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFHyperlink.java
index 73d11905fd..2385a00c4e 100644
--- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFHyperlink.java
+++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFHyperlink.java
@@ -33,6 +33,7 @@ import org.apache.poi.hslf.record.Record;
import org.apache.poi.hslf.record.TxInteractiveInfoAtom;
import org.apache.poi.sl.usermodel.Hyperlink;
import org.apache.poi.sl.usermodel.Slide;
+import org.apache.poi.util.Removal;
/**
* Represents a hyperlink in a PowerPoint document
@@ -128,11 +129,26 @@ public final class HSLFHyperlink implements Hyperlinknull
if cell is missing, empty or blank
@@ -324,15 +324,15 @@ public final class TestMultiSheetEval extends TestCase {
System.err.println("Warning - Row " + r.getRowNum() + " has no cell " + SS.COLUMN_INDEX_TEST_NAME + ", can't figure out test name");
return null;
}
- if(cell.getCellTypeEnum() == CellType.BLANK) {
+ if(cell.getCellType() == CellType.BLANK) {
return null;
}
- if(cell.getCellTypeEnum() == CellType.STRING) {
+ if(cell.getCellType() == CellType.STRING) {
return cell.getRichStringCellValue().getString();
}
throw new AssertionFailedError("Bad cell type for 'test name' column: ("
- + cell.getCellTypeEnum() + ") row (" + (r.getRowNum() +1) + ")");
+ + cell.getCellType() + ") row (" + (r.getRowNum() +1) + ")");
}
}
diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java
index 2492c20a81..27ac4c93a8 100644
--- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java
+++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java
@@ -256,36 +256,36 @@ public abstract class BaseTestRow {
row.createCell(5).setCellValue(4);
// First up, no policy given, uses default
- assertEquals(CellType.STRING, row.getCell(0).getCellTypeEnum());
- assertEquals(CellType.NUMERIC, row.getCell(1).getCellTypeEnum());
+ assertEquals(CellType.STRING, row.getCell(0).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(1).getCellType());
assertEquals(null, row.getCell(2));
assertEquals(null, row.getCell(3));
- assertEquals(CellType.BLANK, row.getCell(4).getCellTypeEnum());
- assertEquals(CellType.NUMERIC, row.getCell(5).getCellTypeEnum());
+ assertEquals(CellType.BLANK, row.getCell(4).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(5).getCellType());
// RETURN_NULL_AND_BLANK - same as default
- assertEquals(CellType.STRING, row.getCell(0, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellTypeEnum());
- assertEquals(CellType.NUMERIC, row.getCell(1, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellTypeEnum());
+ assertEquals(CellType.STRING, row.getCell(0, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(1, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
assertEquals(null, row.getCell(2, MissingCellPolicy.RETURN_NULL_AND_BLANK));
assertEquals(null, row.getCell(3, MissingCellPolicy.RETURN_NULL_AND_BLANK));
- assertEquals(CellType.BLANK, row.getCell(4, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellTypeEnum());
- assertEquals(CellType.NUMERIC, row.getCell(5, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellTypeEnum());
+ assertEquals(CellType.BLANK, row.getCell(4, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(5, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
// RETURN_BLANK_AS_NULL - nearly the same
- assertEquals(CellType.STRING, row.getCell(0, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellTypeEnum());
- assertEquals(CellType.NUMERIC, row.getCell(1, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellTypeEnum());
+ assertEquals(CellType.STRING, row.getCell(0, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(1, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellType());
assertEquals(null, row.getCell(2, MissingCellPolicy.RETURN_BLANK_AS_NULL));
assertEquals(null, row.getCell(3, MissingCellPolicy.RETURN_BLANK_AS_NULL));
assertEquals(null, row.getCell(4, MissingCellPolicy.RETURN_BLANK_AS_NULL));
- assertEquals(CellType.NUMERIC, row.getCell(5, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellTypeEnum());
+ assertEquals(CellType.NUMERIC, row.getCell(5, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellType());
// CREATE_NULL_AS_BLANK - creates as needed
- assertEquals(CellType.STRING, row.getCell(0, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellTypeEnum());
- assertEquals(CellType.NUMERIC, row.getCell(1, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellTypeEnum());
- assertEquals(CellType.BLANK, row.getCell(2, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellTypeEnum());
- assertEquals(CellType.BLANK, row.getCell(3, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellTypeEnum());
- assertEquals(CellType.BLANK, row.getCell(4, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellTypeEnum());
- assertEquals(CellType.NUMERIC, row.getCell(5, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellTypeEnum());
+ assertEquals(CellType.STRING, row.getCell(0, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(1, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
+ assertEquals(CellType.BLANK, row.getCell(2, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
+ assertEquals(CellType.BLANK, row.getCell(3, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
+ assertEquals(CellType.BLANK, row.getCell(4, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(5, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
// Check created ones get the right column
assertEquals(0, row.getCell(0, MissingCellPolicy.CREATE_NULL_AS_BLANK).getColumnIndex());
@@ -300,12 +300,12 @@ public abstract class BaseTestRow {
// that that is now used if no policy given
workbook.setMissingCellPolicy(MissingCellPolicy.RETURN_BLANK_AS_NULL);
- assertEquals(CellType.STRING, row.getCell(0).getCellTypeEnum());
- assertEquals(CellType.NUMERIC, row.getCell(1).getCellTypeEnum());
+ assertEquals(CellType.STRING, row.getCell(0).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(1).getCellType());
assertEquals(null, row.getCell(2));
assertEquals(null, row.getCell(3));
assertEquals(null, row.getCell(4));
- assertEquals(CellType.NUMERIC, row.getCell(5).getCellTypeEnum());
+ assertEquals(CellType.NUMERIC, row.getCell(5).getCellType());
workbook.close();
}
@@ -420,7 +420,7 @@ public abstract class BaseTestRow {
assertTrue(cell5 == it.next());
assertTrue(it.hasNext());
assertTrue(cell2 == it.next());
- assertEquals(CellType.STRING, cell5.getCellTypeEnum());
+ assertEquals(CellType.STRING, cell5.getCellType());
wb.close();
}
diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java
index bbc9ab7e73..7d25d634f5 100644
--- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java
+++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java
@@ -133,7 +133,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
for(Cell acell : cells){
assertTrue(acell.isPartOfArrayFormulaGroup());
- assertEquals(CellType.FORMULA, acell.getCellTypeEnum());
+ assertEquals(CellType.FORMULA, acell.getCellType());
assertEquals("SUM(A1:A3*B1:B3)", acell.getCellFormula());
//retrieve the range and check it is the same
assertEquals(range.formatAsString(), acell.getArrayFormulaRange().formatAsString());
@@ -210,7 +210,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
for(Cell acell : cr){
assertFalse(acell.isPartOfArrayFormulaGroup());
- assertEquals(CellType.BLANK, acell.getCellTypeEnum());
+ assertEquals(CellType.BLANK, acell.getCellType());
}
// cells C4:C6 are not included in array formula,
@@ -279,7 +279,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
CellRange extends Cell> srange =
sheet.setArrayFormula("SUM(A4:A6,B4:B6)", CellRangeAddress.valueOf("B5"));
Cell scell = srange.getTopLeftCell();
- assertEquals(CellType.FORMULA, scell.getCellTypeEnum());
+ assertEquals(CellType.FORMULA, scell.getCellType());
assertEquals(0.0, scell.getNumericCellValue(), 0);
scell.setCellValue(1.1);
assertEquals(1.1, scell.getNumericCellValue(), 0);
@@ -288,7 +288,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
CellRange extends Cell> mrange =
sheet.setArrayFormula("A1:A3*B1:B3", CellRangeAddress.valueOf("C1:C3"));
for(Cell mcell : mrange){
- assertEquals(CellType.FORMULA, mcell.getCellTypeEnum());
+ assertEquals(CellType.FORMULA, mcell.getCellType());
assertEquals(0.0, mcell.getNumericCellValue(), 0);
double fmlaResult = 1.2;
mcell.setCellValue(fmlaResult);
@@ -307,10 +307,10 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
CellRange extends Cell> srange =
sheet.setArrayFormula("SUM(A4:A6,B4:B6)", CellRangeAddress.valueOf("B5"));
Cell scell = srange.getTopLeftCell();
- assertEquals(CellType.FORMULA, scell.getCellTypeEnum());
+ assertEquals(CellType.FORMULA, scell.getCellType());
assertEquals(0.0, scell.getNumericCellValue(), 0);
scell.setCellType(CellType.STRING);
- assertEquals(CellType.STRING, scell.getCellTypeEnum());
+ assertEquals(CellType.STRING, scell.getCellType());
scell.setCellValue("string cell");
assertEquals("string cell", scell.getStringCellValue());
@@ -319,7 +319,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
sheet.setArrayFormula("A1:A3*B1:B3", CellRangeAddress.valueOf("C1:C3"));
for(Cell mcell : mrange){
try {
- assertEquals(CellType.FORMULA, mcell.getCellTypeEnum());
+ assertEquals(CellType.FORMULA, mcell.getCellType());
mcell.setCellType(CellType.NUMERIC);
fail("expected exception");
} catch (IllegalStateException e){
@@ -329,7 +329,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
}
// a failed invocation of Cell.setCellType leaves the cell
// in the state that it was in prior to the invocation
- assertEquals(CellType.FORMULA, mcell.getCellTypeEnum());
+ assertEquals(CellType.FORMULA, mcell.getCellType());
assertTrue(mcell.isPartOfArrayFormulaGroup());
}
workbook.close();
@@ -344,13 +344,13 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
sheet.setArrayFormula("SUM(A4:A6,B4:B6)", CellRangeAddress.valueOf("B5"));
Cell scell = srange.getTopLeftCell();
assertEquals("SUM(A4:A6,B4:B6)", scell.getCellFormula());
- assertEquals(CellType.FORMULA, scell.getCellTypeEnum());
+ assertEquals(CellType.FORMULA, scell.getCellType());
assertTrue(scell.isPartOfArrayFormulaGroup());
scell.setCellFormula("SUM(A4,A6)");
//we are now a normal formula cell
assertEquals("SUM(A4,A6)", scell.getCellFormula());
assertFalse(scell.isPartOfArrayFormulaGroup());
- assertEquals(CellType.FORMULA, scell.getCellTypeEnum());
+ assertEquals(CellType.FORMULA, scell.getCellType());
//check that setting formula result works
assertEquals(0.0, scell.getNumericCellValue(), 0);
scell.setCellValue(33.0);
@@ -396,7 +396,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
//re-create the removed cell
scell = srow.createCell(cra.getFirstColumn());
- assertEquals(CellType.BLANK, scell.getCellTypeEnum());
+ assertEquals(CellType.BLANK, scell.getCellType());
assertFalse(scell.isPartOfArrayFormulaGroup());
//we cannot remove cells included in a multi-cell array formula
@@ -417,7 +417,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
// in the state that it was in prior to the invocation
assertSame(mcell, mrow.getCell(columnIndex));
assertTrue(mcell.isPartOfArrayFormulaGroup());
- assertEquals(CellType.FORMULA, mcell.getCellTypeEnum());
+ assertEquals(CellType.FORMULA, mcell.getCellType());
}
workbook.close();
@@ -433,7 +433,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
CellRange extends Cell> srange =
sheet.setArrayFormula("SUM(A4:A6,B4:B6)", cra);
Cell scell = srange.getTopLeftCell();
- assertEquals(CellType.FORMULA, scell.getCellTypeEnum());
+ assertEquals(CellType.FORMULA, scell.getCellType());
Row srow = scell.getRow();
assertSame(srow, sheet.getRow(cra.getFirstRow()));
@@ -442,7 +442,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
//re-create the removed row and cell
scell = sheet.createRow(cra.getFirstRow()).createCell(cra.getFirstColumn());
- assertEquals(CellType.BLANK, scell.getCellTypeEnum());
+ assertEquals(CellType.BLANK, scell.getCellType());
assertFalse(scell.isPartOfArrayFormulaGroup());
//we cannot remove rows with cells included in a multi-cell array formula
@@ -463,7 +463,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
assertSame(mrow, sheet.getRow(mrow.getRowNum()));
assertSame(mcell, mrow.getCell(columnIndex));
assertTrue(mcell.isPartOfArrayFormulaGroup());
- assertEquals(CellType.FORMULA, mcell.getCellTypeEnum());
+ assertEquals(CellType.FORMULA, mcell.getCellType());
}
workbook.close();
@@ -481,7 +481,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
Cell scell = srange.getTopLeftCell();
sheet.addMergedRegion(CellRangeAddress.valueOf("B5:C6"));
//we are still an array formula
- assertEquals(CellType.FORMULA, scell.getCellTypeEnum());
+ assertEquals(CellType.FORMULA, scell.getCellType());
assertTrue(scell.isPartOfArrayFormulaGroup());
assertEquals(1, sheet.getNumMergedRegions());
@@ -570,7 +570,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
assertEquals(cra.formatAsString(), mcell.getArrayFormulaRange().formatAsString());
assertEquals("A2:A4*B2:B4", mcell.getCellFormula());
assertTrue(mcell.isPartOfArrayFormulaGroup());
- assertEquals(CellType.FORMULA, mcell.getCellTypeEnum());
+ assertEquals(CellType.FORMULA, mcell.getCellType());
}
*/
diff --git a/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java b/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java
index fb81622509..b642de340e 100644
--- a/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java
+++ b/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java
@@ -811,7 +811,7 @@ public class TestDataFormatter {
CellReference ref = new CellReference("D47");
Cell cell = wb.getSheetAt(0).getRow(ref.getRow()).getCell(ref.getCol());
- assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
+ assertEquals(CellType.FORMULA, cell.getCellType());
assertEquals("G9:K9 I7:I12", cell.getCellFormula());
DataFormatter formatter = new DataFormatter();
diff --git a/src/testcases/org/apache/poi/ss/util/TestSheetBuilder.java b/src/testcases/org/apache/poi/ss/util/TestSheetBuilder.java
index d081db0fc3..7a668b016d 100644
--- a/src/testcases/org/apache/poi/ss/util/TestSheetBuilder.java
+++ b/src/testcases/org/apache/poi/ss/util/TestSheetBuilder.java
@@ -50,7 +50,7 @@ public final class TestSheetBuilder extends TestCase {
Row firstRow = sheet.getRow(0);
Cell firstCell = firstRow.getCell(0);
- assertEquals(firstCell.getCellTypeEnum(), CellType.NUMERIC);
+ assertEquals(firstCell.getCellType(), CellType.NUMERIC);
assertEquals(1.0, firstCell.getNumericCellValue(), 0.00001);
@@ -59,11 +59,11 @@ public final class TestSheetBuilder extends TestCase {
assertNull(secondRow.getCell(2));
Row thirdRow = sheet.getRow(2);
- assertEquals(CellType.STRING, thirdRow.getCell(0).getCellTypeEnum());
+ assertEquals(CellType.STRING, thirdRow.getCell(0).getCellType());
String cellValue = thirdRow.getCell(0).getStringCellValue();
assertEquals(testData[2][0].toString(), cellValue);
- assertEquals(CellType.FORMULA, thirdRow.getCell(2).getCellTypeEnum());
+ assertEquals(CellType.FORMULA, thirdRow.getCell(2).getCellType());
assertEquals("A1+B2", thirdRow.getCell(2).getCellFormula());
}
@@ -73,7 +73,7 @@ public final class TestSheetBuilder extends TestCase {
Cell emptyCell = sheet.getRow(1).getCell(1);
assertNotNull(emptyCell);
- assertEquals(CellType.BLANK, emptyCell.getCellTypeEnum());
+ assertEquals(CellType.BLANK, emptyCell.getCellType());
}
public void testSheetName() {