Mark GrantedAuthority#getAuthority as @Nullable#18014
Mark GrantedAuthority#getAuthority as @Nullable#18014jzheaux merged 2 commits intospring-projects:mainfrom
GrantedAuthority#getAuthority as @Nullable#18014Conversation
|
Currently, the build crashes in the Note: Now it is fixed |
...a/org/springframework/security/web/access/DelegatingMissingAuthorityAccessDeniedHandler.java
Show resolved
Hide resolved
54f53fc to
e16ab55
Compare
...a/org/springframework/security/web/access/DelegatingMissingAuthorityAccessDeniedHandler.java
Outdated
Show resolved
Hide resolved
| * precision). | ||
| */ | ||
| String getAuthority(); | ||
| @Nullable String getAuthority(); |
There was a problem hiding this comment.
Question :: though this implementation supports null case, but it is supposed to be avoided (as per the documentation -> returning null should be avoided unless actually required. ) So dont we losing the feature/control with the overall changes?
@therepanic @rwinch
There was a problem hiding this comment.
@ronodhirSoumik, good question. The documentation also says that null "should be returned" in cases where it cannot be expressed with sufficient precision. In other words, returning null is recommended when needed.
jzheaux
left a comment
There was a problem hiding this comment.
Thanks, @therepanic! I've left some feedback inline.
...a/org/springframework/security/web/access/DelegatingMissingAuthorityAccessDeniedHandler.java
Outdated
Show resolved
Hide resolved
...a/org/springframework/security/web/access/DelegatingMissingAuthorityAccessDeniedHandler.java
Outdated
Show resolved
Hide resolved
|
Thanks for the review, @jzheaux. I agree with everything. It was a bad idea to mark authority as I don't think the build crashes because of the changes in the PR. |
Closes: spring-projectsgh-17999 Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
|
Thanks, @therepanic! This is now merged into |
Since the
GrantedAuthority#getAuthoritycontract itself implies that it can return null, we should mark it as@Nullable.Closes: gh-17999