Class identity comparisons wherever possible (and further polishing)
Issue: SPR-12926
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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())));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user