[weld-commits] Weld SVN: r6265 - core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy.
weld-commits at lists.jboss.org
weld-commits at lists.jboss.org
Thu May 20 16:11:13 EDT 2010
Author: pete.muir at jboss.org
Date: 2010-05-20 16:11:12 -0400 (Thu, 20 May 2010)
New Revision: 6265
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java
Log:
reenable unsafe instantiators
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java 2010-05-20 20:10:32 UTC (rev 6264)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java 2010-05-20 20:11:12 UTC (rev 6265)
@@ -47,6 +47,8 @@
import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.serialization.spi.ProxyServices;
+import org.jboss.weld.util.reflection.SecureReflections;
+import org.jboss.weld.util.reflection.instantiation.InstantiatorFactory;
import org.slf4j.cal10n.LocLogger;
/**
@@ -89,6 +91,7 @@
public ProxyFactory(Class<?> proxiedBeanType)
{
this.beanType = proxiedBeanType;
+ ClassLoader originalClassLoader = proxiedBeanType.getClassLoader();
this.classLoader = Container.instance().services().get(ProxyServices.class).getClassLoader(beanType);
this.protectionDomain = Container.instance().services().get(ProxyServices.class).getProtectionDomain(beanType);
this.classPool = new ClassPool();
@@ -122,7 +125,14 @@
Class<T> proxyClass = getProxyClass();
try
{
- proxy = proxyClass.newInstance();
+ if (InstantiatorFactory.useInstantiators())
+ {
+ proxy = SecureReflections.newUnsafeInstance(proxyClass);
+ }
+ else
+ {
+ proxy = SecureReflections.newInstance(proxyClass);
+ }
}
catch (InstantiationException e)
{
More information about the weld-commits
mailing list