return null;
}
- type = type.trim().toLowerCase(Locale.US);
+ type = type.trim().toLowerCase(Locale.ROOT);
final int semicolonIndex = type.indexOf(';');
if (semicolonIndex != -1) {
if (sql.length() < 3) {
return STATEMENT_OTHER;
}
- String prefixSql = sql.substring(0, 3).toUpperCase(Locale.US);
+ String prefixSql = sql.substring(0, 3).toUpperCase(Locale.ROOT);
if (prefixSql.equals("SEL")) {
return STATEMENT_SELECT;
} else if (prefixSql.equals("INS") ||
package android.net;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
}
// insert the headers with the name in lowercase so that
// we can easily find common headers
- m.mHeaders.put(Uri.decode(nameval[0]).toLowerCase(),
+ m.mHeaders.put(Uri.decode(nameval[0]).toLowerCase(Locale.ROOT),
nameval.length > 1 ? Uri.decode(nameval[1]) : null);
}
}
package android.net;
import android.util.Log;
+import java.util.Locale;
/**
* Describes the buildtime configuration of a network.
*/
public NetworkConfig(String init) {
String fragments[] = init.split(",");
- name = fragments[0].trim().toLowerCase();
+ name = fragments[0].trim().toLowerCase(Locale.ROOT);
type = Integer.parseInt(fragments[1]);
radio = Integer.parseInt(fragments[2]);
priority = Integer.parseInt(fragments[3]);
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
+import java.util.Locale;
/**
* A container class for the http proxy info
if (mExclusionList == null) {
mParsedExclusionList = new String[0];
} else {
- String splitExclusionList[] = exclusionList.toLowerCase().split(",");
+ String splitExclusionList[] = exclusionList.toLowerCase(Locale.ROOT).split(",");
mParsedExclusionList = new String[splitExclusionList.length * 2];
for (int i = 0; i < splitExclusionList.length; i++) {
String s = splitExclusionList[i].trim();
if (flag == null) {
return defaultValue;
}
- flag = flag.toLowerCase();
+ flag = flag.toLowerCase(Locale.ROOT);
return (!"false".equals(flag) && !"0".equals(flag));
}
public Uri normalizeScheme() {
String scheme = getScheme();
if (scheme == null) return this; // give up
- String lowerScheme = scheme.toLowerCase(Locale.US);
+ String lowerScheme = scheme.toLowerCase(Locale.ROOT);
if (scheme.equals(lowerScheme)) return this; // no change
return buildUpon().scheme(lowerScheme).build();
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Set;
import java.util.StringTokenizer;
int length = value.length();
if ((mFlags & SCRIPT_URL_OK) != 0) {
if (length >= MIN_SCRIPT_PREFIX_LENGTH) {
- String asLower = value.toLowerCase();
+ String asLower = value.toLowerCase(Locale.ROOT);
if (asLower.startsWith(JAVASCRIPT_PREFIX) ||
asLower.startsWith(VBSCRIPT_PREFIX)) {
return "";
import static android.util.Patterns.GOOD_IRI_CHAR;
+import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
String t;
if (m.matches()) {
t = m.group(MATCH_GROUP_SCHEME);
- if (t != null) mScheme = t.toLowerCase();
+ if (t != null) mScheme = t.toLowerCase(Locale.ROOT);
t = m.group(MATCH_GROUP_AUTHORITY);
if (t != null) mAuthInfo = t;
t = m.group(MATCH_GROUP_HOST);
package android.net.http;
+import java.util.Locale;
+
/**
* HttpAuthHeader: a class to store HTTP authentication-header parameters.
* For more information, see: RFC 2617: HTTP Authentication.
}
if (token.equalsIgnoreCase(QOP_TOKEN)) {
- mQop = value.toLowerCase();
+ mQop = value.toLowerCase(Locale.ROOT);
return;
}
if (token.equalsIgnoreCase(ALGORITHM_TOKEN)) {
- mAlgorithm = value.toLowerCase();
+ mAlgorithm = value.toLowerCase(Locale.ROOT);
return;
}
}
import java.net.Socket;
import java.security.KeyManagementException;
import java.security.cert.X509Certificate;
+import java.util.Locale;
/**
* A Connection connecting to a secure http server or tunneling through
// to add 'host' header unless we want proxy to answer us with a
// 400 Bad Request
for (Header h : req.mHttpRequest.getAllHeaders()) {
- String headerName = h.getName().toLowerCase();
+ String headerName = h.getName().toLowerCase(Locale.ROOT);
if (headerName.startsWith("proxy") || headerName.equals("keep-alive")
|| headerName.equals("host")) {
proxyReq.addHeader(h);
if (domain == null) throw new NullPointerException("domain is null");
if (type == null) throw new NullPointerException("type is null");
- domain = domain.trim().toLowerCase(Locale.US);
- type = type.trim().toLowerCase(Locale.US);
+ domain = domain.trim().toLowerCase(Locale.ROOT);
+ type = type.trim().toLowerCase(Locale.ROOT);
if (domain.length() == 0) throw new IllegalArgumentException("domain is empty");
if (type.length() == 0) throw new IllegalArgumentException("type is empty");
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Locale;
/**
* The Settings provider contains global system-level device preferences.
* @hide
*/
public static final String getBluetoothHeadsetPriorityKey(String address) {
- return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase();
+ return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
}
/**
* @hide
*/
public static final String getBluetoothA2dpSinkPriorityKey(String address) {
- return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase();
+ return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
}
/**
* @hide
*/
public static final String getBluetoothInputDevicePriorityKey(String address) {
- return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase();
+ return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
}
/**
public static String getConfigDir(Locale locale) {
if (locale == null) locale = Locale.US;
String dir = "/system/usr/srec/config/" +
- locale.toString().replace('_', '.').toLowerCase();
+ locale.toString().replace('_', '.').toLowerCase(Locale.ROOT);
if ((new File(dir)).isDirectory()) return dir;
return null;
}
String scheme, MatchFilter matchFilter,
TransformFilter transformFilter) {
boolean hasMatches = false;
- String prefix = (scheme == null) ? "" : scheme.toLowerCase();
+ String prefix = (scheme == null) ? "" : scheme.toLowerCase(Locale.ROOT);
Matcher m = p.matcher(s);
while (m.find()) {
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
+import java.util.Locale;
/**
* <p>Various utilities for debugging and logging.</p>
Class<?> parent = klass;
do {
declaredMethod = parent.getDeclaredMethod("get" +
- pair[0].substring(0, 1).toUpperCase() +
+ pair[0].substring(0, 1).toUpperCase(Locale.ROOT) +
pair[0].substring(1),
(Class[]) null);
} while ((parent = klass.getSuperclass()) != null &&
package android.webkit;
import java.io.UnsupportedEncodingException;
+import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
}
}
if (extension == null) {
- if (mimeType != null && mimeType.toLowerCase().startsWith("text/")) {
+ if (mimeType != null && mimeType.toLowerCase(Locale.ROOT).startsWith("text/")) {
if (mimeType.equalsIgnoreCase("text/html")) {
extension = ".html";
} else {