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() {
121
121
return SerializationUtils .deserialize (new ByteArrayInputStream (this .body ), whiteListPatterns ,
122
122
ClassUtils .getDefaultClassLoader ()).toString ();
123
123
}
124
- String encoding = nullProps ? null : this .messageProperties .getContentEncoding ();
125
- if (encoding == null ) {
126
- encoding = bodyEncoding ;
127
- }
124
+ String encoding = encoding (nullProps );
128
125
if (MessageProperties .CONTENT_TYPE_TEXT_PLAIN .equals (contentType )
129
126
|| MessageProperties .CONTENT_TYPE_JSON .equals (contentType )
130
127
|| MessageProperties .CONTENT_TYPE_JSON_ALT .equals (contentType )
@@ -139,6 +136,14 @@ private String getBodyContentAsString() {
139
136
return this .body .toString () + "(byte[" + this .body .length + "])" ; //NOSONAR
140
137
}
141
138
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
+
142
147
@ Override
143
148
public int hashCode () {
144
149
final int prime = 31 ;
You can’t perform that action at this time.
0 commit comments