11/* 
2-  * Copyright 2002-2012  the original author or authors. 
2+  * Copyright 2002-2013  the original author or authors. 
33 * 
44 * Licensed under the Apache License, Version 2.0 (the "License"); 
55 * you may not use this file except in compliance with the License. 
@@ -61,8 +61,12 @@ public class RootBeanDefinition extends AbstractBeanDefinition {
6161
6262	boolean  allowCaching  = true ;
6363
64+ 	private  volatile  Class <?> targetType ;
65+ 
6466	boolean  isFactoryMethodUnique  = false ;
6567
68+ 	final  Object  constructorArgumentLock  = new  Object ();
69+ 
6670	/** Package-visible field for caching the resolved constructor or factory method */ 
6771	Object  resolvedConstructorOrFactoryMethod ;
6872
@@ -75,15 +79,13 @@ public class RootBeanDefinition extends AbstractBeanDefinition {
7579	/** Package-visible field for caching partly prepared constructor arguments */ 
7680	Object [] preparedConstructorArguments ;
7781
78- 	final  Object  constructorArgumentLock  = new  Object ();
79- 
80- 	/** Package-visible field that indicates a before-instantiation post-processor having kicked in */ 
81- 	volatile  Boolean  beforeInstantiationResolved ;
82+ 	final  Object  postProcessingLock  = new  Object ();
8283
8384	/** Package-visible field that indicates MergedBeanDefinitionPostProcessor having been applied */ 
8485	boolean  postProcessed  = false ;
8586
86- 	final  Object  postProcessingLock  = new  Object ();
87+ 	/** Package-visible field that indicates a before-instantiation post-processor having kicked in */ 
88+ 	volatile  Boolean  beforeInstantiationResolved ;
8789
8890
8991	/** 
@@ -236,6 +238,8 @@ public RootBeanDefinition(RootBeanDefinition original) {
236238		if  (original  instanceof  RootBeanDefinition ) {
237239			RootBeanDefinition  originalRbd  = (RootBeanDefinition ) original ;
238240			this .decoratedDefinition  = originalRbd .decoratedDefinition ;
241+ 			this .allowCaching  = originalRbd .allowCaching ;
242+ 			this .targetType  = originalRbd .targetType ;
239243			this .isFactoryMethodUnique  = originalRbd .isFactoryMethodUnique ;
240244		}
241245	}
@@ -251,6 +255,21 @@ public void setParentName(String parentName) {
251255		}
252256	}
253257
258+ 	/** 
259+ 	 * Specify the target type of this bean definition, if known in advance. 
260+ 	 */ 
261+ 	public  void  setTargetType (Class <?> targetType ) {
262+ 		this .targetType  = targetType ;
263+ 	}
264+ 
265+ 	/** 
266+ 	 * Return the target type of this bean definition, if known 
267+ 	 * (either specified in advance or resolved on first instantiation). 
268+ 	 */ 
269+ 	public  Class <?> getTargetType () {
270+ 		return  this .targetType ;
271+ 	}
272+ 
254273	/** 
255274	 * Specify a factory method name that refers to a non-overloaded method. 
256275	 */ 
0 commit comments