Rename MimeType's getCharSet() to getCharset()
Issue: SPR-14172
This commit is contained in:
@@ -300,8 +300,8 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter {
|
||||
* @return the JSON encoding to use (never {@code null})
|
||||
*/
|
||||
protected JsonEncoding getJsonEncoding(MimeType contentType) {
|
||||
if ((contentType != null) && (contentType.getCharSet() != null)) {
|
||||
Charset charset = contentType.getCharSet();
|
||||
if ((contentType != null) && (contentType.getCharset() != null)) {
|
||||
Charset charset = contentType.getCharset();
|
||||
for (JsonEncoding encoding : JsonEncoding.values()) {
|
||||
if (charset.name().equals(encoding.getJavaName())) {
|
||||
return encoding;
|
||||
|
||||
@@ -66,8 +66,8 @@ public class StringMessageConverter extends AbstractMessageConverter {
|
||||
}
|
||||
|
||||
private Charset getContentTypeCharset(MimeType mimeType) {
|
||||
if (mimeType != null && mimeType.getCharSet() != null) {
|
||||
return mimeType.getCharSet();
|
||||
if (mimeType != null && mimeType.getCharset() != null) {
|
||||
return mimeType.getCharset();
|
||||
}
|
||||
else {
|
||||
return this.defaultCharset;
|
||||
|
||||
@@ -440,7 +440,7 @@ public class StompHeaderAccessor extends SimpMessageHeaderAccessor {
|
||||
if (bytes.length == 0 || getContentType() == null || !isReadableContentType()) {
|
||||
return contentType;
|
||||
}
|
||||
Charset charset = getContentType().getCharSet();
|
||||
Charset charset = getContentType().getCharset();
|
||||
charset = (charset != null ? charset : StompDecoder.UTF8_CHARSET);
|
||||
return (bytes.length < 80) ?
|
||||
contentType + " payload=" + new String(bytes, charset) :
|
||||
|
||||
@@ -501,7 +501,7 @@ public class MessageHeaderAccessor {
|
||||
else if (payload instanceof byte[]) {
|
||||
byte[] bytes = (byte[]) payload;
|
||||
if (isReadableContentType()) {
|
||||
Charset charset = getContentType().getCharSet();
|
||||
Charset charset = getContentType().getCharset();
|
||||
charset = (charset != null ? charset : DEFAULT_CHARSET);
|
||||
return (bytes.length < 80) ?
|
||||
" payload=" + new String(bytes, charset) :
|
||||
@@ -526,7 +526,7 @@ public class MessageHeaderAccessor {
|
||||
else if (payload instanceof byte[]) {
|
||||
byte[] bytes = (byte[]) payload;
|
||||
if (isReadableContentType()) {
|
||||
Charset charset = getContentType().getCharSet();
|
||||
Charset charset = getContentType().getCharset();
|
||||
charset = (charset != null ? charset : DEFAULT_CHARSET);
|
||||
return " payload=" + new String(bytes, charset);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user