PDFStreamEngine#processSubStream should throw original IOException instead of
RuntimeException + FIX
----------------------------------------------------------------------------------------------------
Key: PDFBOX-1167
URL: https://issues.apache.org/jira/browse/PDFBOX-1167
Project: PDFBox
Issue Type: Improvement
Components: Parsing
Affects Versions: 1.7.0
Reporter: Timo Boehme
Priority: Minor
PDFStreamEngine#processSubStream(COSStream) uses TokenIterator from
PDFStreamParser. This iterator when called hasNext() might face an IOException
which it wraps insight a RuntimeException (because hasNext has no declared
exceptions). Now when such an IOException occurs it normally won't be handled
by any calling class because only IOException is declared to be thrown but
none of the classes is prepared to handle RuntimeException. Therefore within
the mentioned method processSubStream the RuntimeException should be catched
and tested for embedded IOException. In this case the IOException should be
thrown.
I will attach the processSubStream method with the added catch block (method
taken from rev. 1163297).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira