Skip to content

Add support for BeanPostProcessor defined in Kotlin companion object #32946

Closed
@sdeleuze

Description

@sdeleuze

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions