Skip to content

Commit dbf7f4c

Browse files
ngocnhan-tran1996rwinch
authored andcommitted
Remove unused @Nullable
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
1 parent f27738c commit dbf7f4c

3 files changed

Lines changed: 2 additions & 4 deletions

File tree

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ public final class FactorGrantedAuthority implements GrantedAuthority {
8888

8989
private final Instant issuedAt;
9090

91-
@SuppressWarnings("NullAway")
9291
private FactorGrantedAuthority(String authority, Instant issuedAt) {
9392
Assert.notNull(authority, "authority cannot be null");
9493
Assert.notNull(issuedAt, "issuedAt cannot be null");

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ private UsernamePasswordAuthenticationToken createSwitchUserToken(HttpServletReq
303303
// grant an additional authority that contains the original Authentication object
304304
// which will be used to 'exit' from the current switched user.
305305
Authentication currentAuthentication = getCurrentAuthentication(request);
306+
Assert.notNull(currentAuthentication, "currentAuthentication cannot be null");
306307
GrantedAuthority switchAuthority = new SwitchUserGrantedAuthority(this.switchAuthorityRole,
307308
currentAuthentication);
308309
// get the original authorities

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package org.springframework.security.web.authentication.switchuser;
1818

19-
import org.jspecify.annotations.Nullable;
20-
2119
import org.springframework.security.core.Authentication;
2220
import org.springframework.security.core.GrantedAuthority;
2321
import org.springframework.util.Assert;
@@ -40,7 +38,7 @@ public final class SwitchUserGrantedAuthority implements GrantedAuthority {
4038

4139
private final Authentication source;
4240

43-
public SwitchUserGrantedAuthority(String role, @Nullable Authentication source) {
41+
public SwitchUserGrantedAuthority(String role, Authentication source) {
4442
Assert.notNull(role, "role cannot be null");
4543
Assert.notNull(source, "source cannot be null");
4644
this.role = role;

0 commit comments

Comments
 (0)