BeanNameAutoProxyCreator detects alias matches for specified bean names as well (SPR-6774)

This commit is contained in:
Juergen Hoeller
2010-01-31 14:12:48 +00:00
parent 6b2b5c4c23
commit 6070a498fe
2 changed files with 14 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -84,6 +84,15 @@ public class BeanNameAutoProxyCreator extends AbstractAutoProxyCreator {
if (isMatch(beanName, mappedName)) {
return PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS;
}
BeanFactory beanFactory = getBeanFactory();
if (beanFactory != null) {
String[] aliases = beanFactory.getAliases(beanName);
for (String alias : aliases) {
if (isMatch(alias, mappedName)) {
return PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS;
}
}
}
}
}
return DO_NOT_PROXY;