aboutsummaryrefslogtreecommitdiffstats
path: root/poi-ooxml
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2022-03-20 08:20:00 +0000
committerDominik Stadler <centic@apache.org>2022-03-20 08:20:00 +0000
commit9949242022730d5e6f12cfe9dce2001bc85c3212 (patch)
tree9a1dddd369ec31cc344ab36f861ee8915c7e0bcd /poi-ooxml
parent98fbe88d3a7edde2da4bc3694788f3fdfb57fe5b (diff)
downloadpoi-9949242022730d5e6f12cfe9dce2001bc85c3212.tar.gz
poi-9949242022730d5e6f12cfe9dce2001bc85c3212.zip
Remove unused imports, remove unnecessary boxing of int-value and apply some other IDE suggestions
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1899076 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/ooxml/POIXMLProperties.java42
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java2
2 files changed, 21 insertions, 23 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/ooxml/POIXMLProperties.java b/poi-ooxml/src/main/java/org/apache/poi/ooxml/POIXMLProperties.java
index daa68d017b..14779374fe 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/ooxml/POIXMLProperties.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/ooxml/POIXMLProperties.java
@@ -41,14 +41,14 @@ import org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProper
/**
* Wrapper around the three different kinds of OOXML properties
- * and metadata a document can have (Core, Extended and Custom),
+ * and metadata a document can have (Core, Extended and Custom),
* as well Thumbnails.
*/
public class POIXMLProperties {
- private OPCPackage pkg;
- private CoreProperties core;
- private ExtendedProperties ext;
- private CustomProperties cust;
+ private final OPCPackage pkg;
+ private final CoreProperties core;
+ private final ExtendedProperties ext;
+ private final CustomProperties cust;
private PackagePart extPart;
private PackagePart custPart;
@@ -111,7 +111,7 @@ public class POIXMLProperties {
/**
* Returns the core document properties
- *
+ *
* @return the core document properties
*/
public CoreProperties getCoreProperties() {
@@ -120,7 +120,7 @@ public class POIXMLProperties {
/**
* Returns the extended document properties
- *
+ *
* @return the extended document properties
*/
public ExtendedProperties getExtendedProperties() {
@@ -129,7 +129,7 @@ public class POIXMLProperties {
/**
* Returns the custom document properties
- *
+ *
* @return the custom document properties
*/
public CustomProperties getCustomProperties() {
@@ -151,7 +151,7 @@ public class POIXMLProperties {
return null;
}
/**
- * Returns the name of the Document thumbnail, eg
+ * Returns the name of the Document thumbnail, eg
* <code>thumbnail.jpeg</code>, or <code>null</code> if there
* isn't one.
*
@@ -167,7 +167,7 @@ public class POIXMLProperties {
* Returns the Document thumbnail image data, or {@code null} if there isn't one.
*
* @return The thumbnail data, or null
- *
+ *
* @throws IOException if the thumbnail can't be read
*/
public InputStream getThumbnailImage() throws IOException {
@@ -181,7 +181,7 @@ public class POIXMLProperties {
*
* @param filename The filename for the thumbnail image, eg {@code thumbnail.jpg}
* @param imageData The inputstream to read the thumbnail image from
- *
+ *
* @throws IOException if the thumbnail can't be written
*/
public void setThumbnail(String filename, InputStream imageData) throws IOException {
@@ -191,9 +191,9 @@ public class POIXMLProperties {
pkg.addThumbnail(filename, imageData);
} else {
// Change existing
- String newType = ContentTypes.getContentTypeFromFileExtension(filename);
+ String newType = ContentTypes.getContentTypeFromFileExtension(filename);
if (! newType.equals(tPart.getContentType())) {
- throw new IllegalArgumentException("Can't set a Thumbnail of type " +
+ throw new IllegalArgumentException("Can't set a Thumbnail of type " +
newType + " when existing one is of a different type " +
tPart.getContentType());
}
@@ -203,7 +203,7 @@ public class POIXMLProperties {
/**
* Commit changes to the underlying OPC package
- *
+ *
* @throws IOException if the properties can't be saved
* @throws POIXMLException if the properties are erroneous
*/
@@ -236,7 +236,7 @@ public class POIXMLProperties {
}
}
if(custPart != null && cust != null && cust.props != null){
- /* bug #60977, when writing a file multiple times,
+ /* bug #60977, when writing a file multiple times,
* and there are custom properties and an existing package part,
* replace, don't append to raw document byte array
*/
@@ -251,7 +251,7 @@ public class POIXMLProperties {
* The core document properties
*/
public static class CoreProperties {
- private PackagePropertiesPart part;
+ private final PackagePropertiesPart part;
private CoreProperties(PackagePropertiesPart part) {
this.part = part;
}
@@ -365,7 +365,7 @@ public class POIXMLProperties {
* Extended document properties
*/
public static class ExtendedProperties {
- private org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.PropertiesDocument props;
+ private final org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.PropertiesDocument props;
private ExtendedProperties(org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.PropertiesDocument props) {
this.props = props;
}
@@ -568,7 +568,7 @@ public class POIXMLProperties {
*/
public static final String FORMAT_ID = "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}";
- private org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument props;
+ private final org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument props;
private Integer lastPid = null;
private CustomProperties(org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument props) {
@@ -601,7 +601,7 @@ public class POIXMLProperties {
/**
* Add a new string property
- *
+ *
* @param name the property name
* @param value the property value
*
@@ -693,11 +693,11 @@ public class POIXMLProperties {
* Retrieve the custom property with this name, or null if none exists.
*
* You will need to test the various isSetX methods to work out
- * what the type of the property is, before fetching the
+ * what the type of the property is, before fetching the
* appropriate value for it.
*
* @param name the name of the property to fetch
- *
+ *
* @return the custom property with this name, or null if none exists
*/
public CTProperty getProperty(String name) {
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java
index 47542bd46c..efdc7f057c 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java
@@ -248,7 +248,6 @@ public class XMLSlideShow extends POIXMLDocument
CTSlideIdList slideList = _presentation.isSetSldIdLst()
? _presentation.getSldIdLst() : _presentation.addNewSldIdLst();
- @SuppressWarnings("deprecation")
OptionalLong maxId = Stream.of(slideList.getSldIdArray())
.mapToLong(CTSlideIdListEntry::getId).max();
@@ -454,7 +453,6 @@ public class XMLSlideShow extends POIXMLDocument
// fix ordering in the low-level xml
CTSlideIdList sldIdLst = _presentation.getSldIdLst();
- @SuppressWarnings("deprecation")
CTSlideIdListEntry[] entries = sldIdLst.getSldIdArray();
CTSlideIdListEntry oldEntry = entries[oldIndex];
if (oldIndex < newIndex) {