From 3c13ee8f2809781993b993defa81466d93cbf5d5 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Thu, 24 Oct 2013 19:58:19 +0000 Subject: [PATCH] Fix some Eclipse warnings, remove trailing whitespaces git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1535517 13f79535-47bb-0310-9956-ffa450edef68 --- .../formula/constant/ConstantValueParser.java | 2 +- .../org/apache/poi/POIXMLDocumentPart.java | 15 +++++------ .../org/apache/poi/openxml4j/opc/Package.java | 4 +-- .../poi/xssf/usermodel/XSSFWorkbook.java | 27 ++++++++++++++----- 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/src/java/org/apache/poi/ss/formula/constant/ConstantValueParser.java b/src/java/org/apache/poi/ss/formula/constant/ConstantValueParser.java index cf664ebc2d..aa5016bc2c 100644 --- a/src/java/org/apache/poi/ss/formula/constant/ConstantValueParser.java +++ b/src/java/org/apache/poi/ss/formula/constant/ConstantValueParser.java @@ -104,7 +104,7 @@ public final class ConstantValueParser { if(object == EMPTY_REPRESENTATION) { return 8; } - Class cls = object.getClass(); + Class cls = object.getClass(); if(cls == Boolean.class || cls == Double.class || cls == ErrorConstant.class) { return 8; diff --git a/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java b/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java index 97af09c268..fe147b6228 100644 --- a/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java +++ b/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java @@ -106,7 +106,7 @@ public class POIXMLDocumentPart { * * @param part - The package part that holds xml data represenring this sheet. * @param rel - the relationship of the given package part - * @see #read(POIXMLFactory, java.util.Map) + * @see #read(POIXMLFactory, java.util.Map) */ public POIXMLDocumentPart(PackagePart part, PackageRelationship rel){ this.packagePart = part; @@ -131,7 +131,7 @@ public class POIXMLDocumentPart { /** * When you open something like a theme, call this to * re-base the XML Document onto the core child of the - * current core document + * current core document */ protected final void rebase(OPCPackage pkg) throws InvalidFormatException { PackageRelationshipCollection cores = @@ -179,7 +179,7 @@ public class POIXMLDocumentPart { * {@link POIXMLDocumentPart} to the {@link PackagePart} of the target * {@link POIXMLDocumentPart} with a {@link PackageRelationship#getId()} * matching the given parameter value. - * + * * @param id * The relation id to look for * @return the target part of the relation, or null, if none exists @@ -193,7 +193,7 @@ public class POIXMLDocumentPart { * {@link PackageRelationship}, that sources from the {@link PackagePart} of * this {@link POIXMLDocumentPart} to the {@link PackagePart} of the given * parameter value. - * + * * @param part * The {@link POIXMLDocumentPart} for which the according * relation-id shall be found. @@ -233,7 +233,7 @@ public class POIXMLDocumentPart { /** * Remove the relation to the specified part in this package and remove the * part, if it is no longer needed and flag is set to true. - * + * * @param part * The related part, to which the relation shall be removed. * @param removeUnusedParts @@ -343,8 +343,7 @@ public class POIXMLDocumentPart { * @param noRelation if true, then no relationship is added. * @return the created child POIXMLDocumentPart */ - @SuppressWarnings("null") - protected final POIXMLDocumentPart createRelationship(POIXMLRelation descriptor, POIXMLFactory factory, int idx, boolean noRelation){ + protected final POIXMLDocumentPart createRelationship(POIXMLRelation descriptor, POIXMLFactory factory, int idx, boolean noRelation){ try { PackagePartName ppName = PackagingURIHelper.createPartName(descriptor.getFileName(idx)); PackageRelationship rel = null; @@ -415,7 +414,7 @@ public class POIXMLDocumentPart { } } } - + /** * Get the PackagePart that is the target of a relationship from this Part. * diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/Package.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/Package.java index c32d7ee54c..6db5383d97 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/Package.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/Package.java @@ -28,8 +28,6 @@ import org.apache.poi.openxml4j.exceptions.InvalidOperationException; import org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart; import org.apache.poi.openxml4j.opc.internal.ZipContentTypeManager; import org.apache.poi.openxml4j.util.Nullable; -import org.apache.poi.util.POILogFactory; -import org.apache.poi.util.POILogger; /** * @deprecated (name clash with {@link java.lang.Package} use {@link OPCPackage} instead. @@ -43,7 +41,7 @@ public abstract class Package extends OPCPackage { /** * Logger. */ - private static POILogger logger = POILogFactory.getLogger(Package.class); + //private static POILogger logger = POILogFactory.getLogger(Package.class); /** diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java index e6d33ebeb0..6450d92018 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java @@ -23,7 +23,13 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; import java.util.regex.Pattern; import javax.xml.namespace.QName; @@ -32,7 +38,6 @@ import org.apache.poi.POIXMLDocument; import org.apache.poi.POIXMLDocumentPart; import org.apache.poi.POIXMLException; import org.apache.poi.POIXMLProperties; -import org.apache.poi.ss.formula.SheetNameFormatter; import org.apache.poi.openxml4j.exceptions.OpenXML4JException; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackagePart; @@ -41,17 +46,26 @@ import org.apache.poi.openxml4j.opc.PackageRelationship; import org.apache.poi.openxml4j.opc.PackageRelationshipTypes; import org.apache.poi.openxml4j.opc.PackagingURIHelper; import org.apache.poi.openxml4j.opc.TargetMode; +import org.apache.poi.ss.formula.SheetNameFormatter; import org.apache.poi.ss.formula.udf.IndexedUDFFinder; import org.apache.poi.ss.formula.udf.UDFFinder; import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; -import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellReference; import org.apache.poi.ss.util.WorkbookUtil; -import org.apache.poi.util.*; -import org.apache.poi.xssf.model.*; +import org.apache.poi.util.IOUtils; +import org.apache.poi.util.Internal; +import org.apache.poi.util.POILogFactory; +import org.apache.poi.util.POILogger; +import org.apache.poi.util.PackageHelper; +import org.apache.poi.xssf.model.CalculationChain; +import org.apache.poi.xssf.model.MapInfo; +import org.apache.poi.xssf.model.SharedStringsTable; +import org.apache.poi.xssf.model.StylesTable; +import org.apache.poi.xssf.model.ThemesTable; import org.apache.poi.xssf.usermodel.helpers.XSSFFormulaUtils; import org.apache.xmlbeans.XmlException; import org.apache.xmlbeans.XmlObject; @@ -1385,7 +1399,8 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Iterable getAllEmbedds() throws OpenXML4JException { + @Override + public List getAllEmbedds() throws OpenXML4JException { List embedds = new LinkedList(); for(XSSFSheet sheet : sheets){