This content has been marked as final.
Show 1 reply
-
1. Re: Missing BeanFactory with no class usage
alesj Aug 6, 2007 7:42 AM (in response to alesj)"alesj" wrote:
I guess we never tested this - beanfactory having no class/bean set.
Since this code woudn't work then. ;-)public Object createBean() throws Throwable { ClassLoader cl = Configurator.getClassLoader(classLoader); BeanInfo info = configurator.getBeanInfo(bean, cl);
I've added this fixpublic Object createBean() throws Throwable { ClassLoader cl = Configurator.getClassLoader(classLoader); BeanInfo info = null; if (bean != null) info = configurator.getBeanInfo(bean, cl); Joinpoint joinpoint = configurator.getConstructorJoinPoint(info, constructor, null); Object result = joinpoint.dispatch(); if (info == null && result != null) info = configurator.getBeanInfo(result.getClass());
and also added tests that use constructor's factory + factoryMethod or factoryClass + factoryMethod.