Closed lacasseio closed 3 months ago
It is advisable to use Locale.ROOT for case sensitive work: https://garygregory.wordpress.com/2015/11/03/java-lowercase-conversion-turkey/
This is still an issue.
git grep toLowerCase\(\) | grep main | wc -l
shows over 100 instances where this could be a problem.
Most prominent place: :-D
There's also toUpperCase
to check 😄
Another instances of this problem: #17361, #17383
I suppose writing an architecture test with archunit should also be pretty straightforward. Spotbugs also finds these problems.
Might also be worth to consider integrating https://github.com/policeman-tools/forbidden-apis in this context? It can detect these methods and also other methods which implicitly depend on the OS settings.
This issue should address all the current instances in a unified way.
For adding a code quality check, see:
Expected Behavior
Using a different
Locale
than English shouldn't cause unexpected behavior in Gradle.Current Behavior
Using Turkish locale can cause unexpected behavior in presence of dotless i character (upper->lower). Various place in the code base is vulnerable to this
Locale
sensitivity. Some places are fixed by rolling out a contextual fix.Context
This started with PR https://github.com/gradle/gradle/pull/1408. @wolfs suggest we use Findbugs or Pmd to check for this kind of bug. @sterling suggest using a utility method to address this problem:
A quick search in the codebase reveal lots of potential areas that could be affected.