Class UnsynchronizedStaticFormatterRule

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

    public class UnsynchronizedStaticFormatterRule
    extends AbstractJavaRule
    Using a Formatter (e.g. SimpleDateFormatter, DecimalFormatter) which is static can cause unexpected results when used in a multi-threaded environment. This rule will find static Formatters which are used in an unsynchronized manner.
    Author:
    Allan Caplan
    See Also:
    feature #226 Check for SimpleDateFormat as singleton?