Remove unnecessary copying of headers in GenericMessage
Since the MessageHeaders constructor is makes a copy of the headers and is protected against a null map, there is no need for the same to be done in GenericMessage. Issue: SPR-11268
This commit is contained in:
@@ -61,12 +61,6 @@ public class GenericMessage<T> implements Message<T>, Serializable {
|
|||||||
*/
|
*/
|
||||||
public GenericMessage(T payload, Map<String, Object> headers) {
|
public GenericMessage(T payload, Map<String, Object> headers) {
|
||||||
Assert.notNull(payload, "payload must not be null");
|
Assert.notNull(payload, "payload must not be null");
|
||||||
if (headers == null) {
|
|
||||||
headers = new HashMap<String, Object>();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
headers = new HashMap<String, Object>(headers);
|
|
||||||
}
|
|
||||||
this.headers = new MessageHeaders(headers);
|
this.headers = new MessageHeaders(headers);
|
||||||
this.payload = payload;
|
this.payload = payload;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user