@@ -81,7 +81,7 @@ public abstract class SecurityExpressionRoot<T> implements SecurityExpressionOpe
81
81
*/
82
82
@ Deprecated (since = "7.0" )
83
83
public SecurityExpressionRoot (Authentication authentication ) {
84
- this (() -> authentication );
84
+ this (() -> authentication , null );
85
85
}
86
86
87
87
/**
@@ -94,12 +94,7 @@ public SecurityExpressionRoot(Authentication authentication) {
94
94
*/
95
95
@ Deprecated (since = "7.0" )
96
96
public SecurityExpressionRoot (Supplier <Authentication > authentication ) {
97
- this .authentication = SingletonSupplier .of (() -> {
98
- Authentication value = authentication .get ();
99
- Assert .notNull (value , "Authentication object cannot be null" );
100
- return value ;
101
- });
102
- this .object = null ;
97
+ this (authentication , null );
103
98
}
104
99
105
100
/**
@@ -110,7 +105,7 @@ public SecurityExpressionRoot(Supplier<Authentication> authentication) {
110
105
* @param object the object being authorized
111
106
* @since 7.0
112
107
*/
113
- public SecurityExpressionRoot (Supplier <Authentication > authentication , T object ) {
108
+ public SecurityExpressionRoot (Supplier <Authentication > authentication , @ Nullable T object ) {
114
109
this .authentication = SingletonSupplier .of (() -> {
115
110
Authentication value = authentication .get ();
116
111
Assert .notNull (value , "Authentication object cannot be null" );
@@ -174,7 +169,7 @@ public final boolean isFullyAuthenticated() {
174
169
return isGranted (this .authorizationManagerFactory .fullyAuthenticated ());
175
170
}
176
171
177
- @ SuppressWarnings ("DataFlowIssue" )
172
+ @ SuppressWarnings ({ "DataFlowIssue" , "NullAway" } )
178
173
private boolean isGranted (AuthorizationManager <T > authorizationManager ) {
179
174
AuthorizationResult authorizationResult = authorizationManager .authorize (this .authentication , this .object );
180
175
return (authorizationResult != null && authorizationResult .isGranted ());
0 commit comments