Skip to content

Commit 8ae5f2e

Browse files
committed
Polishing.
Use mapNotNull(…) instead of filter + map. See #3413
1 parent ccc2975 commit 8ae5f2e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/antora/modules/ROOT/pages/auditing.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,9 @@ class SpringSecurityAuditorAware implements ReactiveAuditorAware<User> {
104104
public Mono<User> getCurrentAuditor() {
105105
106106
return ReactiveSecurityContextHolder.getContext()
107-
.filter(it -> it.getAuthentication() != null)
108-
.map(SecurityContext::getAuthentication)
107+
.mapNotNull(SecurityContext::getAuthentication)
109108
.filter(Authentication::isAuthenticated)
110-
.map(Authentication::getPrincipal)
109+
.mapNotNull(Authentication::getPrincipal)
111110
.map(User.class::cast);
112111
}
113112
}

0 commit comments

Comments
 (0)