Alfusainey Jallow created OAK-4271:
--------------------------------------

             Summary: 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


 
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)

Reply via email to