Annotate Object#equals parameter with @Nullable

Closes gh-23093
This commit is contained in:
Sebastien Deleuze
2019-06-06 14:18:12 +02:00
parent 33becd8258
commit 098ac0bbb8
158 changed files with 222 additions and 176 deletions

View File

@@ -519,10 +519,10 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
// Effectively checking object equality as well as toString equality.
// On WebSphere MQ, Destination objects do not implement equals...
return (this == other || destinationEquals((DestinationCacheKey) other));
return (this == other || (other instanceof DestinationCacheKey && destinationEquals((DestinationCacheKey) other)));
}
@Override
@@ -573,7 +573,7 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -18,6 +18,8 @@ package org.springframework.jms.support;
import javax.jms.Message;
import org.springframework.lang.Nullable;
/**
* Gather the Quality-of-Service settings that can be used when sending a message.
*
@@ -108,7 +110,7 @@ public class QosSettings {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}