Author: fanningpj
Date: Wed Jul 15 21:53:21 2020
New Revision: 1879908

URL: http://svn.apache.org/viewvc?rev=1879908&view=rev
Log:
remove some deprecated code

Removed:
    poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/util/Nullable.java
Modified:
    
poi/trunk/src/ooxml/java/org/apache/poi/ooxml/extractor/ExtractorFactory.java
    
poi/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java

Modified: 
poi/trunk/src/ooxml/java/org/apache/poi/ooxml/extractor/ExtractorFactory.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/ooxml/extractor/ExtractorFactory.java?rev=1879908&r1=1879907&r2=1879908&view=diff
==============================================================================
--- 
poi/trunk/src/ooxml/java/org/apache/poi/ooxml/extractor/ExtractorFactory.java 
(original)
+++ 
poi/trunk/src/ooxml/java/org/apache/poi/ooxml/extractor/ExtractorFactory.java 
Wed Jul 15 21:53:21 2020
@@ -279,21 +279,6 @@ public final class ExtractorFactory {
      * If there are no embedded documents, you'll get back an
      *  empty array. Otherwise, you'll get one open
      *  {@link POITextExtractor} for each embedded file.
-     *
-     *  @deprecated Use the method with correct "embedded"
-     */
-    @Deprecated
-    @Removal(version="4.2")
-    public static POITextExtractor[] 
getEmbededDocsTextExtractors(POIOLE2TextExtractor ext) throws IOException, 
OpenXML4JException, XmlException {
-        return getEmbeddedDocsTextExtractors(ext);
-    }
-
-    /**
-     * Returns an array of text extractors, one for each of
-     *  the embedded documents in the file (if there are any).
-     * If there are no embedded documents, you'll get back an
-     *  empty array. Otherwise, you'll get one open
-     *  {@link POITextExtractor} for each embedded file.
      */
     public static POITextExtractor[] 
getEmbeddedDocsTextExtractors(POIOLE2TextExtractor ext) throws IOException, 
OpenXML4JException, XmlException {
         // All the embedded directories we spotted
@@ -352,23 +337,6 @@ public final class ExtractorFactory {
     }
 
     /**
-     * Returns an array of text extractors, one for each of
-     *  the embedded documents in the file (if there are any).
-     * If there are no embedded documents, you'll get back an
-     *  empty array. Otherwise, you'll get one open
-     *  {@link POITextExtractor} for each embedded file.
-     *
-     *  @deprecated Use the method with correct "embedded"
-     */
-    @Deprecated
-    @Removal(version="4.2")
-    @NotImplemented
-    @SuppressWarnings({"UnusedParameters", "UnusedReturnValue"})
-    public static POITextExtractor[] 
getEmbededDocsTextExtractors(POIXMLTextExtractor ext) {
-        return getEmbeddedDocsTextExtractors(ext);
-    }
-
-    /**
      * Returns an array of text extractors, one for each of
      *  the embedded documents in the file (if there are any).
      * If there are no embedded documents, you'll get back an

Modified: 
poi/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java?rev=1879908&r1=1879907&r2=1879908&view=diff
==============================================================================
--- 
poi/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java
 (original)
+++ 
poi/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java
 Wed Jul 15 21:53:21 2020
@@ -29,7 +29,6 @@ import javax.xml.parsers.ParserConfigura
 import org.apache.poi.openxml4j.opc.OPCPackage;
 import org.apache.poi.openxml4j.opc.PackagePart;
 import org.apache.poi.ss.usermodel.RichTextString;
-import org.apache.poi.util.Removal;
 import org.apache.poi.util.XMLHelper;
 import org.apache.poi.xssf.model.SharedStrings;
 import org.apache.poi.xssf.usermodel.XSSFRelation;
@@ -204,36 +203,9 @@ public class ReadOnlySharedStringsTable
         return this.uniqueCount;
     }
 
-    /**
-     * Return the string at a given index.
-     * Formatting is ignored.
-     *
-     * @param idx index of item to return.
-     * @return the item at the specified position in this Shared String table.
-     * @deprecated use <code>getItemAt</code> instead
-     */
-    @Removal(version = "4.2")
-    @Deprecated
-    public String getEntryAt(int idx) {
-        return strings.get(idx);
-    }
-
-    /**
-     * Returns all the strings.
-     * Formatting is ignored.
-     *
-     * @return a list with all the strings
-     * @deprecated use <code>getItemAt</code> instead
-     */
-    @Removal(version = "4.2")
-    @Deprecated
-    public List<String> getItems() {
-        return strings;
-    }
-
     @Override
     public RichTextString getItemAt(int idx) {
-        return new XSSFRichTextString(getEntryAt(idx));
+        return new XSSFRichTextString(strings.get(idx));
     }
 
     //// ContentHandler methods ////

Modified: 
poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java?rev=1879908&r1=1879907&r2=1879908&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java 
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java 
Wed Jul 15 21:53:21 2020
@@ -144,18 +144,6 @@ public class SharedStringsTable extends
      *
      * @param idx index of item to return.
      * @return the item at the specified position in this Shared String table.
-     * @deprecated use <code>getItemAt(int idx)</code> instead
-     */
-    @Removal(version = "4.2")
-    public CTRst getEntryAt(int idx) {
-        return strings.get(idx);
-    }
-
-    /**
-     * Return a string item by index
-     *
-     * @param idx index of item to return.
-     * @return the item at the specified position in this Shared String table.
      */
     @Override
     public RichTextString getItemAt(int idx) {
@@ -197,8 +185,7 @@ public class SharedStringsTable extends
      * @return index the index of added entry
      * @deprecated use <code>addSharedStringItem(RichTextString string)</code> 
instead
      */
-    @Removal(version = "4.2") //make private in 4.2
-    public int addEntry(CTRst st) {
+    private int addEntry(CTRst st) {
         String s = xmlText(st);
         count++;
         if (stmap.containsKey(s)) {
@@ -235,17 +222,6 @@ public class SharedStringsTable extends
     }
 
     /**
-     * Provide low-level access to the underlying array of CTRst beans
-     *
-     * @return array of CTRst beans
-     * @deprecated use <code>getSharedStringItems</code> instead
-     */
-    @Removal(version = "4.2")
-    public List<CTRst> getItems() {
-        return Collections.unmodifiableList(strings);
-    }
-
-    /**
      * Provide access to the strings in the SharedStringsTable
      *
      * @return list of shared string instances

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java?rev=1879908&r1=1879907&r2=1879908&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java 
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java Wed 
Jul 15 21:53:21 2020
@@ -376,7 +376,7 @@ public final class XSSFCell extends Cell
                     if (_cell.isSetV()) {
                         try {
                             int idx = Integer.parseInt(_cell.getV());
-                            rt = new 
XSSFRichTextString(_sharedStringSource.getEntryAt(idx));
+                            rt = 
(XSSFRichTextString)_sharedStringSource.getItemAt(idx);
                         } catch(Throwable t) {
                             rt = new XSSFRichTextString("");
                         }
@@ -1156,7 +1156,7 @@ public final class XSSFCell extends Cell
                 return TRUE_AS_STRING.equals(_cell.getV());
             case STRING:
                 int sstIndex = Integer.parseInt(_cell.getV());
-                XSSFRichTextString rt = new 
XSSFRichTextString(_sharedStringSource.getEntryAt(sstIndex));
+                RichTextString rt = _sharedStringSource.getItemAt(sstIndex);
                 String text = rt.getString();
                 return Boolean.parseBoolean(text);
             case NUMERIC:
@@ -1181,9 +1181,13 @@ public final class XSSFCell extends Cell
             case BOOLEAN:
                 return TRUE_AS_STRING.equals(_cell.getV()) ? TRUE : FALSE;
             case STRING:
-                int sstIndex = Integer.parseInt(_cell.getV());
-                XSSFRichTextString rt = new 
XSSFRichTextString(_sharedStringSource.getEntryAt(sstIndex));
-                return rt.getString();
+                try {
+                    int sstIndex = Integer.parseInt(_cell.getV());
+                    RichTextString rt = 
_sharedStringSource.getItemAt(sstIndex);
+                    return rt.getString();
+                } catch (Throwable t) {
+                    return "";
+                }
             case NUMERIC:
             case ERROR:
                 return _cell.getV();



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org
For additional commands, e-mail: commits-h...@poi.apache.org

Reply via email to