From e54a44b57735a94f20057906ef52d64d5a353e2b Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 20 Apr 2009 11:20:01 +0000 Subject: [PATCH] refined sequence of registration calls --- .../ScopedProxyBeanDefinitionDecorator.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/org.springframework.aop/src/main/java/org/springframework/aop/config/ScopedProxyBeanDefinitionDecorator.java b/org.springframework.aop/src/main/java/org/springframework/aop/config/ScopedProxyBeanDefinitionDecorator.java index e88ad1e8b88..ac118d7096c 100644 --- a/org.springframework.aop/src/main/java/org/springframework/aop/config/ScopedProxyBeanDefinitionDecorator.java +++ b/org.springframework.aop/src/main/java/org/springframework/aop/config/ScopedProxyBeanDefinitionDecorator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2009 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. @@ -44,15 +44,18 @@ class ScopedProxyBeanDefinitionDecorator implements BeanDefinitionDecorator { if (node instanceof Element) { Element ele = (Element) node; if (ele.hasAttribute(PROXY_TARGET_CLASS)) { - proxyTargetClass = Boolean.valueOf(ele.getAttribute(PROXY_TARGET_CLASS)).booleanValue(); + proxyTargetClass = Boolean.valueOf(ele.getAttribute(PROXY_TARGET_CLASS)); } } - // Register the original bean definition as it will be referenced by the scoped proxy and is relevant for tooling (validation, navigation). + // Register the original bean definition as it will be referenced by the scoped proxy + // and is relevant for tooling (validation, navigation). + BeanDefinitionHolder holder = + ScopedProxyUtils.createScopedProxy(definition, parserContext.getRegistry(), proxyTargetClass); String targetBeanName = ScopedProxyUtils.getTargetBeanName(definition.getBeanName()); - parserContext.getReaderContext().fireComponentRegistered(new BeanComponentDefinition(definition.getBeanDefinition(), targetBeanName)); - - return ScopedProxyUtils.createScopedProxy(definition, parserContext.getRegistry(), proxyTargetClass); + parserContext.getReaderContext().fireComponentRegistered( + new BeanComponentDefinition(definition.getBeanDefinition(), targetBeanName)); + return holder; } }