Polishing

This commit is contained in:
Juergen Hoeller
2019-06-12 00:51:09 +02:00
parent bb7096b024
commit 8d5c36269e
31 changed files with 143 additions and 159 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -577,6 +577,9 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
if (this == other) {
return true;
}
if (!(other instanceof ConsumerCacheKey)) {
return false;
}
ConsumerCacheKey otherKey = (ConsumerCacheKey) other;
return (destinationEquals(otherKey) &&
ObjectUtils.nullSafeEquals(this.selector, otherKey.selector) &&
@@ -585,6 +588,11 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
this.durable == otherKey.durable);
}
@Override
public int hashCode() {
return 31 * super.hashCode() + ObjectUtils.nullSafeHashCode(this.selector);
}
@Override
public String toString() {
return super.toString() + " [selector=" + this.selector + ", noLocal=" + this.noLocal +

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -92,10 +92,11 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
logger.info("Failed to set JMSType - skipping", ex);
}
}
Set<String> headerNames = headers.keySet();
for (String headerName : headerNames) {
Set<Map.Entry<String, Object>> entries = headers.entrySet();
for (Map.Entry<String, Object> entry : entries) {
String headerName = entry.getKey();
if (StringUtils.hasText(headerName) && !headerName.startsWith(JmsHeaders.PREFIX)) {
Object value = headers.get(headerName);
Object value = entry.getValue();
if (value != null && SUPPORTED_PROPERTY_TYPES.contains(value.getClass())) {
try {
String propertyName = this.fromHeaderName(headerName);