"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pdfbox/src/main/java/org/apache/pdfbox/cos/COSNumber.java" between
pdfbox-2.0.23-src.zip and pdfbox-2.0.24-src.zip

About: Apache PDFBox is a Java PDF library tool that allows creation of new PDF documents, manipulation of existing documents and the ability to extract content from documents.

COSNumber.java  (pdfbox-2.0.23-src):COSNumber.java  (pdfbox-2.0.24-src)
skipping to change at line 121 skipping to change at line 121
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
// check if the given string could be a number at all // check if the given string could be a number at all
String numberString = number.startsWith("+") || number.startsWith("- ") String numberString = number.startsWith("+") || number.startsWith("- ")
? number.substring(1) : number; ? number.substring(1) : number;
if (!numberString.matches("[0-9]*")) if (!numberString.matches("[0-9]*"))
{ {
throw new IOException("Not a number: " + number); throw new IOException("Not a number: " + number);
} }
return null; // return a limited COSInteger value which is marked as invalid
return number.startsWith("-") ? COSInteger.OUT_OF_RANGE_MIN
: COSInteger.OUT_OF_RANGE_MAX;
} }
} }
private static boolean isFloat( String number ) private static boolean isFloat( String number )
{ {
int length = number.length(); int length = number.length();
for (int i = 0; i < length; i++) for (int i = 0; i < length; i++)
{ {
char digit = number.charAt(i); char digit = number.charAt(i);
if (digit == '.' || digit == 'e') if (digit == '.' || digit == 'e')
 End of changes. 1 change blocks. 
1 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)