jakartaee / mail-api

Jakarta Mail Specification project
https://jakartaee.github.io/mail-api
Other
240 stars 100 forks source link

Remove finalize() #725

Open jbescos opened 3 months ago

jbescos commented 3 months ago

https://github.com/jakartaee/mail-api/issues/720

I found only few places in mail-api. Some of them are abstract and they don't have usage in mail-api, so I will need to check angus-mail.

It is probably out of the scope of this issue, but I couldn't resist to remove Objects.requireNonNull(this);. Is there any reason to have that?.

jmehrens commented 3 months ago

Also more of housekeeping thing but, I didn't create a clone issue in angus mail. There are finializers there too that need to be removed. I'm not sure of the workflow but I noticed that it is possible to:

  1. Create an issue in JakartaMail.
  2. Link it to a PR in JakartaMail.
  3. Link the JakartaMail issue to another PR in AngusMail.
  4. Use the JakartaMail issue number and title in the changes.txt of JakartaMail.
  5. Use the AngusMail PR number but the JakartaMail issue title in the changes.txt of AngusMail.

The result is one less issue ticket being created without any numbering conflicts.

jmehrens commented 2 months ago

Before I forget, you'll have to write up some COMPAT.txt notes for close:

  1. No arg close no longer hostile if closed.
  2. No arg close is now required to be called to signal event thread to quit.
  3. Obviously users must manage resources as the finalizers are removed.

Understand that this is blocked by version changes and PR is still draft so there could be more.