mirror of
https://github.com/google/nomulus
synced 2026-09-30 11:46:22 +00:00
Enable new errorprone checks and fix violations (#3018)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user