pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1647284 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java
Date Mon, 22 Dec 2014 10:31:13 GMT
Author: tilman
Date: Mon Dec 22 10:31:12 2014
New Revision: 1647284

URL: http://svn.apache.org/r1647284
Log:
PDFBOX-2576: remove double code

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=1647284&r1=1647283&r2=1647284&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
Mon Dec 22 10:31:12 2014
@@ -1179,7 +1179,8 @@ public class NonSequentialPDFParser exte
     }
 
     /**
-     * Creates a unique object id using object number and object generation number. (requires
object number < 2^31))
+     * Creates a unique object id using object number and object generation
+     * number. (requires object number < 2^31))
      */
     private long getObjectId(final COSObject obj)
     {
@@ -1187,29 +1188,21 @@ public class NonSequentialPDFParser exte
     }
 
     /**
-     * Adds all from newObjects to toBeParsedList if it is not an COSObject or we didn't
add this COSObject already
-     * (checked via addedObjects).
+     * Adds all from newObjects to toBeParsedList if it is not an COSObject or
+     * we didn't add this COSObject already (checked via addedObjects).
      */
     private void addNewToList(final Queue<COSBase> toBeParsedList,
             final Collection<COSBase> newObjects, final Set<Long> addedObjects)
     {
         for (COSBase newObject : newObjects)
         {
-            if (newObject instanceof COSObject)
-            {
-                final long objId = getObjectId((COSObject) newObject);
-                if (!addedObjects.add(objId))
-                {
-                    continue;
-                }
-            }
-            toBeParsedList.add(newObject);
+            addNewToList(toBeParsedList, newObject, addedObjects);
         }
     }
 
     /**
-     * Adds newObject to toBeParsedList if it is not an COSObject or we didn't add this COSObject
already (checked via
-     * addedObjects).
+     * Adds newObject to toBeParsedList if it is not an COSObject or we didn't
+     * add this COSObject already (checked via addedObjects).
      */
     private void addNewToList(final Queue<COSBase> toBeParsedList, final COSBase newObject,
             final Set<Long> addedObjects)



Mime
View raw message