GROOVY-12055: Assess toLower/UpperCase calls which should use Locale.…#2579
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes locale-sensitive case conversions deterministic by using Locale.ROOT for internal identifiers, option parsing, OS checks, file extensions, and enum lookups across Groovy modules.
Changes:
- Replaces default-locale
toLowerCase()/toUpperCase()calls withLocale.ROOT. - Adds
java.util.Localeimports where needed in Java sources. - Applies the change across console, groovysh, SQL, Swing, Grape, GroovyDoc, templates, and core utilities.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
subprojects/groovy-typecheckers/src/main/groovy/groovy/typecheckers/PurityChecker.groovy |
Normalizes allow-list parsing with root locale. |
subprojects/groovy-test/src/main/groovy/groovy/mock/interceptor/MockInterceptor.groovy |
Uses root locale for mock getter/setter name construction. |
subprojects/groovy-templates/src/main/groovy/groovy/text/markup/MarkupBuilderCodeTransformer.java |
Uses root locale for include type lookup. |
subprojects/groovy-swing/src/main/groovy/groovy/swing/SwingBuilder.groovy |
Normalizes focus condition strings with root locale. |
subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/LayoutFactory.groovy |
Checks uppercase layout constants with root locale. |
subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java |
Uses root locale during SQL keyword scanning. |
subprojects/groovy-sql/src/main/java/groovy/sql/ResultSetMetaDataWrapper.java |
Uses root locale for metadata getter name construction. |
subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyEngine.java |
Normalizes groovysh serialization formats with root locale. |
subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyConsoleEngine.groovy |
Uses root locale for command enum lookup. |
subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyCommands.groovy |
Normalizes command format option values with root locale. |
subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyBuiltins.groovy |
Uses root locale for built-in command enum lookup. |
subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/GroovyDocTool.java |
Normalizes Java language level strings with root locale. |
subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/antlr4/GroovyDocParser.java |
Normalizes GroovyDoc parser phase names with root locale. |
subprojects/groovy-grape-maven/src/main/groovy/groovy/grape/maven/GrapeMaven.groovy |
Normalizes OS name and architecture detection with root locale. |
subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/GinqAstWalker.groovy |
Uses root locale when checking join names. |
subprojects/groovy-console/src/main/groovy/groovy/console/ui/ThemeManager.groovy |
Normalizes theme keys, OS checks, and style parsing with root locale. |
subprojects/groovy-console/src/main/groovy/groovy/console/ui/ConsoleTextEditor.java |
Uses root locale for macOS detection. |
subprojects/groovy-console/src/main/groovy/groovy/console/ui/Console.groovy |
Uses root locale for OS name and file extension normalization. |
src/main/java/org/codehaus/groovy/tools/javac/JavaStubCompilationUnit.java |
Uses root locale for accepted file extension checks. |
src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java |
Normalizes warning-level configuration with root locale. |
src/main/java/org/apache/groovy/ast/tools/ClassNodeUtils.java |
Uses root locale for accessor-to-property name conversion. |
src/main/java/groovy/util/ObjectGraphBuilder.java |
Uses root locale for generated class/node name casing. |
src/main/groovy/groovy/grape/GrapeUtil.groovy |
Uses root locale for JAR extension detection. |
src/main/groovy/groovy/beans/ListenerListASTStubber.groovy |
Uses root locale for generated listener method names. |
✅ All tests passed ✅🏷️ Commit: 7696025 Learn more about TestLens at testlens.app. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ROOT