Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: net/android/java/src/org/chromium/net/NetStringUtil.java

Issue 522943003: [Android] Fix findbugs errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed threading issues in HttpAuthDatabase constructor Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/android/java/src/org/chromium/media/MediaDrmBridge.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/android/java/src/org/chromium/net/NetStringUtil.java
diff --git a/net/android/java/src/org/chromium/net/NetStringUtil.java b/net/android/java/src/org/chromium/net/NetStringUtil.java
index 4ab1bd9f5bd8f7eb98edaffb119fa814f8202d6e..81bcfee1638f8be8063a0ebd28faf3466f042801 100644
--- a/net/android/java/src/org/chromium/net/NetStringUtil.java
+++ b/net/android/java/src/org/chromium/net/NetStringUtil.java
@@ -23,15 +23,15 @@ public class NetStringUtil {
* Attempts to convert text in a given character set to a Unicode string.
* Returns null on failure.
* @param text ByteBuffer containing the character array to convert.
- * @param charset Character set it's in encoded in.
+ * @param charsetName Character set it's in encoded in.
* @return: Unicode string on success, null on failure.
*/
@CalledByNative
private static String convertToUnicode(
ByteBuffer text,
- String charset_name) {
+ String charsetName) {
try {
- Charset charset = Charset.forName(charset_name);
+ Charset charset = Charset.forName(charsetName);
CharsetDecoder decoder = charset.newDecoder();
// On invalid characters, this will throw an exception.
return decoder.decode(text).toString();
@@ -44,16 +44,15 @@ public class NetStringUtil {
* Attempts to convert text in a given character set to a Unicode string,
* and normalize it. Returns null on failure.
* @param text ByteBuffer containing the character array to convert.
- * @param charset Character set it's in encoded in.
+ * @param charsetName Character set it's in encoded in.
* @return: Unicode string on success, null on failure.
*/
@CalledByNative
private static String convertToUnicodeAndNormalize(
ByteBuffer text,
- String charset_name) {
- String unicodeString = convertToUnicode(text, charset_name);
- if (unicodeString == null)
- return unicodeString;
+ String charsetName) {
+ String unicodeString = convertToUnicode(text, charsetName);
+ if (unicodeString == null) return null;
return Normalizer.normalize(unicodeString, Normalizer.Form.NFC);
}
@@ -62,15 +61,15 @@ public class NetStringUtil {
* characters are replaced with U+FFFD. Returns null if the character set
* is not recognized.
* @param text ByteBuffer containing the character array to convert.
- * @param charset Character set it's in encoded in.
+ * @param charsetName Character set it's in encoded in.
* @return: Unicode string on success, null on failure.
*/
@CalledByNative
private static String convertToUnicodeWithSubstitutions(
ByteBuffer text,
- String charset_name) {
+ String charsetName) {
try {
- Charset charset = Charset.forName(charset_name);
+ Charset charset = Charset.forName(charsetName);
// TODO(mmenke): Investigate if Charset.decode() can be used
// instead. The question is whether it uses the proper replace
« no previous file with comments | « media/base/android/java/src/org/chromium/media/MediaDrmBridge.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698