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

move from MailDateFormat (not thread safe) to DateTimeFormatter

Open valenpo opened this issue 4 years ago • 2 comments

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

valenpo avatar Nov 24 '21 12:11 valenpo

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?

jmehrens avatar Mar 06 '24 19:03 jmehrens

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

anthonyvdotbe avatar Mar 07 '24 14:03 anthonyvdotbe