]> source.dussan.org Git - poi.git/commitdiff
reduced the number of compiler warnings generated by JDK 1.6.13 with -Xlint
authorYegor Kozlov <yegor@apache.org>
Sun, 4 Oct 2009 16:01:29 +0000 (16:01 +0000)
committerYegor Kozlov <yegor@apache.org>
Sun, 4 Oct 2009 16:01:29 +0000 (16:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@821551 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java
src/ooxml/java/org/apache/poi/openxml4j/opc/Package.java
src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFactory.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFactory.java
src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePartName.java

index a313f36026baddcc68d21f2a658e3b337c4e320f..44290db92be2a1ec5fb876d380f4deae750ade33 100644 (file)
@@ -152,7 +152,7 @@ public class ExtractorFactory {
         */
        public static POITextExtractor[] getEmbededDocsTextExtractors(POIOLE2TextExtractor ext) throws IOException {
                // Find all the embeded directories
-               ArrayList dirs = new ArrayList();
+               ArrayList<Entry> dirs = new ArrayList<Entry>();
                POIFSFileSystem fs = ext.getFileSystem();
                if(fs == null) {
                        throw new IllegalStateException("The extractor didn't know which POIFS it came from!");
index bedc9b86d536b4fd7251172efaeb990b5f16061e..c32d7ee54c233d9fc911777dd3b61aff513129d0 100644 (file)
@@ -37,6 +37,7 @@ import org.apache.poi.util.POILogger;
  * @author Julien Chable, CDubet
  * 
  */
+@Deprecated
 public abstract class Package extends OPCPackage {
 
        /**
@@ -48,7 +49,8 @@ public abstract class Package extends OPCPackage {
        /**
         * @deprecated use {@link OPCPackage} 
         */
-       protected Package(PackageAccess access) {
+    @Deprecated
+    protected Package(PackageAccess access) {
                super(access);
        }
 
@@ -56,6 +58,7 @@ public abstract class Package extends OPCPackage {
        /**
         * @deprecated use {@link OPCPackage#open(String)} 
         */
+    @Deprecated
        public static Package open(String path) throws InvalidFormatException {
                return open(path, defaultPackageAccess);
        }
@@ -63,6 +66,7 @@ public abstract class Package extends OPCPackage {
        /**
         * @deprecated use {@link OPCPackage#open(String,PackageAccess)} 
         */
+    @Deprecated
        public static Package open(String path, PackageAccess access)
                        throws InvalidFormatException {
                if (path == null || "".equals(path.trim())
@@ -80,6 +84,7 @@ public abstract class Package extends OPCPackage {
        /**
         * @deprecated use {@link OPCPackage#open(InputStream)} 
         */
+    @Deprecated
        public static Package open(InputStream in) throws InvalidFormatException,
                        IOException {
                Package pack = new ZipPackage(in, PackageAccess.READ);
@@ -92,6 +97,7 @@ public abstract class Package extends OPCPackage {
        /**
         * @deprecated use {@link OPCPackage#openOrCreate(java.io.File)}  
         */
+    @Deprecated
        public static Package openOrCreate(File file) throws InvalidFormatException {
                Package retPackage = null;
                if (file.exists()) {
@@ -105,6 +111,7 @@ public abstract class Package extends OPCPackage {
        /**
         * @deprecated use {@link OPCPackage#create(String)} 
         */
+    @Deprecated
        public static Package create(String path) {
                return create(new File(path));
        }
@@ -112,6 +119,7 @@ public abstract class Package extends OPCPackage {
        /**
         * @deprecated use {@link OPCPackage#create(File)} 
         */
+    @Deprecated
        public static Package create(File file) {
                if (file == null || (file.exists() && file.isDirectory()))
                        throw new IllegalArgumentException("file");
@@ -133,6 +141,7 @@ public abstract class Package extends OPCPackage {
        /**
         * @deprecated use {@link OPCPackage#create(OutputStream)} 
         */
+    @Deprecated
        public static Package create(OutputStream output) {
                Package pkg = null;
                pkg = new ZipPackage();
index 6ca8ba6da91574235942d27ecd9d91aabc9fcd28..53cb5d66779d4d84d5b6e29adfd6590e57a77b65 100644 (file)
@@ -297,7 +297,7 @@ public class XSSFExportToXml implements Comparator<String>{
                
                        case XSSFCell.CELL_TYPE_STRING: value = cell.getStringCellValue(); break;
                        case XSSFCell.CELL_TYPE_BOOLEAN: value += cell.getBooleanCellValue(); break;
-                       case XSSFCell.CELL_TYPE_ERROR: value = cell.getErrorCellString();
+                       case XSSFCell.CELL_TYPE_ERROR: value = cell.getErrorCellString();  break;
                        case XSSFCell.CELL_TYPE_FORMULA: value = cell.getStringCellValue(); break;
                        case XSSFCell.CELL_TYPE_NUMERIC: value += cell.getRawValue(); break;
                        default: ;
index ffdc684f5b47d90325db1b30a2774f6353003512..bfcf85305e38370b0af4073edd2fe72a3d9605eb 100644 (file)
@@ -97,7 +97,7 @@ public final class XSSFDrawing extends POIXMLDocumentPart implements Drawing {
                 xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing">
         */
         if(isNew) xmlOptions.setSaveSyntheticDocumentElement(new QName(CTDrawing.type.getName().getNamespaceURI(), "wsDr", "xdr"));
-        Map map = new HashMap();
+        Map<String, String> map = new HashMap<String, String>();
         map.put("http://schemas.openxmlformats.org/drawingml/2006/main", "a");
         map.put(STRelationshipId.type.getName().getNamespaceURI(), "r");
         xmlOptions.setSaveSuggestedPrefixes(map);
index ab0ef2b443b9c693f8619c43be246073e50cd126..cc2cbe521d2b1f2656d1bd6cf0fe8585a2cddb73 100644 (file)
@@ -54,7 +54,7 @@ public final class XSSFFactory extends POIXMLFactory  {
         }
 
         try {
-            Class cls = descriptor.getRelationClass();
+            Class<? extends POIXMLDocumentPart> cls = descriptor.getRelationClass();
             Constructor<? extends POIXMLDocumentPart> constructor = cls.getDeclaredConstructor(PackagePart.class, PackageRelationship.class);
             return constructor.newInstance(part, rel);
         } catch (Exception e){
@@ -64,7 +64,7 @@ public final class XSSFFactory extends POIXMLFactory  {
 
     public POIXMLDocumentPart newDocumentPart(POIXMLRelation descriptor){
         try {
-            Class cls = descriptor.getRelationClass();
+            Class<? extends POIXMLDocumentPart> cls = descriptor.getRelationClass();
             Constructor<? extends POIXMLDocumentPart> constructor = cls.getDeclaredConstructor();
             return constructor.newInstance();
         } catch (Exception e){
index 0130eca2327ce6db7395c4b73601077730afc0a8..c6ef17bdc7ffd3b3a7e00c8d5436e7a5a9586a80 100644 (file)
@@ -55,9 +55,10 @@ public class XSSFFormulaEvaluator implements FormulaEvaluator {
         * @param stabilityClassifier used to optimise caching performance. Pass <code>null</code>
         * for the (conservative) assumption that any cell may have its definition changed after
         * evaluation begins.
-        * @deprecated (Sep 2009) (reduce overloading) use {@link #create(HSSFWorkbook, IStabilityClassifier, UDFFinder)}
+        * @deprecated (Sep 2009) (reduce overloading) use {@link #create(XSSFWorkbook, org.apache.poi.ss.formula.IStabilityClassifier, org.apache.poi.hssf.record.formula.udf.UDFFinder)} 
         */
-       public XSSFFormulaEvaluator(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier) {
+    @Deprecated
+    public XSSFFormulaEvaluator(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier) {
                _bookEvaluator = new WorkbookEvaluator(XSSFEvaluationWorkbook.create(workbook), stabilityClassifier, null);
        }
        private XSSFFormulaEvaluator(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder) {
index 8db42bc183c229dc8e9d5962bc3762b33d0c0519..b5a70286a218d2dffbad41999ec5242b53d28fae 100644 (file)
@@ -2326,7 +2326,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
 
         XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
         xmlOptions.setSaveSyntheticDocumentElement(new QName(CTWorksheet.type.getName().getNamespaceURI(), "worksheet"));
-        Map map = new HashMap();
+        Map<String, String> map = new HashMap<String, String>();
         map.put(STRelationshipId.type.getName().getNamespaceURI(), "r");
         xmlOptions.setSaveSuggestedPrefixes(map);
 
index a0ffb87bf9268e5f2aac9b497f42828ba2b39110..41f47836f375e4844bb3b4106464d5b8cece5cec 100644 (file)
@@ -263,7 +263,7 @@ public class XWPFHeaderFooterPolicy {
 
        private XmlOptions commit(XWPFHeaderFooter wrapper) {
                XmlOptions xmlOptions = new XmlOptions(wrapper.DEFAULT_XML_OPTIONS);
-        Map map = new HashMap();
+        Map<String, String> map = new HashMap<String, String>();
         map.put("http://schemas.openxmlformats.org/officeDocument/2006/math", "m");
         map.put("urn:schemas-microsoft-com:office:office", "o");
         map.put("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "r");
index 7a43ff46d40804eaccfce099851c7969a3fa9c0a..6a5f5c1c9ba0af90655d47e0d6d6073a8f0af66a 100644 (file)
@@ -326,7 +326,7 @@ public class XWPFDocument extends POIXMLDocument {
 
         XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
         xmlOptions.setSaveSyntheticDocumentElement(new QName(CTDocument1.type.getName().getNamespaceURI(), "document"));
-        Map map = new HashMap();
+        Map<String, String> map = new HashMap<String, String>();
         map.put("http://schemas.openxmlformats.org/officeDocument/2006/math", "m");
         map.put("urn:schemas-microsoft-com:office:office", "o");
         map.put("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "r");
index 02b18d9a2e027970ba783041cbf716c309a831b8..dfa67d95f68e325e331bb5fd2cdd0f65733ad207 100644 (file)
@@ -53,7 +53,7 @@ public final class XWPFFactory extends POIXMLFactory  {
         }
 
         try {
-            Class cls = descriptor.getRelationClass();
+            Class<? extends POIXMLDocumentPart> cls = descriptor.getRelationClass();
             Constructor<? extends POIXMLDocumentPart> constructor = cls.getDeclaredConstructor(PackagePart.class, PackageRelationship.class);
             return constructor.newInstance(part, rel);
         } catch (Exception e){
@@ -63,7 +63,7 @@ public final class XWPFFactory extends POIXMLFactory  {
 
     public POIXMLDocumentPart newDocumentPart(POIXMLRelation descriptor){
         try {
-            Class cls = descriptor.getRelationClass();
+            Class<? extends POIXMLDocumentPart> cls = descriptor.getRelationClass();
             Constructor<? extends POIXMLDocumentPart> constructor = cls.getDeclaredConstructor();
             return constructor.newInstance();
         } catch (Exception e){
index c7db2839425cb2f8c2b8a3520661d60e83c420ce..25935945223022175bd26e67a72fd438d232dda5 100644 (file)
@@ -91,7 +91,7 @@ public final class TestOPCCompliancePartName extends TestCase {
                        try {
                                uri = new URI(s);
                        } catch (URISyntaxException e) {
-                               assertTrue(s == "[Content_Types].xml");
+                               assertTrue(s.equals("[Content_Types].xml"));
                                continue;
                        }
                        assertFalse("This part name SHOULD NOT be valid: " + s,