Skip to content

Commit d6afd12

Browse files
committed
suppress the warning because we need to support Java 8
1 parent afffcae commit d6afd12

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/configuration/ConfigurationBuilder.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -900,10 +900,14 @@ private static Configuration.Proxy overlayProxyFromEnv(
900900
if (userInfo != null) {
901901
String[] usernamePassword = userInfo.split(":", 2);
902902
if (usernamePassword.length == 2) {
903-
proxyFromEnv.username =
904-
URLDecoder.decode(usernamePassword[0], StandardCharsets.UTF_8.toString());
905-
proxyFromEnv.password =
906-
URLDecoder.decode(usernamePassword[1], StandardCharsets.UTF_8.toString());
903+
// suppressing warning because URLDecoder.decode(String, Charset) is only available
904+
// since Java 10, but this project targets Java 8
905+
@SuppressWarnings("JdkObsolete")
906+
String username = URLDecoder.decode(usernamePassword[0], StandardCharsets.UTF_8.toString());
907+
@SuppressWarnings("JdkObsolete")
908+
String password = URLDecoder.decode(usernamePassword[1], StandardCharsets.UTF_8.toString());
909+
proxyFromEnv.username = username;
910+
proxyFromEnv.password = password;
907911
}
908912
}
909913
} catch (IOException e) {

0 commit comments

Comments
 (0)