File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
spring-amqp/src/main/java/org/springframework/amqp/core Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -125,17 +125,13 @@ public String toString() {
125
125
}
126
126
127
127
private String getBodyContentAsString () {
128
- if (this .body == null ) {
129
- return null ;
130
- }
131
128
try {
132
- boolean nullProps = this .messageProperties == null ;
133
- String contentType = nullProps ? null : this .messageProperties .getContentType ();
129
+ String contentType = this .messageProperties .getContentType ();
134
130
if (MessageProperties .CONTENT_TYPE_SERIALIZED_OBJECT .equals (contentType )) {
135
131
return SerializationUtils .deserialize (new ByteArrayInputStream (this .body ), ALLOWED_LIST_PATTERNS ,
136
132
ClassUtils .getDefaultClassLoader ()).toString ();
137
133
}
138
- String encoding = encoding (nullProps );
134
+ String encoding = encoding ();
139
135
if (MessageProperties .CONTENT_TYPE_TEXT_PLAIN .equals (contentType )
140
136
|| MessageProperties .CONTENT_TYPE_JSON .equals (contentType )
141
137
|| MessageProperties .CONTENT_TYPE_JSON_ALT .equals (contentType )
@@ -150,8 +146,8 @@ private String getBodyContentAsString() {
150
146
return this .body .toString () + "(byte[" + this .body .length + "])" ; //NOSONAR
151
147
}
152
148
153
- private String encoding (boolean nullProps ) {
154
- String encoding = nullProps ? null : this .messageProperties .getContentEncoding ();
149
+ private String encoding () {
150
+ String encoding = this .messageProperties .getContentEncoding ();
155
151
if (encoding == null ) {
156
152
encoding = bodyEncoding ;
157
153
}
You can’t perform that action at this time.
0 commit comments