[java] UseLocaleWithCaseConversions - false positive with a non-String class #4277
Labels
a:false-positive
PMD flags a piece of code that is not problematic
Milestone
Affects PMD Version: 6.53.0
Rule: UseLocaleWithCaseConversions
Description: The class
Ulid
has atoLowerCase()
method, but no overloads take a locale. The classUlid
is not a string.Code Sample demonstrating the issue:
Expected outcome:
PMD reports a violation "UseLocaleWithCaseConversions: When doing a String.toLowerCase()/toUpperCase() call, use a Locale" at line 4, but that's wrong. That's a false positive.
Running PMD through: CLI
Additional info:
Ulid
: https://github.com/f4b6a3/ulid-creator/blob/dc0082bad6bc7d43f9a416971886f146ad26a4e2/src/main/java/com/github/f4b6a3/ulid/Ulid.java#L437The text was updated successfully, but these errors were encountered: