File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
spring-amqp/src/main/java/org/springframework/amqp/core Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -121,10 +121,7 @@ private String getBodyContentAsString() {
121121 return SerializationUtils .deserialize (new ByteArrayInputStream (this .body ), whiteListPatterns ,
122122 ClassUtils .getDefaultClassLoader ()).toString ();
123123 }
124- String encoding = nullProps ? null : this .messageProperties .getContentEncoding ();
125- if (encoding == null ) {
126- encoding = bodyEncoding ;
127- }
124+ String encoding = encoding (nullProps );
128125 if (MessageProperties .CONTENT_TYPE_TEXT_PLAIN .equals (contentType )
129126 || MessageProperties .CONTENT_TYPE_JSON .equals (contentType )
130127 || MessageProperties .CONTENT_TYPE_JSON_ALT .equals (contentType )
@@ -139,6 +136,14 @@ private String getBodyContentAsString() {
139136 return this .body .toString () + "(byte[" + this .body .length + "])" ; //NOSONAR
140137 }
141138
139+ private String encoding (boolean nullProps ) {
140+ String encoding = nullProps ? null : this .messageProperties .getContentEncoding ();
141+ if (encoding == null ) {
142+ encoding = bodyEncoding ;
143+ }
144+ return encoding ;
145+ }
146+
142147 @ Override
143148 public int hashCode () {
144149 final int prime = 31 ;
You can’t perform that action at this time.
0 commit comments