Improve null-safety of module/spring-boot-security

See gh-46926
This commit is contained in:
Moritz Halbritter
2025-08-26 14:22:56 +02:00
parent 99629d0d32
commit dcd25abcce
@@ -80,16 +80,18 @@ public abstract class ApplicationContextServerWebExchangeMatcher<C> implements S
}
protected Supplier<C> getContext(ServerWebExchange exchange) {
if (this.context == null) {
Supplier<C> context = this.context;
if (context == null) {
synchronized (this.contextLock) {
if (this.context == null) {
Supplier<C> createdContext = createContext(exchange);
initialized(createdContext);
this.context = createdContext;
context = this.context;
if (context == null) {
context = createContext(exchange);
initialized(context);
this.context = context;
}
}
}
return this.context;
return context;
}
/**