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

Tilman Hausherr commented on PDFBOX-2039:
-----------------------------------------

For a start, I added it for PDDocument and COSDocument in 1.8 in rev 1589346, 
because these are the methods where it is implemented in 2.0. I'll have a look 
at other methods later. You can get it immediately with svn if you want to test 
improved code, or here in a few hours:
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox/1.8.5-SNAPSHOT/

> Class PDDocument should implement java.io.Closeable
> ---------------------------------------------------
>
>                 Key: PDFBOX-2039
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2039
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 1.8.4, 1.8.5, 2.0.0
>            Reporter: Andrei Solntsev
>            Priority: Minor
>             Fix For: 1.8.5, 2.0.0
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> It would make it possible to use Java 7 try-with-resources feature:
> try (PDDocument doc = PDDocument.load(outputFile)) {
>   // bla-bla
>   // no need to call doc.close(); explicitly
> }
> P.S. Actually all org.apache.pdfbox.* classes with method close() could 
> implement java.io.Closeable



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to