Uh oh!
There was an error while loading. Please reload this page.
Replaced SimpleDateFormat with DateTimeFormatter wherever thread-critical - #208
Conversation
mgaffigan
left a comment
There was a problem hiding this comment.
I agree with changing:
- server/src/com/mirth/connect/client/core/api/providers/CalendarParamConverterProvider.java
- server/src/com/mirth/connect/plugins/serverlog/ServerLogItem.java
but the others are all allocated on the stack - and have no possibility for cross-thread use. Changing DateUtil in particular seems unnecessarily risky.
Also, is there a reason we're jumping to Apache FastDateFormat instead of Java 8 DateTimeFormatter?
9b1257e to
614b02eCompare2ce92e1 to
75644deComparejonbartels
commented
Nov 21, 2025
I agree with Mitch
The core Java DateTimeFormatter is rock solid. |
NicoPiel
commented
Nov 21, 2025
That's why it's implemented :) |
NicoPiel
commented
Nov 24, 2025
@mgaffigan Any more thoughts on this? |
mgaffigan
left a comment
There was a problem hiding this comment.
Please omit the unused import, then I'll be good.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
NicoPiel
commented
Nov 24, 2025
Done. |
5fc7fb6 to
d2b3e14CompareUh oh!
There was an error while loading. Please reload this page.
f91ae66c2f5445 to
a9aae13Comparea9aae13 to
a0fc467CompareReplace usages of the non-thread-safe date formatter with java.time's DateTimeFormatter and related APIs to improve thread-safety and correctness when parsing/formatting dates and time zones. Update calendar parameter conversion to use ZonedDateTime/Instant and adapt log timestamp formatting to use DateTimeFormatter. Removes unused imports and modernizes date handling to avoid concurrency issues introduced by SimpleDateFormat. Collectively decided to use `DateTimeFormatter` instead of `FastDateTime`. Signed-off-by: Nico Piel <nico.piel@hotmail.de>
a0fc467 to
fa8957dCompare
Solves #207