Remove compiler warnings in spring-security-web#18820
Merged
jzheaux merged 1 commit intospring-projects:mainfrom Mar 27, 2026
Merged
Remove compiler warnings in spring-security-web#18820jzheaux merged 1 commit intospring-projects:mainfrom
jzheaux merged 1 commit intospring-projects:mainfrom
Conversation
3ab5089 to
0d25c21
Compare
0d25c21 to
ffd7522
Compare
jzheaux
requested changes
Mar 25, 2026
...java/org/springframework/security/web/authentication/rememberme/JdbcTokenRepositoryImpl.java
Show resolved
Hide resolved
de7a28d to
f5cd898
Compare
- fix compiler warnings in ServerOneTimeTokenAuthenticationConverter - Replace deprecated API calls to create a OneTimeTokenAuthenticationToken.unauthenticated with OneTimeTokenAuthenticationToken(String token) call - Update HttpMessageConverterAuthenticationSuccessHandler to replace deprecated MappingJackson2HttpMessageConverter with JacksonJsonHttpMessageConverter - Replace updated OneTimeTokenAuthenticationConverter to use non-deprecated OneTimeTokenAuthenticationToken constructor - update tests to remove use of deprecated methods - refactor JdbcTokenRepositoryImpl to remove extension of deprecated JdbcDaoSupport class - enable compile-warnings-error plugin Closes spring-projectsgh-18441 Signed-off-by: Joe Kuhel <[email protected]>
f5cd898 to
2e40832
Compare
jzheaux
approved these changes
Mar 27, 2026
Contributor
|
Thanks for the updates, @jkuhel! This will merge into |
auto-merge was automatically disabled
March 27, 2026 19:24
Pull request was closed
This file contains hidden or 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
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.
This PR resolves the compiler warnings in the
spring-security-webmodule.Some of these warnings were straight forward changes:
ServerOneTimeTokenAuthenticationConverter: Replace deprecated callOneTimeTokenAuthenticationToken.unauthenticatedwithOneTimeTokenAuthenticationToken(String token)HttpMessageConverterAuthenticationSuccessHandlerto replace deprecatedMappingJackson2HttpMessageConverterwithJacksonJsonHttpMessageConverterOneTimeTokenAuthenticationConverterto use non-deprecatedOneTimeTokenAuthenticationTokenconstructorDelegatingAuthenticationEntryPointTests/OneTimeTokenAuthenticationFilterTeststo remove use of deprecated methodscompile-warnings-errorforspring-security-webJdbcTokenRepositoryImplchanges@rwinch The more involved change was in
JdbcTokenRepositoryImplwith the extension of deprecatedJdbcDaoSupport. What would be the best way to handle this?To start off for now, I opted to try an implementation that removes
extends JdbcDaoSupport. However, this could be a breaking change for anyone that has extendedJdbcTokenRepositoryImpldirectly via the no-arg constructor withsetDataSource()pattern.If it would be best to not introduce this change or take a different approach, let me know.
Here is a summary of changes I made:
DataSourceconstructor parameter (replaces inheritedsetDataSource()) and used to createJdbcTemplatein the classloggerfield (previously inherited fromJdbcDaoSupport)setCreateTableOnStartup(true)by implementingInitializingBeanto preserve theafterPropertiesSet()call toinitDao()lifecycleRememberMeBeanDefinitionParserto accommodate changes from property injection to constructor injection of theDataSourceJdbcTokenRepositoryImplTestsaccordinglyCloses #18441