updated MessageBuilder.copyHeadersIfAbsent with a wildcard for the Map value to be more flexible and consistent with copyHeaders

This commit is contained in:
Mark Fisher
2011-08-05 14:41:46 -04:00
parent c9b8ff0b9f
commit 71f6a7278b
2 changed files with 2 additions and 3 deletions

View File

@@ -132,8 +132,7 @@ public class AmqpOutboundEndpoint extends AbstractReplyProducingMessageHandler {
? MessageBuilder.fromMessage((Message<?>) replyObject)
: MessageBuilder.withPayload(replyObject);
Map<String, ?> headers = this.headerMapper.toHeaders(amqpReplyMessage.getMessageProperties());
// TODO: copyHeadersIfAbsent has <String, Object> instead of <String, ?>
builder.copyHeaders(headers);
builder.copyHeadersIfAbsent(headers);
return builder.build();
}

View File

@@ -183,7 +183,7 @@ public final class MessageBuilder<T> {
/**
* Copy the name-value pairs from the provided Map. This operation will <em>not</em> overwrite any existing values.
*/
public MessageBuilder<T> copyHeadersIfAbsent(Map<String, Object> headersToCopy) {
public MessageBuilder<T> copyHeadersIfAbsent(Map<String, ?> headersToCopy) {
Set<String> keys = headersToCopy.keySet();
for (String key : keys) {
if (!this.isReadOnly(key)) {