Browse Source

Merge branch '6.0.x'

pull/31483/head
Stéphane Nicoll 2 years ago
parent
commit
3cb700c103
  1. 4
      spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java

4
spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java

@ -583,6 +583,10 @@ public class AutowiredAnnotationBeanPostProcessor implements SmartInstantiationA
return; return;
} }
if (method.getParameterCount() == 0) { if (method.getParameterCount() == 0) {
if (method.getDeclaringClass().isRecord()) {
// Annotations on the compact constructor arguments made available on accessors, ignoring.
return;
}
if (logger.isInfoEnabled()) { if (logger.isInfoEnabled()) {
logger.info("Autowired annotation should only be used on methods with parameters: " + logger.info("Autowired annotation should only be used on methods with parameters: " +
method); method);

Loading…
Cancel
Save