MIME4J-298 Convert DateTimeFieldLenientImpl to DateTimeFormatter (#44)
authorTellier Benoit <btellier@linagora.com>
Sun, 20 Jun 2021 02:45:20 +0000 (09:45 +0700)
committerGitHub <noreply@github.com>
Sun, 20 Jun 2021 02:45:20 +0000 (09:45 +0700)
commit999f319dcfe7786f15177378f4d7e2b028e74809
tree090955091988e0a8d215ada7d2a25f380154f958
parent566ebcd97124e0a2c33ce554c9c74e075c4f5ff0
MIME4J-298 Convert DateTimeFieldLenientImpl to DateTimeFormatter (#44)

This allows:
 - Specifying all patterns at once, avoiding one parsing pass per pattern
 - DateTimeFormatter is thread safe, thus can be initialized once and reused

Special care have been taken to preserve previous behaviour (missing tests were added):
 - Accept extra input after the date
 - Relax cross-validation
dom/src/main/java/org/apache/james/mime4j/field/DateTimeFieldLenientImpl.java
dom/src/test/java/org/apache/james/mime4j/field/LenientDateTimeFieldTest.java