You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ms...@apache.org on 2018/02/21 17:28:39 UTC

svn commit: r1824991 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java

Author: msahyoun
Date: Wed Feb 21 17:28:39 2018
New Revision: 1824991

URL: http://svn.apache.org/viewvc?rev=1824991&view=rev
Log:
PDFBOX-4071: remove throws declaration if not thrown by the method

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java?rev=1824991&r1=1824990&r2=1824991&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java Wed Feb 21 17:28:39 2018
@@ -170,11 +170,8 @@ public class PDDocument implements Close
         {
             LOG.warn("Error initializing scratch file: " + ioe.getMessage() +
                      ". Fall back to main memory usage only.", ioe);
-            try
-            {
-                scratchFile = new ScratchFile(MemoryUsageSetting.setupMainMemoryOnly());
-            }
-            catch (IOException ioe2) {}
+            
+            scratchFile = ScratchFile.getMainMemoryOnlyInstance();
         }
         
         document = new COSDocument(scratchFile);
@@ -557,7 +554,6 @@ public class PDDocument implements Close
     }
 
     private void prepareNonVisibleSignature(PDSignatureField signatureField)
-            throws IOException
     {
         // "Signature fields that are not intended to be visible shall
         // have an annotation rectangle that has zero height and width."
@@ -813,10 +809,8 @@ public class PDDocument implements Close
      * This will set the encryption dictionary for this document.
      * 
      * @param encryption The encryption dictionary(most likely a PDStandardEncryption object)
-     * 
-     * @throws IOException If there is an error determining which security handler to use.
      */
-    public void setEncryptionDictionary(PDEncryption encryption) throws IOException
+    public void setEncryptionDictionary(PDEncryption encryption)
     {
         this.encryption = encryption;
     }
@@ -826,9 +820,8 @@ public class PDDocument implements Close
      * last in time when empty signature fields are created first but signed after other fields.
      * 
      * @return the last signature as <code>PDSignatureField</code>.
-     * @throws IOException if no document catalog can be found.
      */
-    public PDSignature getLastSignatureDictionary() throws IOException
+    public PDSignature getLastSignatureDictionary()
     {
         List<PDSignature> signatureDictionaries = getSignatureDictionaries();
         int size = signatureDictionaries.size();
@@ -843,9 +836,8 @@ public class PDDocument implements Close
      * Retrieve all signature fields from the document.
      * 
      * @return a <code>List</code> of <code>PDSignatureField</code>s
-     * @throws IOException if no document catalog can be found.
      */
-    public List<PDSignatureField> getSignatureFields() throws IOException
+    public List<PDSignatureField> getSignatureFields()
     {
         List<PDSignatureField> fields = new ArrayList<>();
         PDAcroForm acroForm = getDocumentCatalog().getAcroForm();
@@ -866,9 +858,8 @@ public class PDDocument implements Close
      * Retrieve all signature dictionaries from the document.
      * 
      * @return a <code>List</code> of <code>PDSignatureField</code>s
-     * @throws IOException if no document catalog can be found.
      */
-    public List<PDSignature> getSignatureDictionaries() throws IOException
+    public List<PDSignature> getSignatureDictionaries()
     {
         List<PDSignature> signatures = new ArrayList<>();
         for (PDSignatureField field : getSignatureFields())