Browse Source

Ignore @Value on record property

See gh-31433
pull/31491/head
Martin Lukas 1 year ago committed by Stéphane Nicoll
parent
commit
70cb96c1d8
  1. 2
      spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java

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

@ -581,7 +581,7 @@ public class AutowiredAnnotationBeanPostProcessor implements SmartInstantiationA @@ -581,7 +581,7 @@ public class AutowiredAnnotationBeanPostProcessor implements SmartInstantiationA
}
return;
}
if (method.getParameterCount() == 0) {
if (!method.getDeclaringClass().isRecord() && method.getParameterCount() == 0) {
if (logger.isInfoEnabled()) {
logger.info("Autowired annotation should only be used on methods with parameters: " +
method);

Loading…
Cancel
Save