You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
UseLocaleWithCaseConversions could additionally check String.format(foo, bar)
Similar to toLowerCase() and toUpperCase, String.format(foo, bar) also need to specify a locale when calling the methods
Code Sample demonstrating the suggestion:
capture = String.format("You zoomed in %.2f%%.\n", percent);
// better
capture = String.format(Locale.ROOT, "You zoomed in %.2f%%.\n", percent);
Type:
Suggestions for rule improvement
Running PMD through:
CLI
The text was updated successfully, but these errors were encountered:
oowekyala
changed the title
[java]It is recommended to have UseLocaleWithCaseConversions additionally check String.format(foo, bar)
[java] UseLocaleWithCaseConversions could check String.format
Jun 14, 2020
Affects PMD Version:
6.22.0
Rule:
UseLocaleWithCaseConversions
Description:
UseLocaleWithCaseConversions could additionally check
String.format(foo, bar)
Similar to
toLowerCase()
andtoUpperCase
,String.format(foo, bar)
also need to specify a locale when calling the methodsCode Sample demonstrating the suggestion:
Type:
Suggestions for rule improvement
Running PMD through:
CLI
The text was updated successfully, but these errors were encountered: