mirror of
https://github.com/google/nomulus.git
synced 2025-06-26 22:34:55 +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
|
@ -26,6 +26,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
|
|||
import com.google.appengine.api.urlfetch.HTTPHeader;
|
||||
import com.google.appengine.api.urlfetch.HTTPRequest;
|
||||
import com.google.appengine.api.urlfetch.HTTPResponse;
|
||||
import com.google.common.base.Ascii;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.net.MediaType;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
@ -49,9 +50,9 @@ public final class UrlFetchUtils {
|
|||
}
|
||||
|
||||
private static Optional<String> getHeaderFirstInternal(Iterable<HTTPHeader> hdrs, String name) {
|
||||
name = name.toLowerCase();
|
||||
name = Ascii.toLowerCase(name);
|
||||
for (HTTPHeader header : hdrs) {
|
||||
if (header.getName().toLowerCase().equals(name)) {
|
||||
if (Ascii.toLowerCase(header.getName()).equals(name)) {
|
||||
return Optional.of(header.getValue());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue