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:
Rossen Stoyanchev 2014-01-02 11:35:31 -05:00
parent 12fe9174f0
commit 3b14e974f8
1 changed files with 0 additions and 6 deletions

View File

@ -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;
}