resources.report.rules.pmd.SimpleDateFormatNeedsLocale.html Maven / Gradle / Ivy
SimpleDateFormatNeedsLocale
SimpleDateFormatNeedsLocale
Be sure to specify a Locale when creating SimpleDateFormat instances to ensure that locale-appropriate formatting is used.
//AllocationExpression
[ClassOrInterfaceType[@Image='SimpleDateFormat']]
[Arguments[@ArgumentCount=1]]
Example(s):
public class Foo {
// Should specify Locale.US (or whatever)
private SimpleDateFormat sdf = new SimpleDateFormat("pattern");
}