Skip to content

Commit 3cb700c

Browse files
committed
Merge branch '6.0.x'
2 parents 2d792f0 + bb446a3 commit 3cb700c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,10 @@ private InjectionMetadata buildAutowiringMetadata(Class<?> clazz) {
583583
return;
584584
}
585585
if (method.getParameterCount() == 0) {
586+
if (method.getDeclaringClass().isRecord()) {
587+
// Annotations on the compact constructor arguments made available on accessors, ignoring.
588+
return;
589+
}
586590
if (logger.isInfoEnabled()) {
587591
logger.info("Autowired annotation should only be used on methods with parameters: " +
588592
method);

0 commit comments

Comments
 (0)