Sonarqube 9.0
This rule complains about to much arguments used for methods, but it should exclude own bean definitions like this:
@Configuration
public class BarConfiguration {
@Bean
public Foo foo(A1 a1, A2 a2, A3 a3, A4 a4, …)
}
As this is used to request other dependencies that might be needed to construct Foo.
There seems to be a releated problem with constructors that are not annotated with @Autowired
. This is not needed anymore in spring boot as long as the class has a @Component / @Service
annotation
As of Spring 4.3, classes with a single constructor can omit the @Autowired annotation. This is a nice little bit of convenience and boilerplate removal.