Skip to content

Commit 8b6c011

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

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
@@ -109,10 +109,9 @@ class SpringSecurityAuditorAware implements ReactiveAuditorAware<User> {
109109
public Mono<User> getCurrentAuditor() {
110110
111111
return ReactiveSecurityContextHolder.getContext()
112-
.filter(it -> it.getAuthentication() != null)
113-
.map(SecurityContext::getAuthentication)
112+
.mapNotNull(SecurityContext::getAuthentication)
114113
.filter(Authentication::isAuthenticated)
115-
.map(Authentication::getPrincipal)
114+
.mapNotNull(Authentication::getPrincipal)
116115
.map(User.class::cast);
117116
}
118117
}

0 commit comments

Comments
 (0)