Inspectopedia 2025.2 Help

@Configuration proxyMethods usage warnings

Reports warnings on incorrectly used proxy methods. Spring Framework 5.2 has introduced an optimization for @Configuration class processing that can be enabled via an attribute @Configuration(proxyBeanMethods = false).

If you disable proxyBeanMethods, the proxy instances are no longer created and calling the method invokes it again (returning a new instance every time). As a result, you have no guarantee that you're actually injecting the corresponding bean in the context.

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

SpringConfigurationProxyMethods
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | Spring | Spring Core | Code

Incorrect bean method call example:

@Configuration(proxyBeanMethods = false) class TestConfiguration { @Bean public FirstBean firstBean() { return new FirstBean(); } @Bean public SecondBean secondBean() { return new SecondBean(firstBean()); // -> incorrect call } }

You can set proxyBeanMethods to true or rewrite the code as follows:

@Configuration(proxyBeanMethods = false) class TestConfiguration { @Bean public FirstBean firstBean() { return new FirstBean(); } @Bean public SecondBean secondBean(FirstBean someBean) { // -> correct injected instance return new SecondBean(someBean); } }

Also, the inspection checks @Bean method calls in a class without the @Configuration stereotype (in "bean lite mode"):

@Component class TestComponent { @Bean public FirstBean firstBean() { return new FirstBean(); } @Bean public SecondBean secondBean() { return new SecondBean(firstBean()); // -> incorrect call } }

Suppressing Inspection

You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:

//noinspection SpringConfigurationProxyMethods

More detailed instructions as well as other ways and options that you have can be found in the product documentation:

Inspection Details

By default bundled with:

IntelliJ IDEA 2025.2, Qodana for JVM 2025.2,

Last modified: 18 September 2025