You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Alfusainey Jallow (JIRA)" <ji...@apache.org> on 2016/04/21 20:10:25 UTC
[jira] [Updated] (OAK-4271) Call to method of static
java.text.DateFormat in MigrationOptions.logOptions()
[ https://issues.apache.org/jira/browse/OAK-4271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alfusainey Jallow updated OAK-4271:
-----------------------------------
Attachment: fix-call-to-method-of-static-DateFormat.patch
> Call to method of static java.text.DateFormat in MigrationOptions.logOptions()
> ------------------------------------------------------------------------------
>
> Key: OAK-4271
> URL: https://issues.apache.org/jira/browse/OAK-4271
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: upgrade
> Reporter: Alfusainey Jallow
> Priority: Trivial
> Attachments: fix-call-to-method-of-static-DateFormat.patch
>
>
>
> Findbugs warns that the static `DATE_FORMAT` date field is suspicious, claiming that it is unsafe for use in a multithreaded way
> ``` Bug: Call to method of static java.text.DateFormat in org.apache.jackrabbit.oak.upgrade.cli.parser.MigrationOptions.logOptions()
> As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use. The detector has found a call to an instance of DateFormat that has been obtained via a static field. This looks suspicous.```
> IMHO by looking at the code, the field can be made a final field and initialized once in the constructor, since it is mostly used in private methods of the same class for the purpose of formating dates
> what is not clear to me is whether this will ever be used in a concurrent context
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)