You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Jeremias Maerki (JIRA)" <ji...@apache.org> on 2009/08/20 10:16:14 UTC
[jira] Created: (PDFBOX-507) [PATCH] Option to disable close
warning in finalizer of COSDocument.
[PATCH] Option to disable close warning in finalizer of COSDocument.
--------------------------------------------------------------------
Key: PDFBOX-507
URL: https://issues.apache.org/jira/browse/PDFBOX-507
Project: PDFBox
Issue Type: Improvement
Affects Versions: 0.8.0-incubator
Reporter: Jeremias Maerki
Fix For: 0.8.0-incubator
Attachments: COSDocumentFinalizerPatch.diff
I'm using PDFBox in a FOP plug-in to embed PDF documents. The PDF images are cached in memory through soft references. Therefore I do not know exactly when the COSDocument needs to be closed. I do close it in the holder's finalize() method but the garbage collector sometimes calls the COSDocument's finalizer before I have a chance to close it myself. With this patch I'd like to introduce an option that lets me disable the warning and do a close() in the finalizer in any case. I do think that the warning can be helpful for newbies (closing early is a good idea when that's possible) but the warning to System.err is a problem in my case.
If noone objects within 72 hours, I'm happy to apply the patch myself.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (PDFBOX-507) [PATCH] Option to disable close
warning in finalizer of COSDocument.
Posted by "Jeremias Maerki (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jeremias Maerki resolved PDFBOX-507.
------------------------------------
Resolution: Fixed
Assignee: Jeremias Maerki
Applied: http://svn.apache.org/viewvc?rev=808878&view=rev
> [PATCH] Option to disable close warning in finalizer of COSDocument.
> --------------------------------------------------------------------
>
> Key: PDFBOX-507
> URL: https://issues.apache.org/jira/browse/PDFBOX-507
> Project: PDFBox
> Issue Type: Improvement
> Affects Versions: 0.8.0-incubator
> Reporter: Jeremias Maerki
> Assignee: Jeremias Maerki
> Fix For: 0.8.0-incubator
>
> Attachments: COSDocumentFinalizerPatch.diff
>
>
> I'm using PDFBox in a FOP plug-in to embed PDF documents. The PDF images are cached in memory through soft references. Therefore I do not know exactly when the COSDocument needs to be closed. I do close it in the holder's finalize() method but the garbage collector sometimes calls the COSDocument's finalizer before I have a chance to close it myself. With this patch I'd like to introduce an option that lets me disable the warning and do a close() in the finalizer in any case. I do think that the warning can be helpful for newbies (closing early is a good idea when that's possible) but the warning to System.err is a problem in my case.
> If noone objects within 72 hours, I'm happy to apply the patch myself.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (PDFBOX-507) [PATCH] Option to disable close
warning in finalizer of COSDocument.
Posted by "Jeremias Maerki (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jeremias Maerki updated PDFBOX-507:
-----------------------------------
Attachment: COSDocumentFinalizerPatch.diff
> [PATCH] Option to disable close warning in finalizer of COSDocument.
> --------------------------------------------------------------------
>
> Key: PDFBOX-507
> URL: https://issues.apache.org/jira/browse/PDFBOX-507
> Project: PDFBox
> Issue Type: Improvement
> Affects Versions: 0.8.0-incubator
> Reporter: Jeremias Maerki
> Fix For: 0.8.0-incubator
>
> Attachments: COSDocumentFinalizerPatch.diff
>
>
> I'm using PDFBox in a FOP plug-in to embed PDF documents. The PDF images are cached in memory through soft references. Therefore I do not know exactly when the COSDocument needs to be closed. I do close it in the holder's finalize() method but the garbage collector sometimes calls the COSDocument's finalizer before I have a chance to close it myself. With this patch I'd like to introduce an option that lets me disable the warning and do a close() in the finalizer in any case. I do think that the warning can be helpful for newbies (closing early is a good idea when that's possible) but the warning to System.err is a problem in my case.
> If noone objects within 72 hours, I'm happy to apply the patch myself.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.