Author: pete.muir(a)jboss.org
Date: 2010-04-21 11:47:29 -0400 (Wed, 21 Apr 2010)
New Revision: 6140
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java
Log:
clean up ctor
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-04-21
13:29:32 UTC (rev 6139)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java 2010-04-21
15:47:29 UTC (rev 6140)
@@ -60,9 +60,9 @@
protected final Class<?> beanType;
protected final ArrayList<Class<?>> additionalInterfaces = new
ArrayList<Class<?>>();
- protected ClassLoader classLoader;
- protected ProtectionDomain protectionDomain;
- protected ClassPool classPool;
+ protected final ClassLoader classLoader;
+ protected final ProtectionDomain protectionDomain;
+ protected final ClassPool classPool;
/**
* Creates a new proxy factory from any type of BeanInstance. This bean
@@ -73,8 +73,7 @@
*/
public ProxyFactory(BeanInstance beanInstance)
{
- this.beanType = beanInstance.getInstanceType();
- init();
+ this(beanInstance.getInstanceType());
}
/**
@@ -82,26 +81,21 @@
*
* @param proxiedBeanType the super-class for this proxy class
*/
- public ProxyFactory(Class<T> proxiedBeanType)
+ public ProxyFactory(Class<?> proxiedBeanType)
{
this.beanType = proxiedBeanType;
- init();
- }
-
- /**
- * Initializes the proxy factory.
- */
- private void init()
- {
- classLoader = beanType.getClassLoader();
- protectionDomain = beanType.getProtectionDomain();
if (beanType.getName().startsWith("java."))
{
- classLoader = this.getClass().getClassLoader();
- protectionDomain = this.getClass().getProtectionDomain();
+ this.classLoader = this.getClass().getClassLoader();
+ this.protectionDomain = this.getClass().getProtectionDomain();
}
- classPool = new ClassPool();
- classPool.appendClassPath(new ClassloaderClassPath(classLoader));
+ else
+ {
+ this.classLoader = beanType.getClassLoader();
+ this.protectionDomain = beanType.getProtectionDomain();
+ }
+ this.classPool = new ClassPool();
+ this.classPool.appendClassPath(new ClassloaderClassPath(classLoader));
addDefaultAdditionalInterfaces();
}
Show replies by date