You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "John Hewson (JIRA)" <ji...@apache.org> on 2014/10/11 03:26:33 UTC

[jira] [Closed] (PDFBOX-1167) PDFStreamEngine#processSubStream should throw original IOException instead of RuntimeException + FIX

     [ https://issues.apache.org/jira/browse/PDFBOX-1167?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Hewson closed PDFBOX-1167.
-------------------------------
       Resolution: Fixed
    Fix Version/s: 2.0.0

This was fixed some time ago in the trunk.

> 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: Documentation
>    Affects Versions: 1.7.0
>            Reporter: Timo Boehme
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: PDFStreamEngine_processSubStream.java
>
>
> 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 was sent by Atlassian JIRA
(v6.3.4#6332)