jakartaee / mail-api

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

move from MailDateFormat (not thread safe) to DateTimeFormatter #590

Open valenpo opened 2 years ago

valenpo commented 2 years ago

With high load and usage of MimeMessage plenty of locks due to MailDateFormat. Maybe it is time move to something thread safe like DateTimeFormatter?

jmehrens commented 7 months ago

MailDateFormatter has lots of exceptions for parsing that make the move to DateTimeFormatter not viable.

I think the best fix here is to remove the lock and static field. Then have each call create a method local instance.

Thoughts @anthonyvdotbe?

anthonyvdotbe commented 7 months ago

@jmehrens yes, I agree that your proposal is the best option here