final NewMethod newMethod = abstractMethod.copy(beanFactory);
newMethod.setAbstract(false);
newMethod.setFinal(true);
newMethod.setNative(false);
final GetAliasesToBeans body = new GetAliasesToBeans();
newMethod.setBody(body);
context.branch();
context.info("Overriding " + newMethod + " to register all aliases.");
final Iterator<Alias> beansIterator = this.getAliases().values().iterator();
int aliasCount = 0;
while (beansIterator.hasNext()) {
final Alias alias = beansIterator.next();
final String from = alias.getName();
final String to = alias.getBean();
body.register(from, to);
context.debug(from + "=" + to);
aliasCount++;
}