You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by GitBox <gi...@apache.org> on 2022/01/15 17:42:27 UTC

[GitHub] [pdfbox] rototor opened a new pull request #139: Replace finalize() with Cleaner

rototor opened a new pull request #139:
URL: https://github.com/apache/pdfbox/pull/139


   Finalizers (method finalize()) are going to be deprecated for removal with JDK 18. See https://openjdk.java.net/jeps/421 for details.
   
   The best way to replace the finalize() methods is by using the JDK 9 java.lang.ref.Cleaner. As PDFBox 3 targets JDK 8 this can not be used directly.
   
   The attached patch implements a Cleaner using finalizers for JDK <= 8 and using java.lang.ref.Cleaner by reflection for JDK 9+. 
   
   The two remaining finalize() implementing classes are migrated to the new Cleaner.
   
   I’m not really happy with the name and package org.apache.fontbox.util.PdfBoxInternalCleaner of the cleaner. Maybe you have an idea for a better place and name.
   
   In theory this patch could be back ported to PDFBox 2, but I’m not sure if this is worth the risk.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org


[GitHub] [pdfbox] rototor commented on pull request #139: Replace finalize() with Cleaner

Posted by GitBox <gi...@apache.org>.
rototor commented on pull request #139:
URL: https://github.com/apache/pdfbox/pull/139#issuecomment-1013723380


   See also the JIRA Ticket https://issues.apache.org/jira/browse/PDFBOX-5362


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org