You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Timo Boehme (Created) (JIRA)" <ji...@apache.org> on 2011/11/11 17:30:51 UTC

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

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

        

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

Posted by "Timo Boehme (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-1167?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Boehme updated PDFBOX-1167:
--------------------------------

    Attachment: PDFStreamEngine_processSubStream.java

fixed method processSubStream from PDFStreamEngine where catch block is added
                
> 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
>         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 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