Replace charset string with java.nio.charset.StandardCharsets constant (#2787)

Signed-off-by: Cosmin Selagea-Popov <36129697+cselagea@users.noreply.github.com>
This commit is contained in:
cselagea
2025-03-10 07:59:59 -06:00
committed by GitHub
parent 605ffa2fce
commit a7f662198b
5 changed files with 30 additions and 38 deletions

View File

@@ -16,7 +16,6 @@
package org.springframework.cloud.config.client;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
@@ -397,11 +396,11 @@ public class ConfigClientProperties {
result.username = explicitCredentials.username;
}
result.password = URLDecoder.decode(result.password, StandardCharsets.UTF_8.toString());
result.username = URLDecoder.decode(result.username, StandardCharsets.UTF_8.toString());
result.password = URLDecoder.decode(result.password, StandardCharsets.UTF_8);
result.username = URLDecoder.decode(result.username, StandardCharsets.UTF_8);
return result;
}
catch (MalformedURLException | UnsupportedEncodingException e) {
catch (MalformedURLException e) {
throw new IllegalStateException("Invalid URL: " + uri, e);
}
}