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
This commit is contained in:
Dominik Stadler 2021-01-01 15:51:30 +00:00
parent 685af351d1
commit 8347bb64ac
7 changed files with 38 additions and 38 deletions

View File

@ -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,10 +216,12 @@ 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);
}

View File

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

View File

@ -193,7 +193,7 @@ public abstract class POIXMLDocument extends POIXMLDocumentPart implements Close
}
/**
* Write out this document to an Outputstream.
* Write out this document to an {@link OutputStream}.
*
* Note - if the Document was opened from a {@link File} rather
* than an {@link InputStream}, you <b>must</b> write out to

View File

@ -57,7 +57,7 @@ public class POIXMLDocumentPart {
private String coreDocumentRel = PackageRelationshipTypes.CORE_DOCUMENT;
private PackagePart packagePart;
private POIXMLDocumentPart parent;
private Map<String, RelationPart> relations = new LinkedHashMap<>();
private final Map<String, RelationPart> relations = new LinkedHashMap<>();
private boolean isCommitted = false;
/**
@ -361,7 +361,7 @@ public class POIXMLDocumentPart {
* <p>
* If there are multiple relationships to the same part, this will only
* remove the first relationship in the order of creation. The removal
* via the part id ({@link #removeRelation(String)} is preferred.
* via the part id ({@link #removeRelation(POIXMLDocumentPart)} is preferred.
*
* @param partId the part id which relation is to be removed from this document
* @since 4.0.0
@ -380,7 +380,7 @@ public class POIXMLDocumentPart {
* @return true, if the relation was removed
* @since 4.0.0
*/
private final boolean removeRelation(String partId, boolean removeUnusedParts) {
private boolean removeRelation(String partId, boolean removeUnusedParts) {
RelationPart rp = relations.get(partId);
if (rp == null) {
// part is not related with this POIXMLDocumentPart

View File

@ -379,7 +379,7 @@ public final class ZipPackage extends OPCPackage {
* Delete a part from the package
*
* @throws IllegalArgumentException
* Throws if the part URI is nulll or invalid.
* Throws if the part URI is null or invalid.
*/
@Override
protected void removePartImpl(PackagePartName partName) {

View File

@ -32,7 +32,7 @@ import org.apache.poi.ss.usermodel.Cell;
* calls to evaluate~ methods on this class.
*/
public final class XSSFFormulaEvaluator extends BaseXSSFFormulaEvaluator {
private XSSFWorkbook _book;
private final XSSFWorkbook _book;
public XSSFFormulaEvaluator(XSSFWorkbook workbook) {
this(workbook, null, null);

View File

@ -172,7 +172,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
* The locator of user-defined functions.
* By default includes functions from the Excel Analysis Toolpack
*/
private IndexedUDFFinder _udfFinder = new IndexedUDFFinder(AggregatingUDFFinder.DEFAULT);
private final IndexedUDFFinder _udfFinder = new IndexedUDFFinder(AggregatingUDFFinder.DEFAULT);
/**
* TODO
@ -214,7 +214,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
*/
private List<XSSFPictureData> pictures;
private static POILogger logger = POILogFactory.getLogger(XSSFWorkbook.class);
private static final POILogger logger = POILogFactory.getLogger(XSSFWorkbook.class);
/**
* cached instance of XSSFCreationHelper for this workbook
@ -404,7 +404,6 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
// Load individual sheets. The order of sheets is defined by the order
// of CTSheet elements in the workbook
sheets = new ArrayList<>(shIdMap.size());
//noinspection deprecation
for (CTSheet ctSheet : this.workbook.getSheets().getSheetArray()) {
parseSheet(shIdMap, ctSheet);
}
@ -1604,7 +1603,6 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
newcts.set(cts);
//notify sheets
//noinspection deprecation
CTSheet[] sheetArray = ct.getSheetArray();
for(int i=0; i < sheetArray.length; i++) {
sheets.get(i).sheet = sheetArray[i];
@ -1773,7 +1771,6 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
* @return true if the sheet contains the name, false otherwise.
*/
private boolean containsSheet(String name, int excludeSheetIdx) {
//noinspection deprecation
CTSheet[] ctSheetArray = workbook.getSheets().getSheetArray();
if (name.length() > MAX_SENSITIVE_SHEET_NAME_LEN) {