From 341f4882ed9026661d8c2818dc90c9c84b1e69e1 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Wed, 28 Nov 2018 12:21:21 +0100 Subject: [PATCH] Clarify behaviour of AnnotationBeanNameGenerator with acronyms Name transformation is delegated to Introspector#decapitalize, which states "but in the (unusual) special case when there is more than one character and both the first and second characters are upper case, we leave it alone.". This commit clarifies this behavior. See gh-2030 --- .../context/annotation/AnnotationBeanNameGenerator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java b/spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java index 4beee86806..bb13d3944a 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java @@ -47,10 +47,11 @@ import org.springframework.util.StringUtils; * *

If the annotation's value doesn't indicate a bean name, an appropriate * name will be built based on the short name of the class (with the first - * letter lower-cased). For example: + * letter lower-cased). If two first letters of class name are uppercase, bean name will be unchanged. For example: * *

com.xyz.FooServiceImpl -> fooServiceImpl
- * + *
com.xyz.URLFooServiceImpl -> URLFooServiceImpl
+ * * @author Juergen Hoeller * @author Mark Fisher * @since 2.5