pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1646645 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/ConformingPDFParser.java
Date Fri, 19 Dec 2014 07:52:12 GMT
Author: tilman
Date: Fri Dec 19 07:52:11 2014
New Revision: 1646645

URL: http://svn.apache.org/r1646645
Log:
PDFBOX-2576: keep orginal stack trace when throwing new exception

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/ConformingPDFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/ConformingPDFParser.java?rev=1646645&r1=1646644&r2=1646645&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/ConformingPDFParser.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/ConformingPDFParser.java
Fri Dec 19 07:52:11 2014
@@ -49,7 +49,7 @@ public class ConformingPDFParser extends
     List<XrefEntry> xrefEntries;
     private long currentOffset;
     private ConformingPDDocument doc = null;
-    private boolean throwNonConformingException = true;
+    private final boolean throwNonConformingException = true;
     private boolean recursivlyRead = true;
 
     /**
@@ -134,7 +134,6 @@ public class ConformingPDFParser extends
     }
 
     protected long parseTrailerInformation() throws IOException, NumberFormatException {
-        long xrefLocation = -1;
         consumeWhitespaceBackwards();
         String currentLine = readLineBackwards();
         if(throwNonConformingException) {
@@ -142,7 +141,7 @@ public class ConformingPDFParser extends
                 throw new AssertionError("Invalid EOF marker.\nExpected: %%EOF\nFound: "+currentLine);
         }
 
-        xrefLocation = readLongBackwards();
+        long xrefLocation = readLongBackwards();
         currentLine = readLineBackwards();
         if(throwNonConformingException) {
             if(!"startxref".equals(currentLine))
@@ -337,7 +336,7 @@ public class ConformingPDFParser extends
                 Long.parseLong(lastSection);
                 obj = COSNumber.get(lastSection);
             } catch(NumberFormatException e) {
-                throw new RuntimeException("Not yet implemented");
+                throw new RuntimeException("Not yet implemented", e);
             }
         }
 



Mime
View raw message