diff --git a/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java b/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java index 04046fea10..42965a79fa 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java +++ b/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java @@ -27,6 +27,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jspecify.annotations.Nullable; import org.springframework.security.config.Customizer; import org.springframework.security.config.ObjectPostProcessor; import org.springframework.security.config.annotation.web.builders.WebSecurity; @@ -181,6 +182,7 @@ public void setSharedObject(Class sharedType, C object) { * @param sharedType the type of the shared Object * @return the shared Object or null if it is not found */ + @Nullable @SuppressWarnings("unchecked") public C getSharedObject(Class sharedType) { return (C) this.sharedObjects.get(sharedType);