[ 
https://issues.apache.org/jira/browse/PDFBOX-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16417321#comment-16417321
 ] 

Gary Potagal commented on PDFBOX-4158:
--------------------------------------

[~msahyoun] - what about not having a nested try\{ } on line 94 and just having 
try, catch, finally.  If IOException occurs anywhere in the try, it will be 
caught by catch and in finally, firstException will not be null.  Otherwise, 
you might swallow an Exception that occurs in finally.  It could be argued that 
method will not notify the caller if it gets errors closing assets, but than 
we're making presumptions on behalf of the caller.  Thanks! 

> COSDocument and PDFMerger may not close all IO resources if closing of one 
> fails
> --------------------------------------------------------------------------------
>
>                 Key: PDFBOX-4158
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4158
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 2.0.4, 2.0.9, 3.0.0 PDFBox
>            Reporter: Maruan Sahyoun
>            Assignee: Maruan Sahyoun
>            Priority: Minor
>             Fix For: 2.0.10, 3.0.0 PDFBox
>
>         Attachments: BiggestObjectAllocationGraph.png, BiggestObjectList.png, 
> PDFBOX-4158.patch
>
>
> As observed on the users mailing list  {{COSDocument.close}} and 
> {{PDFMergerUtility.mergeDocuments}} might not close all IO resources if 
> closing of one of the resources fails



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to