Ignore @Value on record property

See gh-31433
This commit is contained in:
Martin Lukas
2023-10-15 02:14:07 +01:00
committed by Stéphane Nicoll
parent 6ec264252b
commit 70cb96c1d8

View File

@@ -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);