-
Notifications
You must be signed in to change notification settings - Fork 41.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate that sslInfo is not null in SslHealthIndicator constructor #45013
Closed
geniusYoo
wants to merge
5
commits into
spring-projects:main
from
geniusYoo:fix/sslhealthindicator-constructor-null-check
Closed
Validate that sslInfo is not null in SslHealthIndicator constructor #45013
geniusYoo
wants to merge
5
commits into
spring-projects:main
from
geniusYoo:fix/sslhealthindicator-constructor-null-check
+4
−0
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21db755
to
c391958
Compare
The SslHealthIndicator constructor previously did not validate if the provided SslInfo instance was null. This could potentially lead to a NullPointerException later when the doHealthCheck method is invoked if the SslInfo bean was not properly configured or available. This commit adds an Assert.notNull check for the sslInfo parameter to ensure fail-fast behavior during application startup or bean creation. This aligns with the common practice in other Spring Boot components and health indicators where essential dependencies are validated in the constructor. Signed-off-by: geniuus <cross_man@naver.com>
author mismatch geniuus -> geniusYoo Signed-off-by: geniuus <cross_man@naver.com>
author mismatch geniusYoo -> geniuus Signed-off-by: geniuus <cross_man@naver.com>
c391958
to
4d38802
Compare
mhalbritter
requested changes
Apr 7, 2025
...ing-boot-actuator/src/main/java/org/springframework/boot/actuate/ssl/SslHealthIndicator.java
Outdated
Show resolved
Hide resolved
The previous commit introduced an `Assert.notNull` check in the SslHealthIndicator constructor but missed the required import for `org.springframework.util.Assert`. This caused the pull request build to fail. This commit adds the necessary import statement to resolve the compilation error. Signed-off-by: geniuus <cross_man@naver.com>
Update the Javadoc @author tag in SslHealthIndicator.java to use the `<Name> <Surname>` format (Young Jae You) instead of the GitHub handle. This change addresses the feedback provided in the pull request review and aligns the format with Spring project conventions. Signed-off-by: geniuus <cross_man@naver.com>
mhalbritter
pushed a commit
that referenced
this pull request
Apr 7, 2025
The SslHealthIndicator constructor previously did not validate if the provided SslInfo instance was null. This could potentially lead to a NullPointerException later when the doHealthCheck method is invoked if the SslInfo bean was not properly configured or available. This commit adds an Assert.notNull check for the sslInfo parameter to ensure fail-fast behavior during application startup or bean creation. This aligns with the common practice in other Spring Boot components and health indicators where essential dependencies are validated in the constructor. See gh-45013 Signed-off-by: geniuus <cross_man@naver.com>
Thanks @geniusYoo ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The SslHealthIndicator constructor previously did not validate if the provided SslInfo instance was null. This could potentially lead to a NullPointerException later when the doHealthCheck method is invoked if the SslInfo bean was not properly configured or available.
This commit adds an Assert.notNull check for the sslInfo parameter to ensure fail-fast behavior during application startup or bean creation. This aligns with the common practice in other Spring Boot components and health indicators where essential dependencies are validated in the constructor.