From 8347bb64ac06f8aeb7711d106e663a5a2587cc0d Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Fri, 1 Jan 2021 15:51:30 +0000 Subject: Apply some IDE suggestions and fix some JavaDoc git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885012 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/ss/formula/BaseFormulaEvaluator.java | 24 +++++++++++++--------- src/java/org/apache/poi/ss/util/SheetUtil.java | 1 - 2 files changed, 14 insertions(+), 11 deletions(-) (limited to 'src/java') diff --git a/src/java/org/apache/poi/ss/formula/BaseFormulaEvaluator.java b/src/java/org/apache/poi/ss/formula/BaseFormulaEvaluator.java index f9ec1e839d..fa9989c02b 100644 --- a/src/java/org/apache/poi/ss/formula/BaseFormulaEvaluator.java +++ b/src/java/org/apache/poi/ss/formula/BaseFormulaEvaluator.java @@ -70,7 +70,7 @@ public abstract class BaseFormulaEvaluator implements FormulaEvaluator, Workbook protected EvaluationWorkbook getEvaluationWorkbook() { return _bookEvaluator.getWorkbook(); } - + /** * Should be called whenever there are major changes (e.g. moving sheets) to input cells * in the evaluated workbook. If performance is not critical, a single call to this method @@ -117,7 +117,7 @@ public abstract class BaseFormulaEvaluator implements FormulaEvaluator, Workbook throw new IllegalStateException("Bad cell type (" + cell.getCellType() + ")"); } } - + /** * If cell contains formula, it evaluates the formula, and * puts the formula result back into the cell, in place @@ -188,9 +188,11 @@ public abstract class BaseFormulaEvaluator implements FormulaEvaluator, Workbook } /** - * set the cell type - * @param cell - * @param cv + * Set the cell type based on the computed cell type as + * part of a formula evaluation. + * + * @param cell The Cell to populate + * @param cv The CellValue to read the result type from */ protected void setCellType(Cell cell, CellValue cv) { CellType cellType = cv.getCellType(); @@ -214,15 +216,17 @@ public abstract class BaseFormulaEvaluator implements FormulaEvaluator, Workbook /** * Override if a different variation is needed, e.g. passing the evaluator to the cell method - * @param cell - * @param cellType + * + * @param cell The Cell to populate + * @param cellType The wanted type for this Cell */ protected void setCellType(Cell cell, CellType cellType) { + //noinspection deprecation cell.setCellType(cellType); } - + protected abstract RichTextString createRichTextString(String str); - + protected void setCellValue(Cell cell, CellValue cv) { CellType cellType = cv.getCellType(); switch (cellType) { @@ -246,7 +250,7 @@ public abstract class BaseFormulaEvaluator implements FormulaEvaluator, Workbook throw new IllegalStateException("Unexpected cell value type (" + cellType + ")"); } } - + /** * Loops over all cells in all sheets of the supplied diff --git a/src/java/org/apache/poi/ss/util/SheetUtil.java b/src/java/org/apache/poi/ss/util/SheetUtil.java index d26e2c2a26..06d3aa1f70 100644 --- a/src/java/org/apache/poi/ss/util/SheetUtil.java +++ b/src/java/org/apache/poi/ss/util/SheetUtil.java @@ -39,7 +39,6 @@ import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.util.Internal; -import org.apache.poi.util.Removal; /** -- cgit v1.2.3