Program: 143739
Project: 143739
Buggy source:
protected static IComponent createBean(IApplication application,Form form,Bean bean,FlattenedSolution flattenedSolution){
  IComponent c=null;
  try {
    Object obj=getBeanInstanceFromXML(application,bean.getBeanClassName(),bean.getBeanXML());
    if (flattenedSolution != null && obj != null) {
      obj=flattenedSolution.setBeanDesignInstance(bean,obj);
    }
    if (obj instanceof Component) {
      ((Component)obj).setName(bean.getName());
    }
 else     if (obj instanceof IComponent) {
      ((IComponent)obj).setName(bean.getName());
    }
    if (obj instanceof IServoyAwareBean) {
      ((IServoyAwareBean)obj).initialize((IClientPluginAccess)application.getPluginAccess());
    }
    if (obj instanceof IServoyBeanFactory) {
      testReturnTypesForBean(application,obj);
      obj=((IServoyBeanFactory)obj).getBeanInstance(application.getApplicationType(),(IClientPluginAccess)application.getPluginAccess(),new Object[]{ComponentFactory.getWebID(form,bean),form.getName(),form.getStyleName()});
    }
    testReturnTypesForBean(application,obj);
    if (obj instanceof Applet) {
      ((FormManager)application.getFormManager()).initializeApplet((Applet)obj,bean.getSize());
    }
    if (obj == null) {
      c=application.getItemFactory().createLabel(ComponentFactory.getWebID(form,bean),"String_Node_Str" + bean.getBeanClassName());
    }
 else     if (!(obj instanceof java.awt.Component) && !(obj instanceof IComponent)) {
      c=application.getItemFactory().createInvisibleBean(ComponentFactory.getWebID(form,bean),obj);
    }
 else     if (!(obj instanceof IComponent)) {
      c=application.getItemFactory().createBeanHolder(ComponentFactory.getWebID(form,bean),(Component)obj,bean.getAnchors());
    }
 else {
      c=(IComponent)obj;
    }
    applyBasicComponentProperties(application,c,bean,null);
  }
 catch (  Throwable e) {
    Debug.error(e);
    c=application.getItemFactory().createLabel(bean.getName(),"String_Node_Str" + bean.getBeanClassName());
    java.awt.Dimension dim=bean.getSize();
    if (dim != null)     c.setSize(bean.getSize());
  }
  return c;
}

Fixed version (ground truth):
protected static IComponent createBean(IApplication application,Form form,Bean bean,FlattenedSolution flattenedSolution){
  IComponent c=null;
  try {
    Object obj=getBeanInstanceFromXML(application,bean.getBeanClassName(),bean.getBeanXML());
    if (flattenedSolution != null && obj != null) {
      obj=flattenedSolution.setBeanDesignInstance(bean,obj);
    }
    if (obj instanceof Component) {
      ((Component)obj).setName(bean.getName());
    }
 else     if (obj instanceof IComponent) {
      ((IComponent)obj).setName(bean.getName());
    }
    if (obj instanceof IServoyAwareBean) {
      ((IServoyAwareBean)obj).initialize((IClientPluginAccess)application.getPluginAccess());
    }
    if (obj instanceof IServoyBeanFactory) {
      testReturnTypesForBean(application,obj);
      obj=((IServoyBeanFactory)obj).getBeanInstance(application.getApplicationType(),(IClientPluginAccess)application.getPluginAccess(),new Object[]{ComponentFactory.getWebID(form,bean),form.getName(),form.getStyleName()});
    }
    testReturnTypesForBean(application,obj);
    if (obj instanceof Applet) {
      ((FormManager)application.getFormManager()).initializeApplet((Applet)obj,bean.getSize());
    }
    if (obj == null) {
      c=application.getItemFactory().createLabel(ComponentFactory.getWebID(form,bean),"String_Node_Str" + bean.getBeanClassName());
    }
 else     if (!(obj instanceof java.awt.Component) && !(obj instanceof IComponent)) {
      c=application.getItemFactory().createInvisibleBean(ComponentFactory.getWebID(form,bean),obj);
    }
 else     if (!(obj instanceof IComponent)) {
      c=application.getItemFactory().createBeanHolder(ComponentFactory.getWebID(form,bean),(Component)obj,bean.getAnchors());
    }
 else {
      c=(IComponent)obj;
    }
    boolean isOpaque=c.isOpaque();
    applyBasicComponentProperties(application,c,bean,null);
    c.setOpaque(isOpaque);
  }
 catch (  Throwable e) {
    Debug.error(e);
    c=application.getItemFactory().createLabel(bean.getName(),"String_Node_Str" + bean.getBeanClassName());
    java.awt.Dimension dim=bean.getSize();
    if (dim != null)     c.setSize(bean.getSize());
  }
  return c;
}