Skip to content

Remove compiler warnings in spring-security-web#18820

Merged
jzheaux merged 1 commit intospring-projects:mainfrom
jkuhel:gh-18441-spring-security-web
Mar 27, 2026
Merged

Remove compiler warnings in spring-security-web#18820
jzheaux merged 1 commit intospring-projects:mainfrom
jkuhel:gh-18441-spring-security-web

Conversation

@jkuhel
Copy link
Copy Markdown
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
@jkuhel jkuhel force-pushed the gh-18441-spring-security-web branch from 3ab5089 to 0d25c21 Compare March 22, 2026 20:28
@jzheaux jzheaux force-pushed the gh-18441-spring-security-web branch from 0d25c21 to ffd7522 Compare March 25, 2026 21:33
Copy link
Copy Markdown
Contributor

@jzheaux jzheaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, @jkuhel! I've left some feedback inline.

@jzheaux jzheaux added in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 25, 2026
@jzheaux jzheaux self-assigned this Mar 25, 2026
@jzheaux jzheaux added this to the 7.1.0-RC1 milestone Mar 25, 2026
@jkuhel jkuhel force-pushed the gh-18441-spring-security-web branch 2 times, most recently from de7a28d to f5cd898 Compare March 26, 2026 02:17
- 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]>
@jzheaux jzheaux force-pushed the gh-18441-spring-security-web branch from f5cd898 to 2e40832 Compare March 27, 2026 19:23
@jzheaux jzheaux enabled auto-merge (rebase) March 27, 2026 19:24
@jzheaux
Copy link
Copy Markdown
Contributor

jzheaux commented Mar 27, 2026

Thanks for the updates, @jkuhel! This will merge into main once the build completes

@jzheaux jzheaux closed this Mar 27, 2026
auto-merge was automatically disabled March 27, 2026 19:24

Pull request was closed

@jzheaux jzheaux reopened this Mar 27, 2026
@jzheaux jzheaux enabled auto-merge (rebase) March 27, 2026 21:02
@jzheaux jzheaux merged commit 46e27aa into spring-projects:main Mar 27, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove compiler warnings for spring-security-web

3 participants