Class UnsynchronizedStaticDateFormatterRule

  • All Implemented Interfaces:
    JavaParserVisitor, net.sourceforge.pmd.lang.rule.ImmutableLanguage, net.sourceforge.pmd.properties.PropertySource, net.sourceforge.pmd.Rule

    public class UnsynchronizedStaticDateFormatterRule
    extends AbstractJavaRule
    Using a DateFormatter (SimpleDateFormatter) which is static can cause unexpected results when used in a multi-threaded environment. This rule will find static (Simple)DateFormatters which are used in an unsynchronized manner.

    Refer to these Bug Parade issues: 4093418 4228335 4261469

    Author:
    Allan Caplan
    See Also:
    feature #226 Check for SimpleDateFormat as singleton?