pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1645703 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSNumber.java
Date Mon, 15 Dec 2014 17:31:53 GMT
Author: tilman
Date: Mon Dec 15 17:31:53 2014
New Revision: 1645703

URL: http://svn.apache.org/r1645703
Log:
PDFBOX-2569: fix for some numbers that start with "+", by Arthur Blake

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSNumber.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSNumber.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSNumber.java?rev=1645703&r1=1645702&r2=1645703&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSNumber.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSNumber.java Mon Dec 15 17:31:53
2014
@@ -97,7 +97,14 @@ public abstract class COSNumber extends
         {
             try
             {
-                return COSInteger.get( Long.parseLong( number ) );
+                if (number.charAt(0) == '+')
+                {
+                    return COSInteger.get(Long.parseLong(number.substring(1)));
+                }
+                else
+                {
+                    return COSInteger.get(Long.parseLong(number));
+                }
             }
             catch( NumberFormatException e )
             {



Mime
View raw message