Inspectopedia Help

Incorrectly defined method referenced in "factory-method" attribute

Reports incorrect method references in the factory-method attribute of the <bean> element.

Example:

public class MyFactory { public static FooBean createBean() {} }
<beans> <bean class="MyFactory" id="factory"/> <bean factory-bean="factory" factory-method="createBean"/> <!-- Factory method 'createBean' must not be static --> </beans>

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Spring, 241.16690

Last modified: 29 April 2024