]> source.dussan.org Git - poi.git/commitdiff
bug 59170: Removed deprecated methods in POIFS, SS, HSSF, and XSSF
authorJaven O'Neal <onealj@apache.org>
Sat, 18 Jun 2016 01:06:53 +0000 (01:06 +0000)
committerJaven O'Neal <onealj@apache.org>
Sat, 18 Jun 2016 01:06:53 +0000 (01:06 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1748897 13f79535-47bb-0310-9956-ffa450edef68

35 files changed:
src/java/org/apache/poi/hssf/record/CFRuleBase.java
src/java/org/apache/poi/hssf/record/DrawingRecord.java
src/java/org/apache/poi/hssf/record/ExternSheetRecord.java
src/java/org/apache/poi/hssf/record/FilePassRecord.java
src/java/org/apache/poi/hssf/record/PaneRecord.java
src/java/org/apache/poi/hssf/record/PasswordRecord.java
src/java/org/apache/poi/hssf/record/RecordFactoryInputStream.java
src/java/org/apache/poi/hssf/record/RecordInputStream.java
src/java/org/apache/poi/hssf/record/UnicodeString.java [deleted file]
src/java/org/apache/poi/hssf/record/WindowOneRecord.java
src/java/org/apache/poi/hssf/record/WindowTwoRecord.java
src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java
src/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java
src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
src/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormattingRule.java
src/java/org/apache/poi/hssf/usermodel/HSSFFormulaEvaluator.java
src/java/org/apache/poi/hssf/usermodel/HSSFName.java
src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
src/java/org/apache/poi/poifs/crypt/EncryptionHeader.java
src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java
src/java/org/apache/poi/poifs/crypt/EncryptionVerifier.java
src/java/org/apache/poi/poifs/filesystem/EntryUtils.java
src/java/org/apache/poi/poifs/filesystem/Ole10Native.java
src/java/org/apache/poi/ss/formula/LazyRefEval.java
src/java/org/apache/poi/ss/formula/eval/BlankEval.java
src/java/org/apache/poi/ss/usermodel/ConditionalFormattingRule.java
src/java/org/apache/poi/ss/util/CellRangeAddress.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormattingRule.java
src/ooxml/testcases/org/apache/poi/poifs/crypt/TestCertificateEncryption.java
src/testcases/org/apache/poi/hssf/record/TestDrawingRecord.java
src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java
src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java
src/testcases/org/apache/poi/ss/usermodel/BaseTestConditionalFormatting.java
src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java

index e3a91e9f58f74728ca3fc12b19c6d7656e09dc20..3554039af2e20055d2b86d658141c38ed3237d4e 100644 (file)
@@ -40,6 +40,7 @@ import org.apache.poi.util.POILogger;
  *  for their rules.</p>
  */
 public abstract class CFRuleBase extends StandardRecord implements Cloneable {
+    // FIXME: Merge with org.apache.poi.ss.usermodel.ComparisonOperator and rewrite as an enum
     public static final class ComparisonOperator {
         public static final byte NO_COMPARISON = 0;
         public static final byte BETWEEN       = 1;
index 453a7bc7531f4a83ab007033c8ad5cc3fb59fc09..c55cafa44b56e3533a7cc724a3d6cc2917d64364 100644 (file)
@@ -37,6 +37,9 @@ public final class DrawingRecord extends StandardRecord implements Cloneable {
         recordData = in.readRemainder();
     }
 
+    /**
+     * @deprecated POI 3.9
+     */
     @Deprecated
     public void processContinueRecord(byte[] record) {
         //don't merge continue record with the drawing record, it must be serialized separately
@@ -55,11 +58,6 @@ public final class DrawingRecord extends StandardRecord implements Cloneable {
         return sid;
     }
 
-    @Deprecated
-    public byte[] getData() {
-        return recordData;
-    }
-
     public byte[] getRecordData(){
         return recordData;
     }
index 18aacc5cf08dafaee15c1b3041febc6eb96c1f4a..beee8bca6d3c9f8af11f5429cc5a071c4ef703d9 100644 (file)
@@ -162,14 +162,6 @@ public class ExternSheetRecord extends StandardRecord {
                return _list.get(i);
        }
        
-    /**
-     * @deprecated Was prevously used for removing sheets, which we now do differently 
-     */
-    @Deprecated
-    public void adjustIndex(int extRefIndex, int offset) {
-        getRef(extRefIndex).adjustIndex(offset);
-    }
-       
        public void removeSheet(int sheetIdx) {
         int nItems = _list.size();
         for (int i = 0; i < nItems; i++) {
index 413b865041849505a5a7a20bd053de85755e210b..7c8ae948f926de14a983695990046972d87116ae 100644 (file)
@@ -251,54 +251,6 @@ public final class FilePassRecord extends StandardRecord implements Cloneable {
         }
         return rc4;
     }
-    
-    /**
-     * @deprecated use getRc4KeyData().getSalt()
-     * @return the rc4 salt
-     */
-    public byte[] getDocId() {
-               return checkRc4().getSalt();
-       }
-
-    /**
-     * @deprecated use getRc4KeyData().setSalt()
-     * @param docId the new rc4 salt
-     */
-    public void setDocId(byte[] docId) {
-        checkRc4().setSalt(docId);
-       }
-
-    /**
-     * @deprecated use getRc4KeyData().getEncryptedVerifier()
-     * @return the rc4 encrypted verifier
-     */
-    public byte[] getSaltData() {
-               return checkRc4().getEncryptedVerifier();
-       }
-
-    /**
-     * @deprecated use getRc4KeyData().setEncryptedVerifier()
-     * @param saltData the new rc4 encrypted verifier
-     */
-       public void setSaltData(byte[] saltData) {
-           getRc4KeyData().setEncryptedVerifier(saltData);
-       }
-
-    /**
-     * @deprecated use getRc4KeyData().getEncryptedVerifierHash()
-     * @return the rc4 encrypted verifier hash
-     */
-       public byte[] getSaltHash() {
-               return getRc4KeyData().getEncryptedVerifierHash();
-       }
-
-    /**
-     * @deprecated use getRc4KeyData().setEncryptedVerifierHash()
-     * @param saltHash the new rc4 encrypted verifier
-     */
-       public void setSaltHash(byte[] saltHash) {
-           getRc4KeyData().setEncryptedVerifierHash(saltHash);
-       }
 
        public short getSid() {
                return sid;
index ea7d967adca5380f526c48e5b81d93840b6a5490..5bff223b2244c584d43e743b0df0d002a970bcd8 100644 (file)
@@ -34,9 +34,6 @@ public final class PaneRecord extends StandardRecord {
     public final static short       ACTIVE_PANE_LOWER_RIGHT        = 0;
     public final static short       ACTIVE_PANE_UPPER_RIGHT        = 1;
     public final static short       ACTIVE_PANE_LOWER_LEFT         = 2;
-    // TODO - remove obsolete field (it was deprecated May-2008 v3.1)
-    /** @deprecated use ACTIVE_PANE_UPPER_LEFT */
-    public final static short       ACTIVE_PANE_UPER_LEFT          = 3;
     public final static short       ACTIVE_PANE_UPPER_LEFT         = 3;
 
 
index dc7a4c395051f898f1617fef78cec6b5f019a3f5..3277cdcb86de9f4c589882ad465f77681f31b404 100644 (file)
@@ -38,15 +38,6 @@ public final class PasswordRecord extends StandardRecord {
         field_1_password = in.readShort();
     }
 
-    /**
-     * Return the password hash
-     *
-     * @deprecated use {@link CryptoFunctions#createXorVerifier1(String)}
-     */
-    public static short hashPassword(String password) {
-        return (short)CryptoFunctions.createXorVerifier1(password);
-    }
-
     /**
      * set the password
      *
index 263bdeeee3e0e8ce6725b19b87587ab50f79dc0a..3f6a9c4691004fd56c56b4a6d0a2b461ee7e14ac 100644 (file)
@@ -29,8 +29,6 @@ import org.apache.poi.hssf.record.crypto.Biff8EncryptionKey;
 import org.apache.poi.hssf.record.crypto.Biff8RC4Key;
 import org.apache.poi.hssf.record.crypto.Biff8XORKey;
 import org.apache.poi.poifs.crypt.Decryptor;
-import org.apache.poi.util.POILogFactory;
-import org.apache.poi.util.POILogger;
 
 /**
  * A stream based way to get at complete records, with
index 126092bd482d99c07f880b58e6ccd1d38dc42fea..2b66bd80a3df55d4aff07315c547a19fd1bdd6a7 100644 (file)
@@ -415,7 +415,7 @@ public final class RecordInputStream implements LittleEndianInput {
   /** Reads all byte data for the current record, including any
    *  that overlaps into any following continue records.
    *
-   *  @deprecated Best to write a input stream that wraps this one where there is
+   *  @deprecated POI 2.0 Best to write a input stream that wraps this one where there is
    *  special sub record that may overlap continue records.
    */
   public byte[] readAllContinuedRemainder() {
diff --git a/src/java/org/apache/poi/hssf/record/UnicodeString.java b/src/java/org/apache/poi/hssf/record/UnicodeString.java
deleted file mode 100644 (file)
index a8c23df..0000000
+++ /dev/null
@@ -1,35 +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.hssf.record;
-/**
- * @deprecated Use {@link org.apache.poi.hssf.record.common.UnicodeString} instead
- */
-public final class UnicodeString extends org.apache.poi.hssf.record.common.UnicodeString {
-   /**
-    * @deprecated Use {@link org.apache.poi.hssf.record.common.UnicodeString} instead
-    */
-   public UnicodeString(RecordInputStream in) {
-      super(in);
-   }
-   /**
-    * @deprecated Use {@link org.apache.poi.hssf.record.common.UnicodeString} instead
-    */
-   public UnicodeString(String str) {
-      super(str);
-   }
-}
index ffed2164e176d0e1a619b058379eb8fa6a7823e9..e2b9e2c4d3dd5ed8fa7f3d06132311bc6f07976f 100644 (file)
@@ -182,14 +182,6 @@ public final class WindowOneRecord extends StandardRecord {
     public void setActiveSheetIndex(int index) {
        field_6_active_sheet = index;
        }
-    /**
-     * deprecated May 2008
-     * @deprecated - Misleading name - use setActiveSheetIndex() 
-     */
-    public void setSelectedTab(short s)
-    {
-        setActiveSheetIndex(s);
-    }
 
     /**
      * Sets the first visible sheet in the worksheet tab-bar.  This method does <b>not</b>
@@ -200,14 +192,6 @@ public final class WindowOneRecord extends StandardRecord {
         field_7_first_visible_tab = t;
     }
 
-    /**
-     * deprecated May 2008
-     * @deprecated - Misleading name - use setFirstVisibleTab() 
-     */
-    public void setDisplayedTab(short t) {
-        setFirstVisibleTab(t);
-    }
-
     /**
      * set the number of selected tabs
      * @param n  number of tabs
@@ -340,14 +324,6 @@ public final class WindowOneRecord extends StandardRecord {
     public int getActiveSheetIndex() {
        return field_6_active_sheet;
     }
-    /**
-     * deprecated May 2008
-     * @deprecated - Misleading name - use getActiveSheetIndex() 
-     */
-    public short getSelectedTab()
-    {
-        return (short) getActiveSheetIndex();
-    }
 
     /**
      * @return the first visible sheet in the worksheet tab-bar. 
@@ -356,14 +332,6 @@ public final class WindowOneRecord extends StandardRecord {
     public int getFirstVisibleTab() {
         return field_7_first_visible_tab;
     }
-    /**
-     * deprecated May 2008
-     * @deprecated - Misleading name - use getFirstVisibleTab() 
-     */
-    public short getDisplayedTab()
-    {
-        return (short) getFirstVisibleTab();
-    }
 
     /**
      * get the number of selected tabs
index a56f9bd522a11859ebda9334d9bdc7c47b083dab..d7f0ec47747ff58b457893a726279f2fbf3e5387 100644 (file)
@@ -198,13 +198,7 @@ public final class WindowTwoRecord extends StandardRecord {
     public void setActive(boolean p) {
         field_1_options = active.setShortBoolean(field_1_options, p);
     }
-    /**
-     * deprecated May 2008
-     * @deprecated use setActive()
-     */
-    public void setPaged(boolean p) {
-       setActive(p);
-    }
+
     /**
      * was the sheet saved in page break view
      * @param p  pagebreaksaved or not
@@ -396,13 +390,6 @@ public final class WindowTwoRecord extends StandardRecord {
     public boolean isActive() {
         return active.isSet(field_1_options);
     }
-    /**
-     * deprecated May 2008
-     * @deprecated use isActive()
-     */
-    public boolean getPaged() {
-        return isActive();
-    }
 
     /**
      * was the sheet saved in page break view
index 68b3e9e48203819852035417aae824a5dc51bc7f..0319af64e4fb060dd1f83a395a0e50ec59212b01 100644 (file)
@@ -442,14 +442,6 @@ public final class RowRecordsAggregate extends RecordAggregate {
                return _valuesAgg.iterator();
        }
 
-       /**
-        * @deprecated use {@link #getCellValueIterator()} instead
-        */
-       public CellValueRecordInterface[] getValueRecords() {
-               //noinspection deprecation
-               return _valuesAgg.getValueRecords();
-       }
-
        public IndexRecord createIndexRecord(int indexRecordOffset, int sizeOfInitialSheetRecords) {
                IndexRecord result = new IndexRecord();
                result.setFirstRow(_firstrow);
index 14415ae9b2220ba49418f11f651843f2465a4cd9..5713d75e5d484ab683fecf08ebadd52beca54e31 100644 (file)
@@ -359,33 +359,6 @@ public final class ValueRecordsAggregate implements Iterable<CellValueRecordInte
                return new ValueIterator();
        }
 
-       /**
-        * Gets all the cell records contained in this aggregate. 
-        * Note {@link BlankRecord}s appear separate (not in {@link MulBlankRecord}s).
-        * @deprecated use {@link #iterator()} instead
-        */
-       @Deprecated
-       public CellValueRecordInterface[] getValueRecords() {
-               List<CellValueRecordInterface> temp = new ArrayList<CellValueRecordInterface>();
-
-               for (int rowIx = 0; rowIx < records.length; rowIx++) {
-                       CellValueRecordInterface[] rowCells = records[rowIx];
-                       if (rowCells == null) {
-                               continue;
-                       }
-                       for (int colIx = 0; colIx < rowCells.length; colIx++) {
-                               CellValueRecordInterface cell = rowCells[colIx];
-                               if (cell != null) {
-                                       temp.add(cell);
-                               }
-                       }
-               }
-
-               CellValueRecordInterface[] result = new CellValueRecordInterface[temp.size()];
-               temp.toArray(result);
-               return result;
-       }
-
        public Object clone() {
                throw new RuntimeException("clone() should not be called.  ValueRecordsAggregate should be copied via Sheet.cloneSheet()");
        }
index bf317b01dc61e82713d57a53245bc5ae36f879a3..08825ce358ceb0cdcf09488f7faee7222ae674fc 100644 (file)
@@ -99,7 +99,7 @@ public class HSSFCell implements Cell {
      * @param row   - the row of this cell
      * @param col   - the column for this cell
      *
-     * @see org.apache.poi.hssf.usermodel.HSSFRow#createCell(short)
+     * @see org.apache.poi.hssf.usermodel.HSSFRow#createCell(int)
      */
     protected HSSFCell(HSSFWorkbook book, HSSFSheet sheet, int row, short col)
     {
@@ -145,7 +145,7 @@ public class HSSFCell implements Cell {
      * @param type  - CELL_TYPE_NUMERIC, CELL_TYPE_STRING, CELL_TYPE_FORMULA, CELL_TYPE_BLANK,
      *                CELL_TYPE_BOOLEAN, CELL_TYPE_ERROR
      *                Type of cell
-     * @see org.apache.poi.hssf.usermodel.HSSFRow#createCell(short,int)
+     * @see org.apache.poi.hssf.usermodel.HSSFRow#createCell(int,int)
      */
     protected HSSFCell(HSSFWorkbook book, HSSFSheet sheet, int row, short col,
                        int type)
index f27675f714752747745dbec0814930199644de72..b52ea9102e2a21862e446a0c058e051e00b9b68b 100644 (file)
@@ -230,19 +230,16 @@ public final class HSSFConditionalFormattingRule implements ConditionalFormattin
     /**
      * @return -  the conditiontype for the cfrule
      */
-    public byte getConditionType() {
-        return cfRuleRecord.getConditionType();
-    }
-    /**
-     * @return -  the conditiontype for the cfrule
-     */
-    public ConditionType getConditionTypeType() {
-        return ConditionType.forId(getConditionType());
+    @Override
+    public ConditionType getConditionType() {
+        byte code = cfRuleRecord.getConditionType();
+        return ConditionType.forId(code);
     }
 
     /**
      * @return - the comparisionoperatation for the cfrule
      */
+    @Override
     public byte getComparisonOperation() {
         return cfRuleRecord.getComparisonOperation();
     }
index 52b10f899b63dfbf0185cc38c3a44fb4e0a1e428..06afe82961808fcd66365a405e2f720d9e26f739 100644 (file)
@@ -48,17 +48,6 @@ public class HSSFFormulaEvaluator implements FormulaEvaluator, WorkbookEvaluator
        private WorkbookEvaluator _bookEvaluator;
        private HSSFWorkbook _book;
 
-       /**
-        * @deprecated (Sep 2008) HSSFSheet parameter is ignored
-        */
-       @Deprecated
-    public HSSFFormulaEvaluator(HSSFSheet sheet, HSSFWorkbook workbook) {
-               this(workbook);
-//             if (false) {
-//                     sheet.toString(); // suppress unused parameter compiler warning
-//             }
-               this._book = workbook;
-       }
        public HSSFFormulaEvaluator(HSSFWorkbook workbook) {
                this(workbook, null);
       this._book = workbook;
index dc20afd1fa218ef29910e6f2b4d5cfb9c5694133..13818f5b2907945c7d95db206e63fd1994c57fc5 100644 (file)
@@ -162,24 +162,6 @@ public final class HSSFName implements Name {
         }
     }
 
-    /**
-     * Returns the formula that the name is defined to refer to.
-     *
-     * @deprecated (Nov 2008) Misleading name. Use {@link #getRefersToFormula()} instead.
-     */
-    public String getReference() {
-        return getRefersToFormula();
-    }
-
-    /**
-     * Sets the formula that the name is defined to refer to.
-     *
-     * @deprecated (Nov 2008) Misleading name. Use {@link #setRefersToFormula(String)} instead.
-     */
-    public void setReference(String ref){
-        setRefersToFormula(ref);
-    }
-
     public void setRefersToFormula(String formulaText) {
         Ptg[] ptgs = HSSFFormulaParser.parse(formulaText, _book, FormulaType.NAMEDRANGE, getSheetIndex());
         _definedNameRec.setNameDefinition(ptgs);
index 7bf6721b1963239744791e3bc575f170f11ab34e..c3354d6aa49ae5b5e56141fe2b10638cd99c79a2 100644 (file)
@@ -95,18 +95,6 @@ public final class HSSFRow implements Row, Comparable<HSSFRow> {
         // subsequent calls to createCellFromRecord() will update the colIx boundaries properly
     }
 
-    /**
-     * @deprecated (Aug 2008) use {@link HSSFRow#createCell(int) }
-     */
-    public HSSFCell createCell(short columnIndex) {
-        return createCell((int)columnIndex);
-    }
-    /**
-     * @deprecated (Aug 2008) use {@link HSSFRow#createCell(int, int) }
-     */
-    public HSSFCell createCell(short columnIndex, int type) {
-        return createCell((int)columnIndex, type);
-    }
     /**
      * Use this to create new cells within the row and return it.
      * <p>
@@ -342,14 +330,6 @@ public final class HSSFRow implements Row, Comparable<HSSFRow> {
         return cells[cellIndex];
     }
 
-    /**
-     * @deprecated (Aug 2008) use {@link #getCell(int)}
-     */
-    public HSSFCell getCell(short cellnum) {
-        int ushortCellNum = cellnum & 0x0000FFFF; // avoid sign extension
-        return getCell(ushortCellNum);
-    }
-
     /**
      * Get the hssfcell representing a given column (logical cell)
      *  0-based.  If you ask for a cell that is not defined then
index cfae1e92cf561b41b6f6e823814117ca22f7adf9..20a31e90778fb92832b23d97207cb2b03b0d424d 100644 (file)
@@ -31,6 +31,7 @@ import java.io.PrintWriter;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Hashtable;
@@ -537,14 +538,13 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
         }
         workbook.getWindowOne().setNumSelectedTabs((short)1);
     }
+
     /**
-     * deprecated May 2008
-     * @deprecated use setSelectedTab(int)
+     * Selects multiple sheets as a group. This is distinct from
+     * the 'active' sheet (which is the sheet with focus).
+     *
+     * @param indexes
      */
-    @Deprecated
-       public void setSelectedTab(short index) {
-        setSelectedTab((int)index);
-    }
     public void setSelectedTabs(int[] indexes) {
 
         for (int index : indexes) {
@@ -564,6 +564,24 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
         }
         workbook.getWindowOne().setNumSelectedTabs((short)indexes.length);
     }
+    
+    /**
+     * Gets the selected sheets (if more than one, Excel calls these a [Group]). 
+     *
+     * @return indices of selected sheets
+     */
+    public Collection<Integer> getSelectedTabs() {
+        Collection<Integer> indexes = new ArrayList<Integer>();
+        int nSheets = _sheets.size();
+        for (int i=0; i<nSheets; i++) {
+            HSSFSheet sheet = getSheetAt(i);
+            if (sheet.isSelected()) {
+                indexes.add(i);
+            }
+        }
+        return Collections.unmodifiableCollection(indexes);
+    }
+    
     /**
      * Convenience method to set the active sheet.  The active sheet is is the sheet
      * which is currently displayed when the workbook is viewed in Excel.
@@ -591,14 +609,6 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
     public int getActiveSheetIndex() {
         return workbook.getWindowOne().getActiveSheetIndex();
     }
-    /**
-     * deprecated May 2008
-     * @deprecated - Misleading name - use getActiveSheetIndex()
-     */
-    @Deprecated
-       public short getSelectedTab() {
-        return (short) getActiveSheetIndex();
-    }
 
 
     /**
@@ -612,14 +622,6 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
     public void setFirstVisibleTab(int index) {
         workbook.getWindowOne().setFirstVisibleTab(index);
     }
-    /**
-     * deprecated May 2008
-     * @deprecated - Misleading name - use setFirstVisibleTab()
-     */
-    @Deprecated
-       public void setDisplayedTab(short index) {
-       setFirstVisibleTab(index);
-    }
 
     /**
      * sets the first tab that is displayed in the list of tabs in excel.
@@ -628,14 +630,6 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
     public int getFirstVisibleTab() {
         return workbook.getWindowOne().getFirstVisibleTab();
     }
-    /**
-     * deprecated May 2008
-     * @deprecated - Misleading name - use getFirstVisibleTab()
-     */
-    @Deprecated
-       public short getDisplayedTab() {
-        return (short) getFirstVisibleTab();
-    }
 
     /**
      * Set the sheet name.
@@ -727,42 +721,6 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
         return -1;
     }
 
-    /**
-     * Returns the external sheet index of the sheet
-     *  with the given internal index, creating one
-     *  if needed.
-     * Used by some of the more obscure formula and
-     *  named range things.
-     * @deprecated for POI internal use only (formula parsing).  This method is likely to
-     * be removed in future versions of POI.
-     */
-    @Deprecated
-       public int getExternalSheetIndex(int internalSheetIndex) {
-        return workbook.checkExternSheet(internalSheetIndex);
-    }
-    /**
-     * @deprecated for POI internal use only (formula rendering).  This method is likely to
-     * be removed in future versions of POI.
-     */
-    @Deprecated
-       public String findSheetNameFromExternSheet(int externSheetIndex){
-        // TODO - don't expose internal ugliness like externSheet indexes to the user model API
-        return workbook.findSheetFirstNameFromExternSheet(externSheetIndex);
-    }
-    /**
-     * @deprecated for POI internal use only (formula rendering).  This method is likely to
-     * be removed in future versions of POI.
-     *
-     * @param refIndex Index to REF entry in EXTERNSHEET record in the Link Table
-     * @param definedNameIndex zero-based to DEFINEDNAME or EXTERNALNAME record
-     * @return the string representation of the defined or external name
-     */
-    @Deprecated
-       public String resolveNameXText(int refIndex, int definedNameIndex) {
-        // TODO - make this less cryptic / move elsewhere
-        return workbook.resolveNameXText(refIndex, definedNameIndex);
-    }
-
     /**
      * create an HSSFSheet for this HSSFWorkbook, adds it to the sheets and returns
      * the high level representation.  Use this to create new sheets.
@@ -967,16 +925,6 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
         return _sheets.size();
     }
 
-    /**
-     * @deprecated for POI internal use only (formula parsing).  This method is likely to
-     * be removed in future versions of POI.
-     */
-    @Deprecated
-    public int getSheetIndexFromExternSheetIndex(int externSheetNumber) {
-        // TODO - don't expose internal ugliness like externSheet indexes to the user model API
-        return workbook.getFirstSheetIndexFromExternSheetIndex(externSheetNumber);
-    }
-
     private HSSFSheet[] getSheets() {
         HSSFSheet[] result = new HSSFSheet[_sheets.size()];
         _sheets.toArray(result);
@@ -1431,25 +1379,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
         return retval;
     }
 
-    /** @deprecated Do not call this method from your applications. Use the methods
-     *  available in the HSSFRow to add string HSSFCells
-     */
-    @Deprecated
-       public int addSSTString(String string)
-    {
-        return workbook.addSSTString(new UnicodeString(string));
-    }
-
-    /** @deprecated Do not call this method from your applications. Use the methods
-     *  available in the HSSFRow to get string HSSFCells
-     */
-    @Deprecated
-       public String getSSTString(int index)
-    {
-        return workbook.getSSTString(index).getString();
-    }
-
-    InternalWorkbook getWorkbook() {
+    /*package*/ InternalWorkbook getWorkbook() {
         return workbook;
     }
 
index b326b52a1a280838f78b4d29301133252bc0678b..b6a0e2d0c4ebdcb88512d064eb4587ef54419b09 100644 (file)
@@ -53,13 +53,6 @@ public abstract class EncryptionHeader {
     
     protected EncryptionHeader() {}
 
-    /**
-     * @deprecated use getChainingMode().ecmaId
-     */
-    public int getCipherMode() {
-        return chainingMode.ecmaId;
-    }
-    
     public ChainingMode getChainingMode() {
         return chainingMode;
     }
@@ -84,13 +77,6 @@ public abstract class EncryptionHeader {
         this.sizeExtra = sizeExtra;
     }
 
-    /**
-     * @deprecated use getCipherAlgorithm()
-     */
-    public int getAlgorithm() {
-        return cipherAlgorithm.ecmaId;
-    }
-
     public CipherAlgorithm getCipherAlgorithm() {
         return cipherAlgorithm;
     }
@@ -99,13 +85,6 @@ public abstract class EncryptionHeader {
         this.cipherAlgorithm = cipherAlgorithm;
     }
     
-    /**
-     * @deprecated use getHashAlgorithmEx()
-     */
-    public int getHashAlgorithm() {
-        return hashAlgorithm.ecmaId;
-    }
-    
     public HashAlgorithm getHashAlgorithmEx() {
         return hashAlgorithm;
     }
@@ -138,13 +117,6 @@ public abstract class EncryptionHeader {
         this.keySalt = (salt == null) ? null : salt.clone();
     }
 
-    /**
-     * @deprecated use getCipherProvider()
-     */
-    public int getProviderType() {
-        return providerType.ecmaId;
-    }
-
     public CipherProvider getCipherProvider() {
         return providerType;
     }    
index 6f8c04fd3b6e585c14d709ecaf8b54684fa3dca9..780409e1912beb44cf4dbad9e3cae4adc46c9b57 100644 (file)
@@ -144,78 +144,6 @@ public class EncryptionInfo {
         encryptor = eib.getEncryptor();
     }
     
-    /**
-     * @deprecated Use {@link #EncryptionInfo(EncryptionMode)} (fs parameter no longer required)
-     */
-    @Deprecated
-    public EncryptionInfo(POIFSFileSystem fs, EncryptionMode encryptionMode) {
-        this(encryptionMode);
-    }
-     
-    /**
-     * @deprecated Use {@link #EncryptionInfo(EncryptionMode)} (fs parameter no longer required)
-     */
-    @Deprecated
-    public EncryptionInfo(NPOIFSFileSystem fs, EncryptionMode encryptionMode) {
-        this(encryptionMode);
-    }
-     
-    /**
-     * @deprecated Use {@link #EncryptionInfo(EncryptionMode)} (dir parameter no longer required)
-     */
-    @Deprecated
-    public EncryptionInfo(DirectoryNode dir, EncryptionMode encryptionMode) {
-        this(encryptionMode);
-    }
-    
-    /**
-     * @deprecated use {@link #EncryptionInfo(EncryptionMode, CipherAlgorithm, HashAlgorithm, int, int, ChainingMode)}
-     */
-    @Deprecated
-    public EncryptionInfo(
-        POIFSFileSystem fs
-      , EncryptionMode encryptionMode
-      , CipherAlgorithm cipherAlgorithm
-      , HashAlgorithm hashAlgorithm
-      , int keyBits
-      , int blockSize
-      , ChainingMode chainingMode
-    ) {
-        this(encryptionMode, cipherAlgorithm, hashAlgorithm, keyBits, blockSize, chainingMode);
-    }
-    
-    /**
-     * @deprecated use {@link #EncryptionInfo(EncryptionMode, CipherAlgorithm, HashAlgorithm, int, int, ChainingMode)}
-     */
-    @Deprecated
-    public EncryptionInfo(
-        NPOIFSFileSystem fs
-      , EncryptionMode encryptionMode
-      , CipherAlgorithm cipherAlgorithm
-      , HashAlgorithm hashAlgorithm
-      , int keyBits
-      , int blockSize
-      , ChainingMode chainingMode
-    ) {
-        this(encryptionMode, cipherAlgorithm, hashAlgorithm, keyBits, blockSize, chainingMode);
-    }
-        
-    /**
-     * @deprecated use {@link #EncryptionInfo(EncryptionMode, CipherAlgorithm, HashAlgorithm, int, int, ChainingMode)}
-     */
-    @Deprecated
-    public EncryptionInfo(
-          DirectoryNode dir
-        , EncryptionMode encryptionMode
-        , CipherAlgorithm cipherAlgorithm
-        , HashAlgorithm hashAlgorithm
-        , int keyBits
-        , int blockSize
-        , ChainingMode chainingMode
-    ) {
-        this(encryptionMode, cipherAlgorithm, hashAlgorithm, keyBits, blockSize, chainingMode);
-    }        
-
     /**
      * Prepares for encryption, using the given Encryption Mode, and
      *  all other parameters as default.
index a782063e774eae558a62cae7a4e081f0f1fa8f99..2688b50f41bfef7229f75ddddee7b3839276cc1c 100644 (file)
@@ -37,28 +37,10 @@ public abstract class EncryptionVerifier {
         return salt;
     }
 
-    /**
-     * The method name is misleading - you'll get the encrypted verifier, not the plain verifier
-     * @deprecated use getEncryptedVerifier()
-     */
-    @Deprecated
-    public byte[] getVerifier() {
-        return encryptedVerifier;
-    }
-
     public byte[] getEncryptedVerifier() {
         return encryptedVerifier;
     }    
     
-    /**
-     * The method name is misleading - you'll get the encrypted verifier hash, not the plain verifier hash
-     * @deprecated use getEnryptedVerifierHash
-     */
-    @Deprecated
-    public byte[] getVerifierHash() {
-        return encryptedVerifierHash;
-    }
-
     public byte[] getEncryptedVerifierHash() {
         return encryptedVerifierHash;
     }    
@@ -75,14 +57,6 @@ public abstract class EncryptionVerifier {
         return cipherAlgorithm.ecmaId;
     }
 
-    /**
-     * @deprecated use getCipherAlgorithm().jceId
-     */
-    @Deprecated
-    public String getAlgorithmName() {
-        return cipherAlgorithm.jceId;
-    }
-
     public byte[] getEncryptedKey() {
         return encryptedKey;
     }
index d8a55563a2f6b74461d6215357128cc8d4782d53..5f473dbe1e9d070cc49d4d492cecd2981e3101ff 100644 (file)
@@ -99,7 +99,7 @@ public class EntryUtils
      *            is the target Directory to copy to
      * @param excepts
      *            is a list of Strings specifying what nodes NOT to copy
-     * @deprecated use {@link FilteringDirectoryNode} instead
+     * @deprecated POI 3.8 beta 5. Use {@link FilteringDirectoryNode} instead
      */
     public static void copyNodes( DirectoryEntry sourceRoot,
             DirectoryEntry targetRoot, List<String> excepts )
index 99b7ab39313c7ee3f2bdcf10519fb0b381585724..11f18a40a69b291e562e7b080ac41a9167b1779f 100644 (file)
@@ -114,20 +114,6 @@ public class Ole10Native {
        setDataBuffer(data);\r
        mode = EncodingMode.parsed;\r
     }\r
-\r
-    /**\r
-     * Creates an instance and fills the fields based on the data in the given buffer.\r
-     *\r
-     * @param data   The buffer containing the Ole10Native record\r
-     * @param offset The start offset of the record in the buffer\r
-     * @param plain as of POI 3.11 this parameter is ignored\r
-     * @throws Ole10NativeException on invalid or unexcepted data format\r
-     * \r
-     * @deprecated parameter plain is ignored, use {@link #Ole10Native(byte[],int)}\r
-     */\r
-    public Ole10Native(byte[] data, int offset, boolean plain) throws Ole10NativeException {\r
-        this(data, offset);\r
-    }\r
     \r
     /**\r
      * Creates an instance and fills the fields based on the data in the given buffer.\r
index a483992f92384cb29180ffc8877e083fe28c219e..e0b5e19f93d8d97a8b05c0036e0197367ff222a3 100644 (file)
@@ -35,10 +35,6 @@ final class LazyRefEval extends RefEvalBase {
                _evaluator = sre;
        }
 
-       @Deprecated
-    public ValueEval getInnerValueEval() {
-        return getInnerValueEval(_evaluator.getFirstSheetIndex());
-    }
        public ValueEval getInnerValueEval(int sheetIndex) {
                return _evaluator.getEvalForCell(sheetIndex, getRow(), getColumn());
        }
index b49b2992ab9b148fe14585ef373bdc131640e176..845e7deaabfba9ed9f2e4874d5b32c95aae42e7e 100644 (file)
@@ -24,10 +24,6 @@ package org.apache.poi.ss.formula.eval;
 public final class BlankEval implements ValueEval {
 
        public static final BlankEval instance = new BlankEval();
-       /**
-        * @deprecated (Nov 2009) use {@link #instance}
-        */
-       public static final BlankEval INSTANCE = instance;
 
        private BlankEval() {
                // enforce singleton
index 199e45e35189e680fd592b3e2c711fbdc45ca6a4..28f5d2258b75a320ad767201de485388cc2aa6c6 100644 (file)
 \r
 package org.apache.poi.ss.usermodel;\r
 \r
-import static org.apache.poi.ss.usermodel.ConditionType.*;\r
-\r
 /**\r
  * Represents a description of a conditional formatting rule\r
  */\r
 public interface ConditionalFormattingRule {\r
-    /**\r
-     * This conditional formatting rule compares a cell value\r
-     * to a formula calculated result, using an operator\r
-     * @deprecated Use {@link ConditionType#CELL_VALUE_IS}\r
-     */\r
-    public static final byte CONDITION_TYPE_CELL_VALUE_IS = CELL_VALUE_IS.id;\r
-\r
-    /**\r
-     *  This conditional formatting rule contains a formula to evaluate.\r
-     *  When the formula result is true, the cell is highlighted.\r
-     * @deprecated Use {@link ConditionType#FORMULA}\r
-     */\r
-    public static final byte CONDITION_TYPE_FORMULA = FORMULA.id;\r
-\r
     /**\r
      * Create a new border formatting structure if it does not exist,\r
      * otherwise just return existing object.\r
@@ -93,27 +77,16 @@ public interface ConditionalFormattingRule {
      */\r
     ColorScaleFormatting getColorScaleFormatting();\r
     \r
-    /**\r
-     * Type of conditional formatting rule.\r
-     * <p>\r
-     * MUST be one of the IDs of a {@link ConditionType}\r
-     * </p>\r
-     *\r
-     * @return the type of condition\r
-     * @deprecated Use {@link #getConditionTypeType()}\r
-     */\r
-    byte getConditionType();\r
-    \r
     /**\r
      * Type of conditional formatting rule.\r
      *\r
      * @return the type of condition\r
      */\r
-    ConditionType getConditionTypeType();\r
+    ConditionType getConditionType();\r
 \r
     /**\r
      * The comparison function used when the type of conditional formatting is set to\r
-     * {@link #CONDITION_TYPE_CELL_VALUE_IS}\r
+     * {@link ConditionType#CELL_VALUE_IS}\r
      * <p>\r
      *     MUST be a constant from {@link ComparisonOperator}\r
      * </p>\r
@@ -125,13 +98,13 @@ public interface ConditionalFormattingRule {
     /**\r
      * The formula used to evaluate the first operand for the conditional formatting rule.\r
      * <p>\r
-     * If the condition type is {@link #CONDITION_TYPE_CELL_VALUE_IS},\r
+     * If the condition type is {@link ConditionType#CELL_VALUE_IS},\r
      * this field is the first operand of the comparison.\r
-     * If type is {@link #CONDITION_TYPE_FORMULA}, this formula is used\r
+     * If type is {@link ConditionType#FORMULA}, this formula is used\r
      * to determine if the conditional formatting is applied.\r
      * </p>\r
      * <p>\r
-     * If comparison type is {@link #CONDITION_TYPE_FORMULA} the formula MUST be a Boolean function\r
+     * If comparison type is {@link ConditionType#FORMULA} the formula MUST be a Boolean function\r
      * </p>\r
      *\r
      * @return  the first formula\r
@@ -140,7 +113,7 @@ public interface ConditionalFormattingRule {
 \r
     /**\r
      * The formula used to evaluate the second operand of the comparison when\r
-     * comparison type is  {@link #CONDITION_TYPE_CELL_VALUE_IS} and operator\r
+     * comparison type is  {@link ConditionType#CELL_VALUE_IS} and operator\r
      * is either {@link ComparisonOperator#BETWEEN} or {@link ComparisonOperator#NOT_BETWEEN}\r
      *\r
      * @return  the second formula\r
index 1f40cf693d6b4f1bd02ea7783d183f5e6ddd02c1..df8533f312ae24cad9c97977ef0c0074f9624faf 100644 (file)
@@ -53,14 +53,6 @@ public class CellRangeAddress extends CellRangeAddressBase {
                    throw new IllegalArgumentException("lastRow < firstRow || lastCol < firstCol");
        }
 
-       /**
-        * @deprecated use {@link #serialize(LittleEndianOutput)}
-        */
-       @Deprecated
-    public int serialize(int offset, byte[] data) {
-               serialize(new LittleEndianByteArrayOutputStream(data, offset, ENCODED_SIZE));
-               return ENCODED_SIZE;
-       }
        public void serialize(LittleEndianOutput out) {
                out.writeShort(getFirstRow());
                out.writeShort(getLastRow());
index dc2e6f62988b0d095afb6a043db5b479d7e540c9..a639f2c2713154fb10dafaf53ee4824540beba23 100644 (file)
@@ -295,36 +295,24 @@ public class XSSFConditionalFormattingRule implements ConditionalFormattingRule
         }\r
     }\r
 \r
-    /**\r
-     * Type of conditional formatting rule.\r
-     * <p>\r
-     * MUST be one of the IDs of a {@link ConditionType}\r
-     * </p>\r
-     *\r
-     * @return the type of condition\r
-     */\r
-    public byte getConditionType(){\r
-        ConditionType type = getConditionTypeType();\r
-        if (type != null) return type.id;\r
-        return 0;\r
-    }\r
-    \r
     /**\r
      * Type of conditional formatting rule.\r
      */\r
-    public ConditionType getConditionTypeType() {\r
+    @Override\r
+    public ConditionType getConditionType() {\r
         return typeLookup.get(_cfRule.getType());\r
     }\r
 \r
     /**\r
      * The comparison function used when the type of conditional formatting is set to\r
-     * {@link ConditionalFormattingRule#CONDITION_TYPE_CELL_VALUE_IS}\r
+     * {@link ConditionType#CELL_VALUE_IS}\r
      * <p>\r
      *     MUST be a constant from {@link org.apache.poi.ss.usermodel.ComparisonOperator}\r
      * </p>\r
      *\r
      * @return the conditional format operator\r
      */\r
+    @Override\r
     public byte getComparisonOperation(){\r
         STConditionalFormattingOperator.Enum op = _cfRule.getOperator();\r
         if(op == null) return ComparisonOperator.NO_COMPARISON;\r
@@ -345,13 +333,13 @@ public class XSSFConditionalFormattingRule implements ConditionalFormattingRule
     /**\r
      * The formula used to evaluate the first operand for the conditional formatting rule.\r
      * <p>\r
-     * If the condition type is {@link ConditionalFormattingRule#CONDITION_TYPE_CELL_VALUE_IS},\r
+     * If the condition type is {@link ConditionType#CELL_VALUE_IS},\r
      * this field is the first operand of the comparison.\r
-     * If type is {@link ConditionalFormattingRule#CONDITION_TYPE_FORMULA}, this formula is used\r
+     * If type is {@link ConditionType#FORMULA}, this formula is used\r
      * to determine if the conditional formatting is applied.\r
      * </p>\r
      * <p>\r
-     * If comparison type is {@link ConditionalFormattingRule#CONDITION_TYPE_FORMULA} the formula MUST be a Boolean function\r
+     * If comparison type is {@link ConditionType#FORMULA} the formula MUST be a Boolean function\r
      * </p>\r
      *\r
      * @return  the first formula\r
@@ -362,7 +350,7 @@ public class XSSFConditionalFormattingRule implements ConditionalFormattingRule
 \r
     /**\r
      * The formula used to evaluate the second operand of the comparison when\r
-     * comparison type is  {@link ConditionalFormattingRule#CONDITION_TYPE_CELL_VALUE_IS} and operator\r
+     * comparison type is  {@link ConditionType#CELL_VALUE_IS} and operator\r
      * is either {@link org.apache.poi.ss.usermodel.ComparisonOperator#BETWEEN} or {@link org.apache.poi.ss.usermodel.ComparisonOperator#NOT_BETWEEN}\r
      *\r
      * @return  the second formula\r
index 589821ea0c88f1925f98b6102c0e74c93f404bd8..d48fb0da389f9bf226f3d550406d2ce312575d41 100644 (file)
@@ -161,7 +161,7 @@ public class TestCertificateEncryption {
     @Test\r
     public void testCertificateEncryption() throws Exception {\r
         POIFSFileSystem fs = new POIFSFileSystem();\r
-        EncryptionInfo info = new EncryptionInfo(fs, EncryptionMode.agile, CipherAlgorithm.aes128, HashAlgorithm.sha1, -1, -1, ChainingMode.cbc);\r
+        EncryptionInfo info = new EncryptionInfo(EncryptionMode.agile, CipherAlgorithm.aes128, HashAlgorithm.sha1, -1, -1, ChainingMode.cbc);\r
         AgileEncryptionVerifier aev = (AgileEncryptionVerifier)info.getVerifier();\r
         CertData certData = loadKeystore();\r
         aev.addCertificate(certData.x509);\r
index 0cde3e47d157d2aee5cee6423f96ccb5d460855c..e6a3167913eb7bda47bd134dda7af1e2bdafe91f 100644 (file)
@@ -33,7 +33,6 @@ public final class TestDrawingRecord extends TestCase {
      * Check that RecordFactoryInputStream properly handles continued DrawingRecords
      * See Bugzilla #47548
      */
-    @SuppressWarnings("deprecation")
     public void testReadContinued() throws IOException {
 
         //simulate a continues drawing record
@@ -56,7 +55,7 @@ public final class TestDrawingRecord extends TestCase {
         assertTrue(rec.get(0) instanceof DrawingRecord);
         assertTrue(rec.get(1) instanceof ContinueRecord);
 
-        assertArrayEquals(data1, ((DrawingRecord)rec.get(0)).getData());
+        assertArrayEquals(data1, ((DrawingRecord)rec.get(0)).getRecordData());
         assertArrayEquals(data2, ((ContinueRecord)rec.get(1)).getData());
 
     }
index 2bdc7f051ba7aa8abfaec13420d92057b5e0bbcf..7403c0c1bfe54bc30b5bfc9f512f380899718b22 100644 (file)
@@ -22,6 +22,7 @@ import static org.junit.Assert.*;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.zip.CRC32;
 
@@ -49,12 +50,19 @@ import junit.framework.AssertionFailedError;
 public final class TestValueRecordsAggregate {
        private static final String ABNORMAL_SHARED_FORMULA_FLAG_TEST_FILE = "AbnormalSharedFormulaFlag.xls";
        private final ValueRecordsAggregate valueRecord = new ValueRecordsAggregate();
+       
+       private List<CellValueRecordInterface> getValueRecords() {
+           List<CellValueRecordInterface> list = new ArrayList<CellValueRecordInterface>();
+           for ( CellValueRecordInterface rec : valueRecord ) {
+               list.add(rec);
+           }
+           return Collections.unmodifiableList(list);
+       }
 
        /**
         * Make sure the shared formula DOESNT makes it to the FormulaRecordAggregate when being parsed
         * as part of the value records
         */
-    @SuppressWarnings("deprecation") // uses deprecated {@link ValueRecordsAggregate#getValueRecords()}
     @Test
        public void testSharedFormula() {
                List<Record> records = new ArrayList<Record>();
@@ -63,11 +71,11 @@ public final class TestValueRecordsAggregate {
                records.add(new WindowTwoRecord());
 
                constructValueRecord(records);
-               CellValueRecordInterface[] cvrs = valueRecord.getValueRecords();
+               List<CellValueRecordInterface> cvrs = getValueRecords();
                //Ensure that the SharedFormulaRecord has been converted
-               assertEquals(1, cvrs.length);
+               assertEquals(1, cvrs.size());
 
-               CellValueRecordInterface record = cvrs[0];
+               CellValueRecordInterface record = cvrs.get(0);
                assertNotNull( "Row contains a value", record );
                assertTrue( "First record is a FormulaRecordsAggregate", ( record instanceof FormulaRecordAggregate ) );
        }
@@ -96,27 +104,22 @@ public final class TestValueRecordsAggregate {
                return records;
        }
 
-    @SuppressWarnings("deprecation") // uses deprecated {@link ValueRecordsAggregate#getValueRecords()}
     @Test
        public void testInsertCell() {
-               CellValueRecordInterface[] cvrs = valueRecord.getValueRecords();
-               assertEquals(0, cvrs.length);
+               assertEquals(0, getValueRecords().size());
 
                BlankRecord blankRecord = newBlankRecord();
                valueRecord.insertCell( blankRecord );
-               cvrs = valueRecord.getValueRecords();
-               assertEquals(1, cvrs.length);
+               assertEquals(1, getValueRecords().size());
        }
 
-    @SuppressWarnings("deprecation") // uses deprecated {@link ValueRecordsAggregate#getValueRecords()}
     @Test
     public void testRemoveCell() {
                BlankRecord blankRecord1 = newBlankRecord();
                valueRecord.insertCell( blankRecord1 );
                BlankRecord blankRecord2 = newBlankRecord();
                valueRecord.removeCell( blankRecord2 );
-               CellValueRecordInterface[] cvrs = valueRecord.getValueRecords();
-               assertEquals(0, cvrs.length);
+               assertEquals(0, getValueRecords().size());
 
                // removing an already empty cell just falls through
                valueRecord.removeCell( blankRecord2 );
index 65a6422cf7f142a5d336dafd136309b042b29b28..d8fcf6bcca70f382b7d8f1cd5ca2f58eaaabbb97 100644 (file)
@@ -182,7 +182,6 @@ public final class TestHSSFWorkbook extends BaseTestWorkbook {
         b6.close();
     }
 
-    @SuppressWarnings("deprecation")
     @Test
     public void selectedSheet_bug44523() throws IOException {
         HSSFWorkbook wb=new HSSFWorkbook();
@@ -198,9 +197,6 @@ public final class TestHSSFWorkbook extends BaseTestWorkbook {
 
         wb.setSelectedTab(1);
 
-        // see Javadoc, in this case selected means "active"
-        assertEquals(wb.getActiveSheetIndex(), wb.getSelectedTab());
-
         // Demonstrate bug 44525:
         // Well... not quite, since isActive + isSelected were also added in the same bug fix
         assertFalse("Identified bug 44523 a", sheet1.isSelected());
@@ -833,7 +829,6 @@ public final class TestHSSFWorkbook extends BaseTestWorkbook {
         }
     }
 
-    @SuppressWarnings("deprecation")
     @Test
     public void selectedSheetShort() throws IOException {
         HSSFWorkbook wb=new HSSFWorkbook();
@@ -850,9 +845,6 @@ public final class TestHSSFWorkbook extends BaseTestWorkbook {
 
         wb.setSelectedTab((short)1);
 
-        // see Javadoc, in this case selected means "active"
-        assertEquals(wb.getActiveSheetIndex(), wb.getSelectedTab());
-
         // Demonstrate bug 44525:
         // Well... not quite, since isActive + isSelected were also added in the same bug fix
         assertFalse("Identified bug 44523 a", sheet1.isSelected());
@@ -865,44 +857,9 @@ public final class TestHSSFWorkbook extends BaseTestWorkbook {
         confirmActiveSelected(sheet4, false);
 
         assertEquals(0, wb.getFirstVisibleTab());
-        wb.setDisplayedTab((short)2);
+        wb.setFirstVisibleTab((short)2);
         assertEquals(2, wb.getFirstVisibleTab());
-        assertEquals(2, wb.getDisplayedTab());
-
-        wb.close();
-    }
-
-    @SuppressWarnings("deprecation")
-    @Test
-    public void getExternSheetIndex() throws IOException {
-        HSSFWorkbook wb=new HSSFWorkbook();
-        wb.createSheet("Sheet1");
-        wb.createSheet("Sheet2");
-
-        assertEquals(0, wb.getExternalSheetIndex(0));
-        assertEquals(1, wb.getExternalSheetIndex(1));
 
-        assertEquals("Sheet1", wb.findSheetNameFromExternSheet(0));
-        assertEquals("Sheet2", wb.findSheetNameFromExternSheet(1));
-        //assertEquals(null, wb.findSheetNameFromExternSheet(2));
-
-        assertEquals(0, wb.getSheetIndexFromExternSheetIndex(0));
-        assertEquals(1, wb.getSheetIndexFromExternSheetIndex(1));
-        assertEquals(-1, wb.getSheetIndexFromExternSheetIndex(2));
-        assertEquals(-1, wb.getSheetIndexFromExternSheetIndex(100));
-        
-        wb.close();
-    }
-
-    @SuppressWarnings("deprecation")
-    @Test
-    public void sstString() throws IOException {
-        HSSFWorkbook wb=new HSSFWorkbook();
-
-        int sst = wb.addSSTString("somestring");
-        assertEquals("somestring", wb.getSSTString(sst));
-        //assertNull(wb.getSSTString(sst+1));
-        
         wb.close();
     }
 
index 72691ff69fc97ee66f9103685d9569d18d1f0b62..5509cbf71a6af2bd6826f080c605c6bc2e9eba67 100644 (file)
@@ -112,15 +112,13 @@ public abstract class BaseTestConditionalFormatting {
      * Test format conditions based on a boolean formula\r
      */\r
     @Test\r
-    @SuppressWarnings("deprecation")\r
     public void testBooleanFormulaConditions() throws IOException {\r
         Workbook wb = _testDataProvider.createWorkbook();\r
         Sheet sh = wb.createSheet();\r
         SheetConditionalFormatting sheetCF = sh.getSheetConditionalFormatting();\r
 \r
         ConditionalFormattingRule rule1 = sheetCF.createConditionalFormattingRule("SUM(A1:A5)>10");\r
-        assertEquals(ConditionType.FORMULA.id, rule1.getConditionType());\r
-        assertEquals(ConditionType.FORMULA, rule1.getConditionTypeType());\r
+        assertEquals(ConditionType.FORMULA, rule1.getConditionType());\r
         assertEquals("SUM(A1:A5)>10", rule1.getFormula1());\r
         int formatIndex1 = sheetCF.addConditionalFormatting(\r
                 new CellRangeAddress[]{\r
@@ -150,7 +148,6 @@ public abstract class BaseTestConditionalFormatting {
     }\r
 \r
     @Test\r
-    @SuppressWarnings("deprecation")\r
     public void testSingleFormulaConditions() throws IOException {\r
         Workbook wb = _testDataProvider.createWorkbook();\r
         Sheet sh = wb.createSheet();\r
@@ -158,65 +155,56 @@ public abstract class BaseTestConditionalFormatting {
 \r
         ConditionalFormattingRule rule1 = sheetCF.createConditionalFormattingRule(\r
                 ComparisonOperator.EQUAL, "SUM(A1:A5)+10");\r
-        assertEquals(ConditionType.CELL_VALUE_IS.id, rule1.getConditionType());\r
-        assertEquals(ConditionType.CELL_VALUE_IS, rule1.getConditionTypeType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, rule1.getConditionType());\r
         assertEquals("SUM(A1:A5)+10", rule1.getFormula1());\r
         assertEquals(ComparisonOperator.EQUAL, rule1.getComparisonOperation());\r
 \r
         ConditionalFormattingRule rule2 = sheetCF.createConditionalFormattingRule(\r
                 ComparisonOperator.NOT_EQUAL, "15");\r
-        assertEquals(ConditionType.CELL_VALUE_IS.id, rule2.getConditionType());\r
-        assertEquals(ConditionType.CELL_VALUE_IS, rule2.getConditionTypeType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, rule2.getConditionType());\r
         assertEquals("15", rule2.getFormula1());\r
         assertEquals(ComparisonOperator.NOT_EQUAL, rule2.getComparisonOperation());\r
 \r
         ConditionalFormattingRule rule3 = sheetCF.createConditionalFormattingRule(\r
                 ComparisonOperator.NOT_EQUAL, "15");\r
-        assertEquals(ConditionType.CELL_VALUE_IS.id, rule3.getConditionType());\r
-        assertEquals(ConditionType.CELL_VALUE_IS, rule3.getConditionTypeType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, rule3.getConditionType());\r
         assertEquals("15", rule3.getFormula1());\r
         assertEquals(ComparisonOperator.NOT_EQUAL, rule3.getComparisonOperation());\r
 \r
         ConditionalFormattingRule rule4 = sheetCF.createConditionalFormattingRule(\r
                 ComparisonOperator.GT, "0");\r
-        assertEquals(ConditionType.CELL_VALUE_IS.id, rule4.getConditionType());\r
-        assertEquals(ConditionType.CELL_VALUE_IS, rule4.getConditionTypeType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, rule4.getConditionType());\r
         assertEquals("0", rule4.getFormula1());\r
         assertEquals(ComparisonOperator.GT, rule4.getComparisonOperation());\r
 \r
         ConditionalFormattingRule rule5 = sheetCF.createConditionalFormattingRule(\r
                 ComparisonOperator.LT, "0");\r
-        assertEquals(ConditionType.CELL_VALUE_IS.id, rule5.getConditionType());\r
-        assertEquals(ConditionType.CELL_VALUE_IS, rule5.getConditionTypeType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, rule5.getConditionType());\r
         assertEquals("0", rule5.getFormula1());\r
         assertEquals(ComparisonOperator.LT, rule5.getComparisonOperation());\r
 \r
         ConditionalFormattingRule rule6 = sheetCF.createConditionalFormattingRule(\r
                 ComparisonOperator.GE, "0");\r
-        assertEquals(ConditionType.CELL_VALUE_IS.id, rule6.getConditionType());\r
-        assertEquals(ConditionType.CELL_VALUE_IS, rule6.getConditionTypeType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, rule6.getConditionType());\r
         assertEquals("0", rule6.getFormula1());\r
         assertEquals(ComparisonOperator.GE, rule6.getComparisonOperation());\r
 \r
         ConditionalFormattingRule rule7 = sheetCF.createConditionalFormattingRule(\r
                 ComparisonOperator.LE, "0");\r
-        assertEquals(ConditionType.CELL_VALUE_IS.id, rule7.getConditionType());\r
-        assertEquals(ConditionType.CELL_VALUE_IS, rule7.getConditionTypeType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, rule7.getConditionType());\r
         assertEquals("0", rule7.getFormula1());\r
         assertEquals(ComparisonOperator.LE, rule7.getComparisonOperation());\r
 \r
         ConditionalFormattingRule rule8 = sheetCF.createConditionalFormattingRule(\r
                 ComparisonOperator.BETWEEN, "0", "5");\r
-        assertEquals(ConditionType.CELL_VALUE_IS.id, rule8.getConditionType());\r
-        assertEquals(ConditionType.CELL_VALUE_IS, rule8.getConditionTypeType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, rule8.getConditionType());\r
         assertEquals("0", rule8.getFormula1());\r
         assertEquals("5", rule8.getFormula2());\r
         assertEquals(ComparisonOperator.BETWEEN, rule8.getComparisonOperation());\r
 \r
         ConditionalFormattingRule rule9 = sheetCF.createConditionalFormattingRule(\r
                 ComparisonOperator.NOT_BETWEEN, "0", "5");\r
-        assertEquals(ConditionType.CELL_VALUE_IS.id, rule9.getConditionType());\r
-        assertEquals(ConditionType.CELL_VALUE_IS, rule9.getConditionTypeType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, rule9.getConditionType());\r
         assertEquals("0", rule9.getFormula1());\r
         assertEquals("5", rule9.getFormula2());\r
         assertEquals(ComparisonOperator.NOT_BETWEEN, rule9.getComparisonOperation());\r
@@ -225,7 +213,6 @@ public abstract class BaseTestConditionalFormatting {
     }\r
 \r
     @Test\r
-    @SuppressWarnings("deprecation")\r
     public void testCopy() throws IOException {\r
         Workbook wb = _testDataProvider.createWorkbook();\r
         Sheet sheet1 = wb.createSheet();\r
@@ -258,10 +245,10 @@ public abstract class BaseTestConditionalFormatting {
         assertEquals(2, sheet2cf.getNumberOfRules());\r
         assertEquals("SUM(A1:A5)+10", sheet2cf.getRule(0).getFormula1());\r
         assertEquals(ComparisonOperator.EQUAL, sheet2cf.getRule(0).getComparisonOperation());\r
-        assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, sheet2cf.getRule(0).getConditionType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, sheet2cf.getRule(0).getConditionType());\r
         assertEquals("15", sheet2cf.getRule(1).getFormula1());\r
         assertEquals(ComparisonOperator.NOT_EQUAL, sheet2cf.getRule(1).getComparisonOperation());\r
-        assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, sheet2cf.getRule(1).getConditionType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, sheet2cf.getRule(1).getConditionType());\r
         \r
         wb.close();\r
     }\r
@@ -504,7 +491,7 @@ public abstract class BaseTestConditionalFormatting {
 \r
         // CF1 has two rules: values less than -3 are bold-italic red, values greater than 3 are green\r
         ConditionalFormattingRule rule1 = cf1.getRule(0);\r
-        assertEquals(ConditionType.CELL_VALUE_IS, rule1.getConditionTypeType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, rule1.getConditionType());\r
         assertEquals(ComparisonOperator.GT, rule1.getComparisonOperation());\r
         assertEquals("3", rule1.getFormula1());\r
         assertNull(rule1.getFormula2());\r
@@ -518,7 +505,7 @@ public abstract class BaseTestConditionalFormatting {
         assertFalse(fmt1.isItalic());\r
 \r
         ConditionalFormattingRule rule2 = cf1.getRule(1);\r
-        assertEquals(ConditionType.CELL_VALUE_IS, rule2.getConditionTypeType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, rule2.getConditionType());\r
         assertEquals(ComparisonOperator.LT, rule2.getComparisonOperation());\r
         assertEquals("-3", rule2.getFormula1());\r
         assertNull(rule2.getFormula2());\r
@@ -538,7 +525,7 @@ public abstract class BaseTestConditionalFormatting {
         assertEquals("B9", regions2[0].formatAsString());\r
 \r
         ConditionalFormattingRule rule3 = cf2.getRule(0);\r
-        assertEquals(ConditionType.FORMULA, rule3.getConditionTypeType());\r
+        assertEquals(ConditionType.FORMULA, rule3.getConditionType());\r
         assertEquals(ComparisonOperator.NO_COMPARISON, rule3.getComparisonOperation());\r
         assertEquals("$A$8>5", rule3.getFormula1());\r
         assertNull(rule3.getFormula2());\r
@@ -562,13 +549,13 @@ public abstract class BaseTestConditionalFormatting {
         assertEquals(2, cf3.getNumberOfRules());\r
 \r
         ConditionalFormattingRule rule4 = cf3.getRule(0);\r
-        assertEquals(ConditionType.CELL_VALUE_IS, rule4.getConditionTypeType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, rule4.getConditionType());\r
         assertEquals(ComparisonOperator.LE, rule4.getComparisonOperation());\r
         assertEquals("\"AAA\"", rule4.getFormula1());\r
         assertNull(rule4.getFormula2());\r
 \r
         ConditionalFormattingRule rule5 = cf3.getRule(1);\r
-        assertEquals(ConditionType.CELL_VALUE_IS, rule5.getConditionTypeType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, rule5.getConditionType());\r
         assertEquals(ComparisonOperator.BETWEEN, rule5.getComparisonOperation());\r
         assertEquals("\"A\"", rule5.getFormula1());\r
         assertEquals("\"AAA\"", rule5.getFormula2());\r
@@ -603,7 +590,7 @@ public abstract class BaseTestConditionalFormatting {
                 if (str.contains("[CF12]")) fCF12++;\r
                 if (str.contains("[CFEX]")) fCFEX++;\r
             } else {\r
-                ConditionType type = cf.getRule(cf.getNumberOfRules()-1).getConditionTypeType();\r
+                ConditionType type = cf.getRule(cf.getNumberOfRules()-1).getConditionType();\r
                 if (type == ConditionType.CELL_VALUE_IS ||\r
                     type == ConditionType.FORMULA) {\r
                     fCF++;\r
@@ -628,7 +615,7 @@ public abstract class BaseTestConditionalFormatting {
         \r
         assertEquals(1, cf.getNumberOfRules());\r
         cr = cf.getRule(0);\r
-        assertEquals(ConditionType.CELL_VALUE_IS, cr.getConditionTypeType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, cr.getConditionType());\r
         assertEquals(ComparisonOperator.GT, cr.getComparisonOperation());\r
         assertEquals("0", cr.getFormula1());\r
         assertEquals(null, cr.getFormula2());\r
@@ -652,7 +639,7 @@ public abstract class BaseTestConditionalFormatting {
         \r
         assertEquals(1, cf.getNumberOfRules());\r
         cr = cf.getRule(0);\r
-        assertEquals(ConditionType.CELL_VALUE_IS, cr.getConditionTypeType());\r
+        assertEquals(ConditionType.CELL_VALUE_IS, cr.getConditionType());\r
         assertEquals(ComparisonOperator.BETWEEN, cr.getComparisonOperation());\r
         assertEquals("10", cr.getFormula1());\r
         assertEquals("30", cr.getFormula2());\r
@@ -787,7 +774,7 @@ public abstract class BaseTestConditionalFormatting {
 //        cr = cf.getRule(0);\r
 //        assertIconSetPercentages(cr, IconSet.GYR_3_TRAFFIC_LIGHTS_BOX, 0d, 33d, 67d);\r
 //        cr = cf.getRule(1);\r
-//        assertEquals(ConditionType.FORMULA, cr.getConditionTypeType());\r
+//        assertEquals(ConditionType.FORMULA, cr.getConditionType());\r
 //        assertEquals(ComparisonOperator.NO_COMPARISON, cr.getComparisonOperation());\r
 //        // TODO Why aren't these two the same between formats?\r
 //        if (cr instanceof HSSFConditionalFormattingRule) {\r
@@ -810,7 +797,7 @@ public abstract class BaseTestConditionalFormatting {
         assertDataBar(cr, color);\r
     }\r
     private void assertDataBar(ConditionalFormattingRule cr, String color) {\r
-        assertEquals(ConditionType.DATA_BAR, cr.getConditionTypeType());\r
+        assertEquals(ConditionType.DATA_BAR, cr.getConditionType());\r
         assertEquals(ComparisonOperator.NO_COMPARISON, cr.getComparisonOperation());\r
         assertEquals(null, cr.getFormula1());\r
         assertEquals(null, cr.getFormula2());\r
@@ -841,7 +828,7 @@ public abstract class BaseTestConditionalFormatting {
         assertIconSetPercentages(cr, iconset, vals);\r
     }        \r
     private void assertIconSetPercentages(ConditionalFormattingRule cr, IconSet iconset, Double...vals) {\r
-        assertEquals(ConditionType.ICON_SET, cr.getConditionTypeType());\r
+        assertEquals(ConditionType.ICON_SET, cr.getConditionType());\r
         assertEquals(ComparisonOperator.NO_COMPARISON, cr.getComparisonOperation());\r
         assertEquals(null, cr.getFormula1());\r
         assertEquals(null, cr.getFormula2());\r
@@ -869,7 +856,7 @@ public abstract class BaseTestConditionalFormatting {
         assertColorScale(cr, colors);\r
     }        \r
     private void assertColorScale(ConditionalFormattingRule cr, String... colors) {\r
-        assertEquals(ConditionType.COLOR_SCALE, cr.getConditionTypeType());\r
+        assertEquals(ConditionType.COLOR_SCALE, cr.getConditionType());\r
         assertEquals(ComparisonOperator.NO_COMPARISON, cr.getComparisonOperation());\r
         assertEquals(null, cr.getFormula1());\r
         assertEquals(null, cr.getFormula2());\r
@@ -1152,7 +1139,7 @@ public abstract class BaseTestConditionalFormatting {
         ConditionalFormatting cf = sheetCF.getConditionalFormattingAt(0);\r
         assertEquals(1, cf.getNumberOfRules());\r
         rule1 = cf.getRule(0);\r
-        assertEquals(ConditionType.ICON_SET, rule1.getConditionTypeType());\r
+        assertEquals(ConditionType.ICON_SET, rule1.getConditionType());\r
         iconFmt = rule1.getMultiStateFormatting();\r
         \r
         assertEquals(IconSet.GYRB_4_TRAFFIC_LIGHTS, iconFmt.getIconSet());\r
@@ -1205,7 +1192,7 @@ public abstract class BaseTestConditionalFormatting {
         assertEquals(1, cf.getNumberOfRules());\r
         rule1 = cf.getRule(0);\r
         clrFmt = rule1.getColorScaleFormatting();\r
-        assertEquals(ConditionType.COLOR_SCALE, rule1.getConditionTypeType());\r
+        assertEquals(ConditionType.COLOR_SCALE, rule1.getConditionType());\r
         \r
         assertEquals(3, clrFmt.getNumControlPoints());\r
         assertEquals(3, clrFmt.getColors().length);\r
@@ -1257,7 +1244,7 @@ public abstract class BaseTestConditionalFormatting {
         assertEquals(1, cf.getNumberOfRules());\r
         rule1 = cf.getRule(0);\r
         dbFmt = rule1.getDataBarFormatting();\r
-        assertEquals(ConditionType.DATA_BAR, rule1.getConditionTypeType());\r
+        assertEquals(ConditionType.DATA_BAR, rule1.getConditionType());\r
         \r
         assertEquals(false, dbFmt.isIconOnly());\r
         assertEquals(true, dbFmt.isLeftToRight());\r
index 431c80c7812c0b35e7c92d54e2fd964f789dd6c9..8198f56b47cb28d0eca5c1de1c55ab64a04fb6ab 100644 (file)
@@ -23,8 +23,10 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
 import org.apache.poi.hssf.record.TestcaseRecordInputStream;
+import org.apache.poi.util.LittleEndianByteArrayOutputStream;
 import org.apache.poi.util.LittleEndianOutputStream;
 
+
 //TODO: replace junit3 with junit4 code
 import junit.framework.TestCase; //junit3
 
@@ -86,33 +88,6 @@ public final class TestCellRangeAddress extends TestCase {
             out.close();
         }
     }
-
-    @SuppressWarnings("deprecation")
-    public void testStoreDeprecated() throws IOException {
-        CellRangeAddress ref = new CellRangeAddress(0, 0, 0, 0);
-
-        byte[] recordBytes = new byte[CellRangeAddress.ENCODED_SIZE];
-        // With nothing set
-        ref.serialize(0, recordBytes);
-        assertEquals(recordBytes.length, data.length);
-        for (int i = 0; i < data.length; i++) {
-            assertEquals("At offset " + i, 0, recordBytes[i]);
-        }
-
-        // Now set the flags
-        ref.setFirstRow((short) 2);
-        ref.setLastRow((short) 4);
-        ref.setFirstColumn((short) 0);
-        ref.setLastColumn((short) 3);
-
-        // Re-test
-        ref.serialize(0, recordBytes);
-
-        assertEquals(recordBytes.length, data.length);
-        for (int i = 0; i < data.length; i++) {
-            assertEquals("At offset " + i, data[i], recordBytes[i]);
-        }
-    }
     
     public void testCreateIllegal() throws IOException {
         // for some combinations we expected exceptions