From 3b14e974f84b453fd9456ea5d372906fa04dc5e2 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Thu, 2 Jan 2014 11:35:31 -0500 Subject: [PATCH] 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 --- .../springframework/messaging/support/GenericMessage.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/GenericMessage.java b/spring-messaging/src/main/java/org/springframework/messaging/support/GenericMessage.java index 03b65547c9..7a1409442d 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/GenericMessage.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/GenericMessage.java @@ -61,12 +61,6 @@ public class GenericMessage implements Message, Serializable { */ public GenericMessage(T payload, Map headers) { Assert.notNull(payload, "payload must not be null"); - if (headers == null) { - headers = new HashMap(); - } - else { - headers = new HashMap(headers); - } this.headers = new MessageHeaders(headers); this.payload = payload; }