Program: 118164
Project: 118164
Buggy source:
/** 
 * yzhang Comment method "createDynamicComposite".
 * @param parent
 * @param element
 * @param category
 */
private void createDynamicComposite(final Composite parent,Element element,EComponentCategory category){
  getParentMap().put(ComponentSettingsView.PARENT,parent);
  getCategoryMap().put(ComponentSettingsView.CATEGORY,category);
  if (element instanceof Node) {
    IComponent component=((Node)element).getComponent();
    IGenericWizardService wizardService=null;
    boolean generic=false;
    if (EComponentType.GENERIC.equals(component.getComponentType())) {
      generic=true;
      if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericWizardService.class)) {
        wizardService=(IGenericWizardService)GlobalServiceRegister.getDefault().getService(IGenericWizardService.class);
      }
    }
    tabFactory.getTabbedPropertyComposite().setCompactViewVisible(false);
    if (category == EComponentCategory.BASIC) {
      createButtonListener();
      boolean isCompactView=true;
      if (ComponentSettingsView.TABLEVIEW.equals(getPreference().getString(TalendDesignerPrefConstants.VIEW_OPTIONS))) {
        isCompactView=false;
      }
      tabFactory.getTabbedPropertyComposite().setCompactViewVisible(true);
      tabFactory.getTabbedPropertyComposite().setCompactView(isCompactView);
      dc=new MissingSettingsMultiThreadDynamicComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,category,element,isCompactView);
      if (generic && wizardService != null) {
        Composite composite=wizardService.creatDynamicComposite(parent,element,EComponentCategory.BASIC,true);
        if (composite instanceof MultipleThreadDynamicComposite) {
          dc=(MultipleThreadDynamicComposite)composite;
        }
      }
    }
 else     if (category == EComponentCategory.DYNAMICS_SETTINGS) {
      dc=new AdvancedContextComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,element);
    }
 else     if (category == EComponentCategory.SQL_PATTERN) {
      dc=new SQLPatternComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,element);
    }
 else     if (category == EComponentCategory.ADVANCED) {
      dc=new MissingSettingsMultiThreadDynamicComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,category,element,true);
      if (generic && wizardService != null) {
        Composite composite=wizardService.creatDynamicComposite(parent,element,EComponentCategory.ADVANCED,true);
        if (composite instanceof MultipleThreadDynamicComposite) {
          dc=(MultipleThreadDynamicComposite)composite;
        }
      }
    }
 else {
      dc=new MultipleThreadDynamicComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,category,element,true);
    }
  }
 else   if (element instanceof Connection) {
    dc=new MainConnectionComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,category,element);
  }
 else   if (element instanceof Note) {
    if (category == EComponentCategory.BASIC) {
      if (parent.getLayout() instanceof FillLayout) {
        FillLayout layout=(FillLayout)parent.getLayout();
        layout.type=SWT.VERTICAL;
        layout.marginHeight=0;
        layout.marginWidth=0;
        layout.spacing=0;
      }
      ScrolledComposite scrolled=new ScrolledComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL);
      scrolled.setExpandHorizontal(true);
      scrolled.setExpandVertical(true);
      scrolled.setMinWidth(600);
      scrolled.setMinHeight(400);
      Composite composite=tabFactory.getWidgetFactory().createComposite(scrolled);
      scrolled.setContent(composite);
      composite.setLayout(new FormLayout());
      FormData d=new FormData();
      d.left=new FormAttachment(0,0);
      d.right=new FormAttachment(100,0);
      d.top=new FormAttachment(0,0);
      d.bottom=new FormAttachment(100,0);
      composite.setLayoutData(d);
      AbstractNotePropertyComposite c1=new BasicNotePropertyComposite(composite,(Note)element,tabFactory);
      parent.layout();
    }
  }
 else   if (element instanceof SubjobContainer) {
    if (category == EComponentCategory.BASIC) {
      dc=new SubjobBasicComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,element);
    }
  }
 else {
    tabFactory.getTabbedPropertyComposite().setCompactViewVisible(false);
    dc=new MultipleThreadDynamicComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,category,element,true);
  }
  if (parent.getChildren().length == 0) {
    if (parent.getLayout() instanceof FillLayout) {
      FillLayout layout=(FillLayout)parent.getLayout();
      layout.type=SWT.VERTICAL;
      layout.marginHeight=0;
      layout.marginWidth=0;
      layout.spacing=0;
    }
    Composite composite=tabFactory.getWidgetFactory().createComposite(parent);
    composite.setLayout(new FormLayout());
    FormData d=new FormData();
    d.left=new FormAttachment(2,0);
    d.right=new FormAttachment(100,0);
    d.top=new FormAttachment(5,0);
    d.bottom=new FormAttachment(100,0);
    composite.setLayoutData(d);
    Label alertText=new Label(composite,SWT.NONE);
    alertText.setText(Messages.getString("String_Node_Str"));
    alertText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    parent.layout();
  }
  if (dc != null) {
    dc.refresh();
  }
}

