This is quite strange!!!
What version are you using? could you show the log result?
following method, from BeanNameAutoProxyCreator source returns true in both cases:
Code:
/**
* Return if the given bean name matches the mapped name.
* The default implementation checks for "xxx*" and "*xxx" matches.
* Can be overridden in subclasses.
* @param beanName the bean name to check
* @param mappedName the name in the configured list of names
* @return if the names match
*/
protected boolean isMatch(String beanName, String mappedName) {
return (mappedName.endsWith("*") && beanName.startsWith(mappedName.substring(0, mappedName.length() - 1))) ||
(mappedName.startsWith("*") && beanName.endsWith(mappedName.substring(1, mappedName.length())));
}