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

src/java/org/apache/poi/poifs/crypt/EncryptionHeader.java
src/java/org/apache/poi/ss/formula/atp/WorkdayCalculator.java
src/ooxml/java/org/apache/poi/xwpf/model/XMLParagraph.java [deleted file]
src/ooxml/testcases/org/apache/poi/xwpf/TestXWPFBugs.java
src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java
src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayCalculator.java

index f13c116e0b4871303fa8224ff70e1ae28a09a90c..616dbcf19e07e622e20590be89d345a577958022 100644 (file)
@@ -17,7 +17,6 @@
 package org.apache.poi.poifs.crypt;
 
 import org.apache.poi.EncryptedDocumentException;
-import org.apache.poi.util.Removal;
 
 /**
  * Reads and processes OOXML Encryption Headers
@@ -93,15 +92,7 @@ public abstract class EncryptionHeader implements Cloneable {
     public HashAlgorithm getHashAlgorithm() {
         return hashAlgorithm;
     }
-    
-    /**
-     * @deprecated POI 3.16 beta 1. use {@link #getHashAlgorithm()}
-     */
-    @Removal(version="3.18")
-    public HashAlgorithm getHashAlgorithmEx() {
-        return hashAlgorithm;
-    }
-    
+
     protected void setHashAlgorithm(HashAlgorithm hashAlgorithm) {
         this.hashAlgorithm = hashAlgorithm;
     }
index 326a7e02f743411c905dbc2f8de8d997d69fc6b1..666501d540a3a128d261a576b90fa67ea9ac1d5a 100644 (file)
@@ -146,18 +146,6 @@ public class WorkdayCalculator {
         return false;
     }
 
-    /**
-     * @param aDate a given date.
-     * @param holidays an array of holidays.
-     * @return <code>1</code> is not a workday, <code>0</code> otherwise.
-     *
-     * @deprecated POI 3.16 - will be removed, not used in POI itself
-     */
-    @Removal(version="3.18")
-    protected int isNonWorkday(double aDate, double[] holidays) {
-        return isWeekend(aDate) || isHoliday(aDate, holidays) ? 1 : 0;
-    }
-
     /**
      * @param start start date.
      * @param end end date.
diff --git a/src/ooxml/java/org/apache/poi/xwpf/model/XMLParagraph.java b/src/ooxml/java/org/apache/poi/xwpf/model/XMLParagraph.java
deleted file mode 100644 (file)
index 497b9fe..0000000
+++ /dev/null
@@ -1,39 +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.xwpf.model;
-
-import org.apache.poi.util.Removal;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
-
-/**
- * Base class for XWPF paragraphs
- * 
- * @deprecated 3.16 beta1. This class isn't used ...
- */
-@Deprecated
-@Removal(version="3.18")
-public class XMLParagraph {
-    protected CTP paragraph;
-
-    public XMLParagraph(CTP paragraph) {
-        this.paragraph = paragraph;
-    }
-
-    public CTP getCTP() {
-        return paragraph;
-    }
-}
\ No newline at end of file
index 377d98b33c7575fadd4af9ecaeaf5986ecb2860a..7f4187041942f356fb029908939d0a1f3fdcb834 100644 (file)
@@ -56,7 +56,7 @@ public class TestXWPFBugs {
         EncryptionInfo info = new EncryptionInfo(filesystem);
         assertEquals(128, info.getHeader().getKeySize());
         assertEquals(CipherAlgorithm.aes128, info.getHeader().getCipherAlgorithm());
-        assertEquals(HashAlgorithm.sha1, info.getHeader().getHashAlgorithmEx());
+        assertEquals(HashAlgorithm.sha1, info.getHeader().getHashAlgorithm());
 
         // Check it can be decoded
         Decryptor d = Decryptor.getInstance(info);
@@ -92,7 +92,7 @@ public class TestXWPFBugs {
         assertEquals(16, info.getHeader().getBlockSize());
         assertEquals(256, info.getHeader().getKeySize());
         assertEquals(CipherAlgorithm.aes256, info.getHeader().getCipherAlgorithm());
-        assertEquals(HashAlgorithm.sha1, info.getHeader().getHashAlgorithmEx());
+        assertEquals(HashAlgorithm.sha1, info.getHeader().getHashAlgorithm());
 
         // Check it can be decoded
         Decryptor d = Decryptor.getInstance(info);
index 2b758cff3dff1ec85302847580fde669480a4053..814d588340e39db330e4ec0bc76a6f1e3119ecaa 100644 (file)
@@ -57,7 +57,6 @@ import org.apache.poi.util.LittleEndian;
 import org.apache.poi.util.LittleEndianConsts;
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
-import org.apache.poi.util.Removal;
 
 /**
  * This class contains the main functionality for the Powerpoint file
@@ -84,18 +83,6 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable {
     // Embedded objects stored in storage records in the document stream, lazily populated.
     private HSLFObjectData[] _objects;
 
-    /**
-     * Returns the directory in the underlying POIFSFileSystem for the
-     * document that is open.
-     * 
-     * @deprecated POI 3.16 beta 1. use {@link POIDocument#getDirectory()} instead
-     */
-    @Deprecated
-    @Removal(version="3.18")
-    protected DirectoryNode getPOIFSDirectory() {
-        return getDirectory();
-    }
-
     /**
      * Constructs a Powerpoint document from fileName. Parses the document
      * and places all the important stuff into data structures.
index 80adae743e831bf86137d829c48bb968efc5c992..3ea70b9947a21c863f5c0e33d78b88b7a9486fc6 100644 (file)
@@ -153,15 +153,4 @@ public class TestWorkdayCalculator {
         assertEquals("Expected 1 non-weekend-holiday for " + start + " to " + end + " and " + holiday1 + " and " + holiday2,
                 1, count);
     }
-
-    @SuppressWarnings("deprecation")
-    @Test
-    public void testIsNonWorkday() throws Exception {
-        final double weekend = DateUtil.getExcelDate(d(2016, 12, 25));
-        final double holiday = DateUtil.getExcelDate(d(2016, 12, 26));
-        final double workday = DateUtil.getExcelDate(d(2016, 12, 27));
-        assertEquals(1, WorkdayCalculator.instance.isNonWorkday(weekend, new double[]{holiday}));
-        assertEquals(1, WorkdayCalculator.instance.isNonWorkday(holiday, new double[]{holiday}));
-        assertEquals(0, WorkdayCalculator.instance.isNonWorkday(workday, new double[]{holiday}));
-    }
 }