Remove unused @Nullable

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit is contained in:
Tran Ngoc Nhan 2026-02-19 17:55:08 +07:00 committed by Rob Winch
parent f27738c1f8
commit dbf7f4cfe5
3 changed files with 2 additions and 4 deletions

View File

@ -88,7 +88,6 @@ public final class FactorGrantedAuthority implements GrantedAuthority {
private final Instant issuedAt;
@SuppressWarnings("NullAway")
private FactorGrantedAuthority(String authority, Instant issuedAt) {
Assert.notNull(authority, "authority cannot be null");
Assert.notNull(issuedAt, "issuedAt cannot be null");

View File

@ -303,6 +303,7 @@ public class SwitchUserFilter extends GenericFilterBean implements ApplicationEv
// grant an additional authority that contains the original Authentication object
// which will be used to 'exit' from the current switched user.
Authentication currentAuthentication = getCurrentAuthentication(request);
Assert.notNull(currentAuthentication, "currentAuthentication cannot be null");
GrantedAuthority switchAuthority = new SwitchUserGrantedAuthority(this.switchAuthorityRole,
currentAuthentication);
// get the original authorities

View File

@ -16,8 +16,6 @@
package org.springframework.security.web.authentication.switchuser;
import org.jspecify.annotations.Nullable;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.util.Assert;
@ -40,7 +38,7 @@ public final class SwitchUserGrantedAuthority implements GrantedAuthority {
private final Authentication source;
public SwitchUserGrantedAuthority(String role, @Nullable Authentication source) {
public SwitchUserGrantedAuthority(String role, Authentication source) {
Assert.notNull(role, "role cannot be null");
Assert.notNull(source, "source cannot be null");
this.role = role;