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

Add support for BeanPostProcessor defined in Kotlin companion object #32946

Closed
sdeleuze opened this issue Jun 3, 2024 · 0 comments
Closed

Add support for BeanPostProcessor defined in Kotlin companion object #32946

sdeleuze opened this issue Jun 3, 2024 · 0 comments
Assignees
Labels
theme: kotlin An issue related to Kotlin support type: enhancement A general enhancement
Milestone

Comments

@sdeleuze
Copy link
Contributor

sdeleuze commented Jun 3, 2024

Related to #32929, It looks like there is no proper way yet to declare a BeanPostProcessor in Kotlin since:

  • @Bean on a member function does not translate to a static method
  • companion object translates to a nested static final class Companion + related static final Companion Companion field.
  • companion object + @JvmStatic translates to a duplicated bean error since the BeanPostProcessor method is exposed both in the `Companion nested class (non static method) and configuration class (static method).

Spring should support the companion object + @JvmStatic use case.

@sdeleuze sdeleuze added type: enhancement A general enhancement theme: kotlin An issue related to Kotlin support labels Jun 3, 2024
@sdeleuze sdeleuze added this to the 6.2.0-M4 milestone Jun 3, 2024
@sdeleuze sdeleuze self-assigned this Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: kotlin An issue related to Kotlin support type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant