mail-api icon indicating copy to clipboard operation
mail-api copied to clipboard

finalize() in java.lang.Object has been deprecated

Open jmehrens opened this issue 1 year ago • 0 comments

The finalize() in java.lang.Object has been deprecated in JDK 9. Various classes in JakartaMail implement a finalizer that should simply be removed.

This ticket can only be completed once https://github.com/jakartaee/mail-api/issues/709 is completed.

Goals for this ticket would be:

  1. Remove all finalizer methods from classes.
  2. Ensure that the existing close method for that class has the proper try/finally to ensure no unexpected failure prevent freeing the resource. Most classes need to be updated to cover this case.

jmehrens avatar Mar 06 '24 04:03 jmehrens