pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1854633 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java
Date Sat, 02 Mar 2019 09:56:54 GMT
Author: tilman
Date: Sat Mar  2 09:56:54 2019
New Revision: 1854633

URL: http://svn.apache.org/viewvc?rev=1854633&view=rev
Log:
PDFBOX-4477: only cache strings and streams, this improves speed and memory footprint

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java?rev=1854633&r1=1854632&r2=1854633&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java
Sat Mar  2 09:56:54 2019
@@ -398,17 +398,23 @@ public abstract class SecurityHandler
         {
             return;
         }
-        if (objects.contains(obj))
-        {
-            return;
-        }
-        objects.add(obj);
+        // PDFBOX-4477: only cache strings and streams, this improves speed and memory footprint
         if (obj instanceof COSString)
         {
+            if (objects.contains(obj))
+            {
+                return;
+            }
+            objects.add(obj);
             decryptString((COSString) obj, objNum, genNum);
         }
         else if (obj instanceof COSStream)
         {
+            if (objects.contains(obj))
+            {
+                return;
+            }
+            objects.add(obj);
             decryptStream((COSStream) obj, objNum, genNum);
         }
         else if (obj instanceof COSDictionary)



Mime
View raw message