[
https://issues.apache.org/jira/browse/PDFBOX-1525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13588884#comment-13588884
]
Thomas Chojecki commented on PDFBOX-1525:
-----------------------------------------
Calling toString on COSDictionaries can result in such an exception. This is
caused by larger dictionaries that contains references to other larger
dictionaries and if it went wrong there can be a cycle to already traveled
dictionaries.
It is an bad idea to use toString() in this lib. If you now which items you
need from a dictionary, you can use getItem(...) to get a value.
So this isn't actually a bug.
> pdAnnotation.getDictionary().toString() => StackOverflowError
> --------------------------------------------------------------
>
> Key: PDFBOX-1525
> URL: https://issues.apache.org/jira/browse/PDFBOX-1525
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 1.7.1
> Reporter: Rudolf Pfister
>
> Exception in thread "main" java.lang.StackOverflowError
> at sun.misc.FloatingDecimal.dtoa(FloatingDecimal.java:515)
> at sun.misc.FloatingDecimal.<init>(FloatingDecimal.java:502)
> at
> java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:662)
> at java.lang.StringBuilder.append(StringBuilder.java:230)
> at org.apache.pdfbox.cos.COSFloat.toString(COSFloat.java:138)
> at org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1421)
> at org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1421)
> at org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1421)
> at org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1421)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira