[ 
https://issues.apache.org/jira/browse/OAK-8760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16972595#comment-16972595
 ] 

Stefan Egli commented on OAK-8760:
----------------------------------

ah, that explains it :)

Ok, I see 2 different aspects:
# the current code works fine as it (luckily happens to) use(s) 
{{standardDateFormat}} in a single-threaded way (by {{BackgroundWorker.doRun}} 
which runs in its [own dedicated 
Thread|https://github.com/apache/jackrabbit-oak/blob/f454d227ad7418b1c7f911c67e5aead2208fdb5e/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentDiscoveryLiteService.java#L329]).
 So from that pov we're fine
# if the replacement of {{SimpleDateFormat}} with {{DateTimeFormatter}} is 
generally suggested then we of course can nevertheless go ahead. So besides 
making it thread-safe is there anything else that this fixes as a side-effect 
(referring to the usage of {{Instant}})? I'm also fine with applying the patch 
in both cases as this avoids confusion going forward (in this case the question 
is more perhaps backporting effort and whether we should do that..)

> ClusterViewDocument uses static instance og SimpleDateFormat
> ------------------------------------------------------------
>
>                 Key: OAK-8760
>                 URL: https://issues.apache.org/jira/browse/OAK-8760
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: documentmk
>            Reporter: Julian Reschke
>            Priority: Minor
>         Attachments: OAK-8760.diff
>
>
> ...which is not thread-safe.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to