Fixed version (ground truth):
/** 
 * yzhang Comment method "createDynamicComposite".
 * @param parent
 * @param element
 * @param category
 */
private void createDynamicComposite(final Composite parent,Element element,EComponentCategory category){
  getParentMap().put(ComponentSettingsView.PARENT,parent);
  getCategoryMap().put(ComponentSettingsView.CATEGORY,category);
  if (element instanceof Node) {
    IComponent component=((Node)element).getComponent();
    IGenericWizardService wizardService=null;
    boolean generic=false;
    if (EComponentType.GENERIC.equals(component.getComponentType())) {
      generic=true;
      if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericWizardService.class)) {
        wizardService=(IGenericWizardService)GlobalServiceRegister.getDefault().getService(IGenericWizardService.class);
      }
    }
    tabFactory.getTabbedPropertyComposite().setCompactViewVisible(false);
    if (category == EComponentCategory.BASIC) {
      createButtonListener();
      boolean isCompactView=true;
      if (ComponentSettingsView.TABLEVIEW.equals(getPreference().getString(TalendDesignerPrefConstants.VIEW_OPTIONS))) {
        isCompactView=false;
      }
      tabFactory.getTabbedPropertyComposite().setCompactViewVisible(true);
      tabFactory.getTabbedPropertyComposite().setCompactView(isCompactView);
      if (generic && wizardService != null) {
        Composite composite=wizardService.creatDynamicComposite(parent,element,EComponentCategory.BASIC,true);
        if (composite instanceof MultipleThreadDynamicComposite) {
          dc=(MultipleThreadDynamicComposite)composite;
        }
      }
      if (dc == null) {
        dc=new MissingSettingsMultiThreadDynamicComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,category,element,isCompactView);
      }
    }
 else     if (category == EComponentCategory.DYNAMICS_SETTINGS) {
      dc=new AdvancedContextComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,element);
    }
 else     if (category == EComponentCategory.SQL_PATTERN) {
      dc=new SQLPatternComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,element);
    }
 else     if (category == EComponentCategory.ADVANCED) {
      dc=new MissingSettingsMultiThreadDynamicComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,category,element,true);
      if (generic && wizardService != null) {
        Composite composite=wizardService.creatDynamicComposite(parent,element,EComponentCategory.ADVANCED,true);
        if (composite instanceof MultipleThreadDynamicComposite) {
          dc=(MultipleThreadDynamicComposite)composite;
        }
      }
    }
 else {
      dc=new MultipleThreadDynamicComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,category,element,true);
    }
  }
 else   if (element instanceof Connection) {
    dc=new MainConnectionComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,category,element);
  }
 else   if (element instanceof Note) {
    if (category == EComponentCategory.BASIC) {
      if (parent.getLayout() instanceof FillLayout) {
        FillLayout layout=(FillLayout)parent.getLayout();
        layout.type=SWT.VERTICAL;
        layout.marginHeight=0;
        layout.marginWidth=0;
        layout.spacing=0;
      }
      ScrolledComposite scrolled=new ScrolledComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL);
      scrolled.setExpandHorizontal(true);
      scrolled.setExpandVertical(true);
      scrolled.setMinWidth(600);
      scrolled.setMinHeight(400);
      Composite composite=tabFactory.getWidgetFactory().createComposite(scrolled);
      scrolled.setContent(composite);
      composite.setLayout(new FormLayout());
      FormData d=new FormData();
      d.left=new FormAttachment(0,0);
      d.right=new FormAttachment(100,0);
      d.top=new FormAttachment(0,0);
      d.bottom=new FormAttachment(100,0);
      composite.setLayoutData(d);
      AbstractNotePropertyComposite c1=new BasicNotePropertyComposite(composite,(Note)element,tabFactory);
      parent.layout();
    }
  }
 else   if (element instanceof SubjobContainer) {
    if (category == EComponentCategory.BASIC) {
      dc=new SubjobBasicComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,element);
    }
  }
 else {
    tabFactory.getTabbedPropertyComposite().setCompactViewVisible(false);
    dc=new MultipleThreadDynamicComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS,category,element,true);
  }
  if (parent.getChildren().length == 0) {
    if (parent.getLayout() instanceof FillLayout) {
      FillLayout layout=(FillLayout)parent.getLayout();
      layout.type=SWT.VERTICAL;
      layout.marginHeight=0;
      layout.marginWidth=0;
      layout.spacing=0;
    }
    Composite composite=tabFactory.getWidgetFactory().createComposite(parent);
    composite.setLayout(new FormLayout());
    FormData d=new FormData();
    d.left=new FormAttachment(2,0);
    d.right=new FormAttachment(100,0);
    d.top=new FormAttachment(5,0);
    d.bottom=new FormAttachment(100,0);
    composite.setLayoutData(d);
    Label alertText=new Label(composite,SWT.NONE);
    alertText.setText(Messages.getString("String_Node_Str"));
    alertText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    parent.layout();
  }
  if (dc != null) {
    dc.refresh();
  }
}