Inspectopedia
 
2024.3

Unknown init/destroy method in the @Bean annotation

Error
New
Last modified: 03 December 2024

Reports unresolved method references on initMethod and destroyMethod parameters of the @Bean annotation.

Example:

"Cannot resolve method" will be reported on 'doInit' expression if MyBean class doesn't contain 'public void 'doInit'(){...}' method

In this example, the inspection will report an unresolved method reference if MyBean doesn't define the doInit() method.