From 98eaf05c8fb2ecf630a3d6e58b4c3d2fb7b79d3c Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sun, 29 May 2016 13:19:09 +0200 Subject: [PATCH] @Bean's "autowire" attribute does not affect annotation-driven autowiring Issue: SPR-14282 --- .../java/org/springframework/context/annotation/Bean.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spring-context/src/main/java/org/springframework/context/annotation/Bean.java b/spring-context/src/main/java/org/springframework/context/annotation/Bean.java index 2763560088..8cbaa0da3b 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/Bean.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/Bean.java @@ -198,6 +198,13 @@ public @interface Bean { /** * Are dependencies to be injected via convention-based autowiring by name or type? + *

Note that this autowire mode is just about externally driven autowiring based + * on bean property setter methods by convention, analogous to XML bean definitions. + *

The default mode does allow for annotation-driven autowiring. "no" refers to + * externally driven autowiring only, not affecting any autowiring demands that the + * bean class itself expresses through annotations. + * @see Autowire#BY_NAME + * @see Autowire#BY_TYPE */ Autowire autowire() default Autowire.NO; -- GitLab