From 320d9735ca7313061147ac93c2af1465c22e8aa7 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Thu, 14 Sep 2017 22:19:16 +0000 Subject: [PATCH] remove some deprecated code slated for removal in 3.18 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808400 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/xssf/usermodel/XSSFDataFormat.java | 12 ----- .../util/EvilUnclosedBRFixingInputStream.java | 46 ------------------- .../src/org/apache/poi/hsmf/MAPIMessage.java | 16 ------- .../poi/hsmf/TestOutlook30FileRead.java | 4 +- .../apache/poi/hsmf/TestSimpleFileRead.java | 4 +- 5 files changed, 4 insertions(+), 78 deletions(-) delete mode 100644 src/ooxml/java/org/apache/poi/xssf/util/EvilUnclosedBRFixingInputStream.java diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataFormat.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataFormat.java index d82524515a..8c867ab566 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataFormat.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataFormat.java @@ -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 null 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 index 0ef1aeeb5e..0000000000 --- a/src/ooxml/java/org/apache/poi/xssf/util/EvilUnclosedBRFixingInputStream.java +++ /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 >br<, - * 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, ">br<", ">br/<") - */ -@Deprecated -@Removal(version="3.18") -@Internal -public class EvilUnclosedBRFixingInputStream extends ReplacingInputStream { - public EvilUnclosedBRFixingInputStream(InputStream source) { - super(source, "
", "
"); - } -} diff --git a/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java b/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java index e770a40a30..3affa20a8b 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java @@ -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 diff --git a/src/scratchpad/testcases/org/apache/poi/hsmf/TestOutlook30FileRead.java b/src/scratchpad/testcases/org/apache/poi/hsmf/TestOutlook30FileRead.java index 1496e082dc..9d95bba54f 100644 --- a/src/scratchpad/testcases/org/apache/poi/hsmf/TestOutlook30FileRead.java +++ b/src/scratchpad/testcases/org/apache/poi/hsmf/TestOutlook30FileRead.java @@ -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); } /** diff --git a/src/scratchpad/testcases/org/apache/poi/hsmf/TestSimpleFileRead.java b/src/scratchpad/testcases/org/apache/poi/hsmf/TestSimpleFileRead.java index cc902fae34..f4abd80b23 100644 --- a/src/scratchpad/testcases/org/apache/poi/hsmf/TestSimpleFileRead.java +++ b/src/scratchpad/testcases/org/apache/poi/hsmf/TestSimpleFileRead.java @@ -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); } /** -- 2.39.5