Skip to content

Commit

Permalink
Migrate from the deprecated Charsets constants (in Guava) to the Stan…
Browse files Browse the repository at this point in the history
…dardCharsets constants (in the JDK). (#971)
  • Loading branch information
kluever authored Aug 7, 2024
1 parent db47239 commit 07bbb98
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.google.api.core.ApiFuture;
import com.google.api.core.SettableApiFuture;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Charsets;
import com.google.common.base.Strings;
import com.google.common.io.BaseEncoding;
import com.google.common.net.UrlEscapers;
Expand All @@ -32,6 +31,7 @@
import java.net.URI;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
Expand Down Expand Up @@ -108,8 +108,8 @@ static Map<String, String> getQueryParamsMap(String queryString)
for (String paramPair : paramPairs) {
String[] pairParts = paramPair.split("=");
// both the first and second part will be encoded now, we must decode them
String decodedKey = URLDecoder.decode(pairParts[0], Charsets.UTF_8.name());
String decodedValue = URLDecoder.decode(pairParts[1], Charsets.UTF_8.name());
String decodedKey = URLDecoder.decode(pairParts[0], StandardCharsets.UTF_8.name());
String decodedValue = URLDecoder.decode(pairParts[1], StandardCharsets.UTF_8.name());
String runningValue = paramsMap.get(decodedKey);
if (Strings.isNullOrEmpty(runningValue)) {
runningValue = decodedValue;
Expand Down

0 comments on commit 07bbb98

Please sign in to comment.