Rename MimeType's getCharSet() to getCharset()

Issue: SPR-14172
This commit is contained in:
Juergen Hoeller
2016-04-14 16:38:59 +02:00
parent 977734cc59
commit f1cb793ccb
25 changed files with 144 additions and 129 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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) :

View File

@@ -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);
}