Skip to content

Remove redundant null check in HikariJdbcConnectionDetailsBeanPostProcessor#50480

Closed
dmitrysulman wants to merge 1 commit into
spring-projects:mainfrom
dmitrysulman:remove-redundant-null-check
Closed

Remove redundant null check in HikariJdbcConnectionDetailsBeanPostProcessor#50480
dmitrysulman wants to merge 1 commit into
spring-projects:mainfrom
dmitrysulman:remove-redundant-null-check

Conversation

@dmitrysulman

Copy link
Copy Markdown
Contributor

This PR removes an unnecessary null check for driverClassName in the HikariJdbcConnectionDetailsBeanPostProcessor, as JdbcConnectionDetails#getDriverClassName is guaranteed to return a non-null value.

Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 21, 2026
@philwebb

Copy link
Copy Markdown
Member

Thanks for the PR. Whilst I agree that JdbcConnectionDetails.getDriverClassName() should not return null, there's still the possibility of that happening if a user implements the interface and overrides the default method. It looks like we added the null check for #44997, and whilst the test in that issue no longer causes a problem, I'm not sure we should rush to remove the defensive code we currently have.

Thanks anyway for the suggestion.

@philwebb philwebb closed this May 22, 2026
@philwebb philwebb added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants