Enable new errorprone checks and fix violations (#3018)

This commit is contained in:
Weimin Yu
2026-04-20 21:03:36 +00:00
committed by GitHub
parent 9d5650132b
commit 3de790fb00
98 changed files with 406 additions and 444 deletions
@@ -26,7 +26,6 @@ import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.util.Collections;
import java.util.HashMap;
@@ -302,12 +301,9 @@ public class EppMessage {
throw new EppClientException("unknown error converting Document to intermediate string");
}
String encoding = xml.getXmlEncoding();
// this is actually not a problem since we can just use the default
if (encoding == null) {
encoding = Charset.defaultCharset().name();
}
return resultString.getBytes(encoding);
} catch (TransformerException | UnsupportedEncodingException e) {
Charset charset = (encoding == null) ? Charset.defaultCharset() : Charset.forName(encoding);
return resultString.getBytes(charset);
} catch (TransformerException e) {
throw new EppClientException(e);
}
}