Skip to content

Commit

Permalink
clean up ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuir committed Apr 21, 2010
1 parent 3c6dd6d commit c0fa648
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java
Expand Up @@ -60,9 +60,9 @@ public class ProxyFactory<T>

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
Expand All @@ -73,35 +73,29 @@ public class ProxyFactory<T>
*/
public ProxyFactory(BeanInstance beanInstance)
{
this.beanType = beanInstance.getInstanceType();
init();
this(beanInstance.getInstanceType());
}

/**
* Creates a new proxy factory with only the type of proxy specified.
*
* @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();
}
else
{
this.classLoader = beanType.getClassLoader();
this.protectionDomain = beanType.getProtectionDomain();
}
classPool = new ClassPool();
classPool.appendClassPath(new ClassloaderClassPath(classLoader));
this.classPool = new ClassPool();
this.classPool.appendClassPath(new ClassloaderClassPath(classLoader));
addDefaultAdditionalInterfaces();
}

Expand Down

0 comments on commit c0fa648

Please sign in to comment.