pdfbox-commits mailing list archives

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

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

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java?rev=1854632&r1=1854631&r2=1854632&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java
Sat Mar  2 09:56:37 2019
@@ -378,17 +378,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