Merge branch '6.0.x'

This commit is contained in:
Stéphane Nicoll 2023-10-23 11:34:12 +02:00
commit 3cb700c103
1 changed files with 4 additions and 0 deletions

View File

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