Author: msahyoun
Date: Tue Mar  6 10:30:49 2018
New Revision: 1825970

URL: http://svn.apache.org/viewvc?rev=1825970&view=rev
Log:
PDFBOX-4122: remove not needed null check; avoid Sonar warning

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

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java?rev=1825970&r1=1825969&r2=1825970&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java 
(original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java 
Tue Mar  6 10:30:49 2018
@@ -1552,18 +1552,18 @@ public class COSParser extends BaseParse
         long newOffset = -1;
         long newOffsetTable = -1;
         long newOffsetStream = -1;
+
+        // initialize bfSearchXRefTablesOffsets -> not null
         bfSearchForXRefTables();
+        // initialize bfSearchXRefStreamsOffsets -> not null
         bfSearchForXRefStreams();
-        if (bfSearchXRefTablesOffsets != null)
-        {
-            // TODO to be optimized, this won't work in every case
-            newOffsetTable = searchNearestValue(bfSearchXRefTablesOffsets, 
xrefOffset);
-        }
-        if (bfSearchXRefStreamsOffsets != null)
-        {
-            // TODO to be optimized, this won't work in every case
-            newOffsetStream = searchNearestValue(bfSearchXRefStreamsOffsets, 
xrefOffset);
-        }
+
+        // TODO to be optimized, this won't work in every case
+        newOffsetTable = searchNearestValue(bfSearchXRefTablesOffsets, 
xrefOffset);
+        
+        // TODO to be optimized, this won't work in every case
+        newOffsetStream = searchNearestValue(bfSearchXRefStreamsOffsets, 
xrefOffset);
+
         // choose the nearest value
         if (newOffsetTable > -1 && newOffsetStream > -1)
         {


Reply via email to