Consistently declare Object::equals argument as @Nullable

This commit is contained in:
Sam Brannen
2023-03-13 21:43:21 +01:00
parent a6dab10309
commit 00be19c647
74 changed files with 149 additions and 103 deletions

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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())));
}