Class identity comparisons wherever possible (and further polishing)

Issue: SPR-12926
This commit is contained in:
Juergen Hoeller
2015-12-09 12:28:09 +01:00
parent 4261f34b63
commit 11806b9215
29 changed files with 127 additions and 109 deletions

View File

@@ -276,7 +276,7 @@ class CachedMessageProducer implements MessageProducer, QueueSender, TopicPublis
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
try {
if (method.getName().equals("send") && args != null &&
completionListenerClass.equals(method.getParameterTypes()[args.length - 1])) {
completionListenerClass == method.getParameterTypes()[args.length - 1]) {
switch (args.length) {
case 2: // send(message, completionListener)
return sendWithCompletionListenerMethod.invoke(

View File

@@ -528,7 +528,7 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
}
protected boolean destinationEquals(DestinationCacheKey otherKey) {
return (this.destination.getClass().equals(otherKey.destination.getClass()) &&
return (this.destination.getClass() == otherKey.destination.getClass() &&
(this.destination.equals(otherKey.destination) ||
getDestinationString().equals(otherKey.getDestinationString())));
}