AutowiredAnnotationBeanPostProcessor tolerates annotated no-arg constructors

Issue: SPR-15005
(cherry picked from commit 8b5ee4e)
This commit is contained in:
Juergen Hoeller
2016-12-12 22:26:24 +01:00
parent 8190e7838f
commit 934fffec68
2 changed files with 18 additions and 8 deletions

View File

@@ -313,10 +313,6 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
". Found constructor with 'required' Autowired annotation already: " +
requiredConstructor);
}
if (candidate.getParameterTypes().length == 0) {
throw new IllegalStateException(
"Autowired annotation requires at least one argument: " + candidate);
}
boolean required = determineRequiredStatus(ann);
if (required) {
if (!candidates.isEmpty()) {