Browse Source

Remove unused `@Nullable`

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
pull/18634/head
Tran Ngoc Nhan 1 month ago committed by Rob Winch
parent
commit
dbf7f4cfe5
  1. 1
      core/src/main/java/org/springframework/security/core/authority/FactorGrantedAuthority.java
  2. 1
      web/src/main/java/org/springframework/security/web/authentication/switchuser/SwitchUserFilter.java
  3. 4
      web/src/main/java/org/springframework/security/web/authentication/switchuser/SwitchUserGrantedAuthority.java

1
core/src/main/java/org/springframework/security/core/authority/FactorGrantedAuthority.java

@ -88,7 +88,6 @@ public final class FactorGrantedAuthority implements GrantedAuthority { @@ -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");

1
web/src/main/java/org/springframework/security/web/authentication/switchuser/SwitchUserFilter.java

@ -303,6 +303,7 @@ public class SwitchUserFilter extends GenericFilterBean implements ApplicationEv @@ -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

4
web/src/main/java/org/springframework/security/web/authentication/switchuser/SwitchUserGrantedAuthority.java

@ -16,8 +16,6 @@ @@ -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 { @@ -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;

Loading…
Cancel
Save