Consistently declare Object::equals argument as @Nullable
This commit is contained in:
@@ -19,6 +19,8 @@ package org.springframework.messaging.simp.user;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
@@ -64,8 +66,8 @@ public class TestSimpSession implements SimpSession {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
return (this == other || (other instanceof SimpSession && this.id.equals(((SimpSession) other).getId())));
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
return (this == obj || (obj instanceof SimpSession that && this.id.equals(that.getId())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.messaging.simp.user;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
@@ -57,7 +58,7 @@ public class TestSimpSubscription implements SimpSubscription {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class TestSimpUser implements SimpUser {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || (other instanceof SimpUser && this.name.equals(((SimpUser) other).getName())));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user