mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Replace to(Upper|Lower)Case with Ascii.to$1Case
The presubmits are warning that toUpperCase() and toLowerCase() are locale-specific, and advise using Ascii.toUpperCase() and Ascii.toLowerCase() as a local-invariant alternative. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=127583677
This commit is contained in:
parent
d9596fa30c
commit
e72491e59b
22 changed files with 62 additions and 38 deletions
|
@ -19,6 +19,7 @@ import static com.google.common.collect.Range.atMost;
|
|||
import static com.google.common.collect.Range.closed;
|
||||
import static google.registry.util.DomainNameUtils.canonicalizeDomainName;
|
||||
|
||||
import com.google.common.base.Ascii;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
@ -354,7 +355,7 @@ public final class RegistrarFormFields {
|
|||
}
|
||||
for (String state : stateField.extractUntyped(args).asSet()) {
|
||||
if ("US".equals(countryCode)) {
|
||||
state = state.toUpperCase();
|
||||
state = Ascii.toUpperCase(state);
|
||||
if (!StateCode.US_MAP.containsKey(state)) {
|
||||
throw new FormFieldException(stateField, "Unknown US state code.");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue