From c8869d99f58c697bf69a6761a27ced75ad771980 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 17 Sep 2018 19:09:21 +0200 Subject: [PATCH] Deprecate autowire attribute on @Bean annotation Issue: SPR-17281 --- .../main/java/org/springframework/context/annotation/Bean.java | 3 +++ 1 file changed, 3 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 0dfdee94051..ab9cd09c8f5 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 @@ -248,7 +248,10 @@ public @interface Bean { * bean class itself expresses through annotations. * @see Autowire#BY_NAME * @see Autowire#BY_TYPE + * @deprecated as of 5.1, since {@code @Bean} factory method argument resolution and + * {@code @Autowired} processing supersede name/type-based bean property injection */ + @Deprecated Autowire autowire() default Autowire.NO; /**