1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 00:59:39 +02:00

Use StandardCharsets.(UTF_8|US_ASCII)

This also gets rid of a ton of UnsupportedEncodingException s.
This commit is contained in:
Florian Schmaus 2019-05-08 11:34:40 +02:00
parent 2a4d110b22
commit d2f5efcb20
33 changed files with 125 additions and 227 deletions

View file

@ -16,7 +16,7 @@
*/
package org.jivesoftware.smack.sasl.provided;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import javax.security.auth.callback.CallbackHandler;
@ -103,13 +103,7 @@ public class SASLDigestMD5Mechanism extends SASLMechanism {
if (challenge.length == 0) {
throw new SmackSaslException("Initial challenge has zero length");
}
String challengeString;
try {
challengeString = new String(challenge, StringUtils.UTF8);
}
catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
String challengeString = new String(challenge, StandardCharsets.UTF_8);
String[] challengeParts = challengeString.split(",");
byte[] response = null;
switch (state) {