@OverridepublicObjectinstantiate(RootBeanDefinition bd,String beanName,BeanFactory owner){// Don't override the class with CGLIB if no overrides.if(bd.getMethodOverrides().isEmpty()){Constructor<?> constructorToUse;synchronized(bd.constructorArgumentLock){
constructorToUse =(Constructor<?>) bd.resolvedConstructorOrFactoryMethod;if(constructorToUse ==null){finalClass<?> clazz = bd.getBeanClass();if(clazz.isInterface()){thrownewBeanInstantiationException(clazz,"Specified class is an interface");}try{if(System.getSecurityManager()!=null){
constructorToUse =AccessController.doPrivileged(newPrivilegedExceptionAction<Constructor<?>>(){@OverridepublicConstructor<?>run()throwsException{return clazz.getDeclaredConstructor((Class[])null);}});}else{
constructorToUse = clazz.getDeclaredConstructor((Class[])null);}
bd.resolvedConstructorOrFactoryMethod = constructorToUse;}catch(Throwable ex){thrownewBeanInstantiationException(clazz,"No default constructor found", ex);}}}returnBeanUtils.instantiateClass(constructorToUse);}else{// Must generate CGLIB subclass.returninstantiateWithMethodInjection(bd, beanName, owner);}}