1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Fix equals nullability annotations for jspecify compliance

In this commit, we added `@Nullable` to equals methods of classes that
support `jspecify` for consistency with other Spring projects and to
avoid bugs that caused other Spring projects to do this natively.

Closes: gh-18929, gh-18927

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
This commit is contained in:
Andrey Litvitski
2026-03-18 17:25:52 +03:00
committed by Josh Cummings
parent 330c565178
commit 2fda37de53
62 changed files with 125 additions and 68 deletions
@@ -99,13 +99,16 @@ public class KerberosServiceRequestToken extends AbstractAuthenticationToken imp
* equals() is based only on the Kerberos token
*/
@Override
public boolean equals(Object obj) {
public boolean equals(@Nullable Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}