Skip to content

Commit 70cb96c

Browse files
Martin Lukassnicoll
authored andcommitted
Ignore @value on record property
See gh-31433
1 parent 6ec2642 commit 70cb96c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ private InjectionMetadata buildAutowiringMetadata(Class<?> clazz) {
581581
}
582582
return;
583583
}
584-
if (method.getParameterCount() == 0) {
584+
if (!method.getDeclaringClass().isRecord() && method.getParameterCount() == 0) {
585585
if (logger.isInfoEnabled()) {
586586
logger.info("Autowired annotation should only be used on methods with parameters: " +
587587
method);

0 commit comments

Comments
 (0)