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:
parent
12fe9174f0
commit
3b14e974f8
|
@ -61,12 +61,6 @@ public class GenericMessage<T> implements Message<T>, Serializable {
|
|||
*/
|
||||
public GenericMessage(T payload, Map<String, Object> headers) {
|
||||
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.payload = payload;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue