pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1641654 - /pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/parser/PreflightParser.java
Date Tue, 25 Nov 2014 16:52:57 GMT
Author: tilman
Date: Tue Nov 25 16:52:57 2014
New Revision: 1641654

URL: http://svn.apache.org/r1641654
Log:
PDFBOX-1675: code cleanup

Modified:
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/parser/PreflightParser.java

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/parser/PreflightParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/parser/PreflightParser.java?rev=1641654&r1=1641653&r2=1641654&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/parser/PreflightParser.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/parser/PreflightParser.java
Tue Nov 25 16:52:57 2014
@@ -272,7 +272,7 @@ public class PreflightParser extends Non
         {
             reader = new BufferedReader(new InputStreamReader(new FileInputStream(getPdfFile()),
encoding));
             String firstLine = reader.readLine();
-            if (firstLine == null || (firstLine != null && !firstLine.matches("%PDF-1\\.[1-9]")))
+            if (firstLine == null || !firstLine.matches("%PDF-1\\.[1-9]"))
             {
                 addValidationError(new ValidationError(PreflightConstants.ERROR_SYNTAX_HEADER,
                         "First line must match %PDF-1.\\d"));
@@ -352,8 +352,8 @@ public class PreflightParser extends Non
         while (true)
         {
             // just after the xref<EOL> there are an integer
-            long currObjID = 0; // first obj id
-            long count = 0; // the number of objects in the xref table
+            long currObjID; // first obj id
+            long count; // the number of objects in the xref table
 
             long offset = pdfSource.getOffset();
             String line = readLine();
@@ -685,8 +685,8 @@ public class PreflightParser extends Non
                 // ---- go to object start
                 setPdfSource(offsetOrObjstmObNr);
                 // ---- we must have an indirect object
-                long readObjNr = 0;
-                int readObjGen = 0;
+                long readObjNr;
+                int readObjGen;
 
                 long offset = pdfSource.getOffset();
                 String line = readLine();



Mime
View raw message