Skip to content

Commit 042d63c

Browse files
authored
Clarify that class Ascii is from Guava.
This avoids initial confusion for stupid users (like me!) who when working outside of Google internal codebase and when first encountering this error go look for class Ascii in the JDK.
1 parent f425700 commit 042d63c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

core/src/main/java/com/google/errorprone/bugpatterns/StringCaseLocaleUsage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private static SuggestedFix suggestAscii(MethodInvocationTree tree, VisitorState
8686
var fix =
8787
SuggestedFix.builder()
8888
.setShortDescription(
89-
"Replace with Ascii.toLower/UpperCase; this changes behaviour for non-ASCII"
89+
"Replace with Guava's Ascii.toLower/UpperCase; this changes behaviour for non-ASCII"
9090
+ " Strings");
9191
String ascii = SuggestedFixes.qualifyType(state, fix, "com.google.common.base.Ascii");
9292
fix.replace(

docs/bugpattern/StringCaseLocaleUsage.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ If this kind of regionalisation is desired, use
1010
`.toLowerCase(Locale.getDefault())` to make that explicit. If not,
1111
`.toLowerCase(Locale.ROOT)` or `.toLowerCase(Locale.ENGLISH)` will give you
1212
casing independent of the user's current `Locale`. If you know that you're
13-
operating on ASCII, prefer `Ascii.toLower/UpperCase` to make that explicit.
13+
operating on ASCII, prefer `Ascii.toLower/UpperCase` (from Guava, if available)
14+
to make that explicit.

0 commit comments

Comments
 (0)