Apply some IDE suggestions

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885068 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2021-01-03 17:02:14 +00:00
parent 695bea4e68
commit fcf123fc5b
6 changed files with 48 additions and 50 deletions

View File

@ -213,7 +213,6 @@ implements Slide<XSLFShape,XSLFTextParagraph> {
final XSLFComments xComments = getCommentsPart();
final XSLFCommentAuthors xAuthors = getCommentAuthorsPart();
if (xComments != null) {
//noinspection deprecation
for (final CTComment xc : xComments.getCTCommentsList().getCmArray()) {
comments.add(new XSLFComment(xc, xAuthors));
}

View File

@ -61,11 +61,11 @@ import org.openxmlformats.schemas.presentationml.x2006.main.SldMasterDocument;
*/
public class XSLFSlideShow extends POIXMLDocument {
private PresentationDocument presentationDoc;
private final PresentationDocument presentationDoc;
/**
* The embedded OLE2 files in the OPC package
*/
private List<PackagePart> embedds;
private final List<PackagePart> embedds;
public XSLFSlideShow(OPCPackage container) throws OpenXML4JException, IOException, XmlException {
super(container);

View File

@ -184,7 +184,6 @@ public class StylesTable extends POIXMLDocumentPart implements Styles {
* @param is The input stream containing the XML document.
* @throws IOException if an error occurs while reading.
*/
@SuppressWarnings("deprecation")
public void readFrom(InputStream is) throws IOException {
try {
doc = StyleSheetDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);

View File

@ -975,12 +975,12 @@ public class XSSFCellStyle implements CellStyle, Duplicatable {
*
* @param font a font object created or retrieved from the XSSFWorkbook object
* @see org.apache.poi.xssf.usermodel.XSSFWorkbook#createFont()
* @see org.apache.poi.xssf.usermodel.XSSFWorkbook#getFontAt(short)
* @see org.apache.poi.xssf.usermodel.XSSFWorkbook#getFontAt(int)
*/
@Override
public void setFont(Font font) {
if(font != null){
long index = font.getIndexAsInt();
long index = font.getIndex();
this._cellXf.setFontId(index);
this._cellXf.setApplyFont(true);
} else {
@ -1170,7 +1170,7 @@ public class XSSFCellStyle implements CellStyle, Duplicatable {
* Set whether the text should be wrapped.
* <p>
* Setting this flag to <code>true</code> make all content visible
* whithin a cell by displaying it on multiple lines
* within a cell by displaying it on multiple lines
* </p>
*
* @param wrapped a boolean value indicating if the text in a cell should be line-wrapped within the cell.
@ -1277,7 +1277,7 @@ public class XSSFCellStyle implements CellStyle, Duplicatable {
*/
@Override
public boolean equals(Object o){
if(o == null || !(o instanceof XSSFCellStyle)) return false;
if(!(o instanceof XSSFCellStyle)) return false;
XSSFCellStyle cf = (XSSFCellStyle)o;
return _cellXf.toString().equals(cf.getCoreXf().toString());

View File

@ -36,7 +36,7 @@ public class XSSFCellAlignment {
/**
* Creates a Cell Alignment from the supplied XML definition
*
* @param cellAlignment
* @param cellAlignment The low-level XML definition of the cell alignment
*/
public XSSFCellAlignment(CTCellAlignment cellAlignment) {
this.cellAlignement = cellAlignment;

View File

@ -133,7 +133,7 @@ public class OOXMLLiteAgent {
// TODO: check if this is atomic ... as transform() is probably called synchronized, it doesn't matter anyway
Files.write(path, (item+"\n").getBytes(StandardCharsets.ISO_8859_1), StandardOpenOption.CREATE, StandardOpenOption.APPEND);
hashes.add(item.hashCode());
} catch (IOException ignroed) {
} catch (IOException ignored) {
}
}
}