]> source.dussan.org Git - poi.git/commitdiff
remove some deprecated code slated for removal in 3.18
authorPJ Fanning <fanningpj@apache.org>
Thu, 14 Sep 2017 22:19:16 +0000 (22:19 +0000)
committerPJ Fanning <fanningpj@apache.org>
Thu, 14 Sep 2017 22:19:16 +0000 (22:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808400 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataFormat.java
src/ooxml/java/org/apache/poi/xssf/util/EvilUnclosedBRFixingInputStream.java [deleted file]
src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java
src/scratchpad/testcases/org/apache/poi/hsmf/TestOutlook30FileRead.java
src/scratchpad/testcases/org/apache/poi/hsmf/TestSimpleFileRead.java

index d82524515a4358505a6ec0777a74143963a7b1fe..8c867ab566a55233cc6e92d2ba77101416a80197 100644 (file)
@@ -18,7 +18,6 @@ package org.apache.poi.xssf.usermodel;
 
 import org.apache.poi.ss.usermodel.BuiltinFormats;
 import org.apache.poi.ss.usermodel.DataFormat;
-import org.apache.poi.util.Removal;
 import org.apache.poi.xssf.model.StylesTable;
 
 /**
@@ -71,17 +70,6 @@ public class XSSFDataFormat implements DataFormat {
         if(fmt == null) fmt = BuiltinFormats.getBuiltinFormat(index);
         return fmt;
     }
-    /**
-     * get the format string that matches the given format index
-     * @param index of a format
-     * @return string represented at index of format or <code>null</code> if there is not a  format at that index
-     * 
-     * @deprecated POI 3.16 beta 1 - use {@link #getFormat(short)} instead
-     */
-    @Removal(version="3.18")
-    public String getFormat(int index) {
-        return getFormat((short)index);
-    }
     
     /**
      * Add a number format with a specific ID into the number format style table.
diff --git a/src/ooxml/java/org/apache/poi/xssf/util/EvilUnclosedBRFixingInputStream.java b/src/ooxml/java/org/apache/poi/xssf/util/EvilUnclosedBRFixingInputStream.java
deleted file mode 100644 (file)
index 0ef1aee..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ====================================================================
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-==================================================================== */
-package org.apache.poi.xssf.util;
-
-import java.io.InputStream;
-
-import org.apache.poi.util.Internal;
-import org.apache.poi.util.Removal;
-import org.apache.poi.util.ReplacingInputStream;
-
-/**
- * This is a seriously sick fix for the fact that some .xlsx
- *  files contain raw bits of HTML, without being escaped
- *  or properly turned into XML.
- * The result is that they contain things like &gt;br&lt;,
- *  which breaks the XML parsing.
- * This very sick InputStream wrapper attempts to spot
- *  these go past, and fix them.
- * Only works for UTF-8 and US-ASCII based streams!
- * It should only be used where experience shows the problem
- *  can occur...
- *  
- *  @deprecated 3.16-beta2 - use ReplacingInputStream(source, "&gt;br&lt;", "&gt;br/&lt;")
- */
-@Deprecated
-@Removal(version="3.18")
-@Internal
-public class EvilUnclosedBRFixingInputStream extends ReplacingInputStream {
-   public EvilUnclosedBRFixingInputStream(InputStream source) {
-      super(source, "<br>", "<br/>");
-   }
-}
index e770a40a30ce4409b06a67c419869ba21c8bd8e0..3affa20a8b90dee51bf14482cd97bd7904faee15 100644 (file)
@@ -52,7 +52,6 @@ import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
 import org.apache.poi.util.CodePageUtil;
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
-import org.apache.poi.util.Removal;
 
 /**
  * Reads an Outlook MSG File in and provides hooks into its data structure.
@@ -536,21 +535,6 @@ public class MAPIMessage extends POIReadOnlyDocument {
       return getStringFromChunk(mainChunks.getConversationTopic());
    }
 
-   /**
-    * Gets the message class of the parsed Outlook Message.
-    * (Yes, you can use this to determine if a message is a calendar 
-    *  item, note, or actual outlook Message)
-    * For emails the class will be IPM.Note
-    *
-    * @throws ChunkNotFoundException
-    * @deprecated 3.16 beta 3. Use {@link #getMessageClassEnum()} instead.
-    */
-   @Deprecated
-   @Removal(version="3.18")
-   public String getMessageClass() throws ChunkNotFoundException {
-      return getStringFromChunk(mainChunks.getMessageClass());
-   }
-
    /**
     * Gets the message class of the parsed Outlook Message.
     * (Yes, you can use this to determine if a message is a calendar
index 1496e082dc5ec6eacedeb7878766236576ec3fb2..9d95bba54f7126e3e51072b8c116c5ea32cc3b94 100644 (file)
@@ -126,8 +126,8 @@ public final class TestOutlook30FileRead extends TestCase {
      * @throws Exception
      */
     public void testReadMessageClass() throws Exception {
-        String obtained = mapiMessage.getMessageClass();
-        TestCase.assertEquals("IPM.Note", obtained);
+        MAPIMessage.MESSAGE_CLASS obtained = mapiMessage.getMessageClassEnum();
+        TestCase.assertEquals(MAPIMessage.MESSAGE_CLASS.NOTE, obtained);
     }
 
     /**
index cc902fae349956827958cc672dab0394f8b28659..f4abd80b233b1beff16f491f11c804e9d4a9734b 100644 (file)
@@ -130,8 +130,8 @@ public final class TestSimpleFileRead extends TestCase {
      * @throws Exception
      */
     public void testReadMessageClass() throws Exception {
-        String obtained = mapiMessage.getMessageClass();
-        TestCase.assertEquals("IPM.Note", obtained);
+        MAPIMessage.MESSAGE_CLASS obtained = mapiMessage.getMessageClassEnum();
+        TestCase.assertEquals(MAPIMessage.MESSAGE_CLASS.NOTE, obtained);
     }
 
     /**