pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1647152 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java
Date Sun, 21 Dec 2014 15:17:15 GMT
Author: tilman
Date: Sun Dec 21 15:17:14 2014
New Revision: 1647152

URL: http://svn.apache.org/r1647152
Log:
PDFBOX-2576: split up long method into smaller ones

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java?rev=1647152&r1=1647151&r2=1647152&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java
Sun Dec 21 15:17:14 2014
@@ -1282,19 +1282,7 @@ public class NonSequentialPDFParser exte
         final Set<Long> parsedObjects = new HashSet<Long>();
         final Set<Long> addedObjects = new HashSet<Long>();
 
-        // ---- add objects not to be parsed to list of already parsed objects
-        if (excludeObjects != null)
-        {
-            for (COSName objName : excludeObjects)
-            {
-                COSBase baseObj = dict.getItem(objName);
-                if (baseObj instanceof COSObject)
-                {
-                    parsedObjects.add(getObjectId((COSObject) baseObj));
-                }
-            }
-        }
-
+        addExcludedToList(excludeObjects, dict, parsedObjects);
         addNewToList(toBeParsedList, dict.getValues(), addedObjects);
 
         // ---- go through objects to be parsed
@@ -1394,6 +1382,22 @@ public class NonSequentialPDFParser exte
         }
     }
 
+    // add objects not to be parsed to list of already parsed objects
+    private void addExcludedToList(COSName[] excludeObjects, COSDictionary dict, final Set<Long>
parsedObjects)
+    {
+        if (excludeObjects != null)
+        {
+            for (COSName objName : excludeObjects)
+            {
+                COSBase baseObj = dict.getItem(objName);
+                if (baseObj instanceof COSObject)
+                {
+                    parsedObjects.add(getObjectId((COSObject) baseObj));
+                }
+            }
+        }
+    }
+
     /**
      * This will parse the next object from the stream and add it to the local state. This
is taken from
      * {@link PDFParser} and reduced to parsing an indirect object.
@@ -1535,7 +1539,6 @@ public class NonSequentialPDFParser exte
                 }
 
                 releasePdfSourceInputStream();
-
             }
             else
             {



Mime
View raw message