Skip to content

Remove compiler warnings in spring-security-web#18820

Open
jkuhel wants to merge 1 commit intospring-projects:mainfrom
jkuhel:gh-18441-spring-security-web
Open

Remove compiler warnings in spring-security-web#18820
jkuhel wants to merge 1 commit intospring-projects:mainfrom
jkuhel:gh-18441-spring-security-web

Conversation

@jkuhel
Copy link
Contributor

@jkuhel jkuhel commented Feb 28, 2026

This PR resolves the compiler warnings in the spring-security-web module.

Some of these warnings were straight forward changes:

  • ServerOneTimeTokenAuthenticationConverter: Replace deprecated call OneTimeTokenAuthenticationToken.unauthenticated with OneTimeTokenAuthenticationToken(String token)
  • Update HttpMessageConverterAuthenticationSuccessHandler to replace deprecated MappingJackson2HttpMessageConverter with JacksonJsonHttpMessageConverter
  • Replace updated OneTimeTokenAuthenticationConverter to use non-deprecated OneTimeTokenAuthenticationToken constructor
  • update tests classes DelegatingAuthenticationEntryPointTests / OneTimeTokenAuthenticationFilterTests to remove use of deprecated methods
  • Enabled compile-warnings-error for spring-security-web

JdbcTokenRepositoryImpl changes

@rwinch The more involved change was in JdbcTokenRepositoryImpl with the extension of deprecated JdbcDaoSupport. 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 extended JdbcTokenRepositoryImpl directly via the no-arg constructor with setDataSource() 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:

  • Added a DataSource constructor parameter (replaces inherited setDataSource()) and used to create JdbcTemplate in the class
  • Added own logger field (previously inherited from JdbcDaoSupport)
  • preserved the setCreateTableOnStartup(true) by implementing InitializingBean to preserve the afterPropertiesSet() call to initDao() lifecycle
  • Updated RememberMeBeanDefinitionParser to accommodate changes from property injection to constructor injection of the DataSource
  • Updated JdbcTokenRepositoryImplTests accordingly

Closes #18441

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 28, 2026
- 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

Signed-off-by: Joe Kuhel <4983938+jkuhel@users.noreply.github.com>
@jkuhel jkuhel force-pushed the gh-18441-spring-security-web branch from 3ab5089 to 0d25c21 Compare March 22, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove compiler warnings for spring-security-web

2 participants