Skip to content

Commit 07bbb98

Browse files
authored
Migrate from the deprecated Charsets constants (in Guava) to the StandardCharsets constants (in the JDK). (#971)
1 parent db47239 commit 07bbb98

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/google/firebase/database/utilities/Utilities.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import com.google.api.core.ApiFuture;
2020
import com.google.api.core.SettableApiFuture;
2121
import com.google.common.annotations.VisibleForTesting;
22-
import com.google.common.base.Charsets;
2322
import com.google.common.base.Strings;
2423
import com.google.common.io.BaseEncoding;
2524
import com.google.common.net.UrlEscapers;
@@ -32,6 +31,7 @@
3231
import java.net.URI;
3332
import java.net.URLDecoder;
3433
import java.net.URLEncoder;
34+
import java.nio.charset.StandardCharsets;
3535
import java.security.MessageDigest;
3636
import java.security.NoSuchAlgorithmException;
3737
import java.util.ArrayList;
@@ -108,8 +108,8 @@ static Map<String, String> getQueryParamsMap(String queryString)
108108
for (String paramPair : paramPairs) {
109109
String[] pairParts = paramPair.split("=");
110110
// both the first and second part will be encoded now, we must decode them
111-
String decodedKey = URLDecoder.decode(pairParts[0], Charsets.UTF_8.name());
112-
String decodedValue = URLDecoder.decode(pairParts[1], Charsets.UTF_8.name());
111+
String decodedKey = URLDecoder.decode(pairParts[0], StandardCharsets.UTF_8.name());
112+
String decodedValue = URLDecoder.decode(pairParts[1], StandardCharsets.UTF_8.name());
113113
String runningValue = paramsMap.get(decodedKey);
114114
if (Strings.isNullOrEmpty(runningValue)) {
115115
runningValue = decodedValue;

0 commit comments

Comments
 (0)