updated MessageBuilder.copyHeadersIfAbsent with a wildcard for the Map value to be more flexible and consistent with copyHeaders
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user