From f6ae679a2fdea3405b4c1f53ea411f0c6b7b2c71 Mon Sep 17 00:00:00 2001 From: bbaia Date: Mon, 19 Oct 2009 20:22:33 +0000 Subject: [PATCH] Spring.Aop/Aop/Framework/ProxyConfig instantiation optimization --- src/Spring/Spring.Aop/Aop/Framework/ProxyConfig.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Spring/Spring.Aop/Aop/Framework/ProxyConfig.cs b/src/Spring/Spring.Aop/Aop/Framework/ProxyConfig.cs index 56d27c38..2b9b21c2 100644 --- a/src/Spring/Spring.Aop/Aop/Framework/ProxyConfig.cs +++ b/src/Spring/Spring.Aop/Aop/Framework/ProxyConfig.cs @@ -54,16 +54,15 @@ namespace Spring.Aop.Framework { #region Fields - private static readonly ConstructorInfo cachedAopProxyFactoryCtorInfo = - typeof(ProxyConfig).Assembly.GetType("Spring.Aop.Framework.DynamicProxy.CachedAopProxyFactory", false, false).GetConstructor(Type.EmptyTypes); + private static readonly IDynamicConstructor cachedAopProxyFactoryDynCtor = + new SafeConstructor(typeof(ProxyConfig).Assembly.GetType("Spring.Aop.Framework.DynamicProxy.CachedAopProxyFactory", false, false).GetConstructor(Type.EmptyTypes)); private bool proxyTargetType; private bool proxyTargetAttributes = true; private bool optimize; private bool frozen; - private IAopProxyFactory aopProxyFactory = - DynamicConstructor.Create(cachedAopProxyFactoryCtorInfo).Invoke(ObjectUtils.EmptyObjects) as IAopProxyFactory; + private IAopProxyFactory aopProxyFactory = cachedAopProxyFactoryDynCtor.Invoke(ObjectUtils.EmptyObjects) as IAopProxyFactory; private bool exposeProxy; private readonly object syncRoot = new object();