Skip to content
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

Conversation

geniusYoo
Copy link
Contributor

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 6, 2025
@geniusYoo geniusYoo force-pushed the fix/sslhealthindicator-constructor-null-check branch 2 times, most recently from 21db755 to c391958 Compare April 6, 2025 17:08
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>
@geniusYoo geniusYoo force-pushed the fix/sslhealthindicator-constructor-null-check branch from c391958 to 4d38802 Compare April 6, 2025 17:11
@mhalbritter mhalbritter self-assigned this Apr 7, 2025
@mhalbritter mhalbritter added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 7, 2025
@mhalbritter mhalbritter modified the milestones: 3.4.5, 3.4.x Apr 7, 2025
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>
@geniusYoo geniusYoo requested a review from mhalbritter April 7, 2025 06:50
@mhalbritter mhalbritter changed the title Validate sslInfo is not null in SslHealthIndicator constructor Validate that sslInfo is not null in SslHealthIndicator constructor Apr 7, 2025
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>
@mhalbritter mhalbritter modified the milestones: 3.4.x, 3.4.5 Apr 7, 2025
@mhalbritter
Copy link
Contributor

Thanks @geniusYoo !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants