Program: 138233
Project: 138233
Buggy source:
private void addItemElements(final ModelElementIndicator[] elements){
  for (int i=0; i < elements.length; i++) {
    final ModelElementIndicator meIndicator=(ModelElementIndicator)elements[i];
    final ModelElement modelElement=RepositoryNodeHelper.getSubModelElement(meIndicator.getModelElementRepositoryNode());
    final TreeItem treeItem=new TreeItem(tree,SWT.NONE);
    MetadataHelper.setDataminingType(DataminingType.NOMINAL,modelElement);
    columnSetMultiValueList.add(meIndicator.getModelElementRepositoryNode());
    treeItem.setImage(ImageLib.getImage(ImageLib.TD_COLUMN));
    treeItem.setText(0,getModelElemetnDisplayName(meIndicator));
    treeItem.setData(COLUMN_INDICATOR_KEY,modelElement);
    treeItem.setData(MODELELEMENT_INDICATOR_KEY,meIndicator);
    TreeEditor comboEditor=new TreeEditor(tree);
    final CCombo combo=new CCombo(tree,SWT.BORDER);
    for (    DataminingType type : DataminingType.values()) {
      combo.add(type.getLiteral());
    }
    DataminingType dataminingType=MetadataHelper.getDataminingType(modelElement);
    if (meIndicator instanceof DelimitedFileIndicator) {
      dataminingType=MetadataHelper.getDefaultDataminingType(meIndicator.getJavaType());
    }
    if (dataminingType == null) {
      combo.select(0);
    }
 else {
      combo.setText(dataminingType.getLiteral());
    }
    combo.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        MetadataHelper.setDataminingType(DataminingType.get(combo.getText()),modelElement);
        setDirty(true);
      }
    }
);
    combo.setEditable(false);
    comboEditor.minimumWidth=WIDTH1_CELL;
    comboEditor.setEditor(combo,treeItem,1);
    TreeEditor addPatternEditor=new TreeEditor(tree);
    Label addPatternLabl=new Label(tree,SWT.NONE);
    addPatternLabl.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
    addPatternLabl.setImage(ImageLib.getImage(ImageLib.ADD_PATTERN));
    addPatternLabl.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
    addPatternLabl.pack();
    PatternMouseAdapter mouseAdapter=new PatternMouseAdapter(this,masterPage,meIndicator,treeItem);
    mouseAdapter.addFilter(new ViewerFilter(){
      @Override public boolean select(      Viewer viewer,      Object parentElement,      Object element){
        if (element instanceof IFolder) {
          IFolder folder=(IFolder)element;
          return !folder.getName().endsWith("String_Node_Str");
        }
        return true;
      }
    }
);
    addPatternLabl.addMouseListener(mouseAdapter);
    addPatternEditor.minimumWidth=addPatternLabl.getImage().getBounds().width;
    addPatternEditor.setEditor(addPatternLabl,treeItem,2);
    TreeEditor delLabelEditor=new TreeEditor(tree);
    Label delLabel=new Label(tree,SWT.NONE);
    delLabel.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
    delLabel.setImage(ImageLib.getImage(ImageLib.DELETE_ACTION));
    delLabel.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
    delLabel.pack();
    delLabel.addMouseListener(new MouseAdapter(){
      @Override public void mouseDown(      MouseEvent e){
        deleteColumnItems(meIndicator.getModelElementRepositoryNode());
        removeItemBranch(treeItem);
        enabledButtons(false);
        updateBindConnection(masterPage,tree);
      }
    }
);
    delLabelEditor.minimumWidth=delLabel.getImage().getBounds().width;
    delLabelEditor.horizontalAlignment=SWT.CENTER;
    delLabelEditor.setEditor(delLabel,treeItem,3);
    treeItem.setData(ITEM_EDITOR_KEY,new TreeEditor[]{comboEditor,addPatternEditor,delLabelEditor});
    if (meIndicator.hasIndicators()) {
      createIndicatorItems(treeItem,meIndicator.getIndicatorUnits());
    }
    delLabelEditor.layout();
    treeItem.setExpanded(true);
  }
  tree.layout();
  tree.redraw();
  this.setDirty(true);
  tree.forceFocus();
}

Fixed version (ground truth):
private void addItemElements(final ModelElementIndicator[] elements){
  for (int i=0; i < elements.length; i++) {
    final ModelElementIndicator meIndicator=(ModelElementIndicator)elements[i];
    final ModelElement modelElement=RepositoryNodeHelper.getSubModelElement(meIndicator.getModelElementRepositoryNode());
    final TreeItem treeItem=new TreeItem(tree,SWT.NONE);
    MetadataHelper.setDataminingType(DataminingType.NOMINAL,modelElement);
    columnSetMultiValueList.add(meIndicator.getModelElementRepositoryNode());
    treeItem.setImage(ImageLib.getImage(ImageLib.TD_COLUMN));
    treeItem.setText(0,getModelElemetnDisplayName(meIndicator));
    treeItem.setData(COLUMN_INDICATOR_KEY,modelElement);
    treeItem.setData(MODELELEMENT_INDICATOR_KEY,meIndicator);
    TreeEditor comboEditor=new TreeEditor(tree);
    final CCombo combo=new CCombo(tree,SWT.BORDER);
    for (    DataminingType type : DataminingType.values()) {
      combo.add(type.getLiteral());
    }
    DataminingType dataminingType=MetadataHelper.getDataminingType(modelElement);
    if (meIndicator instanceof DelimitedFileIndicator) {
      dataminingType=MetadataHelper.getDefaultDataminingType(meIndicator.getJavaType());
    }
 else     if (meIndicator instanceof XmlElementIndicator) {
      dataminingType=MetadataHelper.getDataminingType(modelElement);
    }
    if (dataminingType == null) {
      combo.select(0);
    }
 else {
      combo.setText(dataminingType.getLiteral());
    }
    combo.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        MetadataHelper.setDataminingType(DataminingType.get(combo.getText()),modelElement);
        setDirty(true);
      }
    }
);
    combo.setEditable(false);
    comboEditor.minimumWidth=WIDTH1_CELL;
    comboEditor.setEditor(combo,treeItem,1);
    TreeEditor addPatternEditor=new TreeEditor(tree);
    Label addPatternLabl=new Label(tree,SWT.NONE);
    addPatternLabl.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
    addPatternLabl.setImage(ImageLib.getImage(ImageLib.ADD_PATTERN));
    addPatternLabl.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
    addPatternLabl.pack();
    PatternMouseAdapter mouseAdapter=new PatternMouseAdapter(this,masterPage,meIndicator,treeItem);
    mouseAdapter.addFilter(new ViewerFilter(){
      @Override public boolean select(      Viewer viewer,      Object parentElement,      Object element){
        if (element instanceof IFolder) {
          IFolder folder=(IFolder)element;
          return !folder.getName().endsWith("String_Node_Str");
        }
        return true;
      }
    }
);
    addPatternLabl.addMouseListener(mouseAdapter);
    addPatternEditor.minimumWidth=addPatternLabl.getImage().getBounds().width;
    addPatternEditor.setEditor(addPatternLabl,treeItem,2);
    TreeEditor delLabelEditor=new TreeEditor(tree);
    Label delLabel=new Label(tree,SWT.NONE);
    delLabel.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
    delLabel.setImage(ImageLib.getImage(ImageLib.DELETE_ACTION));
    delLabel.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
    delLabel.pack();
    delLabel.addMouseListener(new MouseAdapter(){
      @Override public void mouseDown(      MouseEvent e){
        deleteColumnItems(meIndicator.getModelElementRepositoryNode());
        removeItemBranch(treeItem);
        enabledButtons(false);
        updateBindConnection(masterPage,tree);
      }
    }
);
    delLabelEditor.minimumWidth=delLabel.getImage().getBounds().width;
    delLabelEditor.horizontalAlignment=SWT.CENTER;
    delLabelEditor.setEditor(delLabel,treeItem,3);
    treeItem.setData(ITEM_EDITOR_KEY,new TreeEditor[]{comboEditor,addPatternEditor,delLabelEditor});
    if (meIndicator.hasIndicators()) {
      createIndicatorItems(treeItem,meIndicator.getIndicatorUnits());
    }
    delLabelEditor.layout();
    treeItem.setExpanded(true);
  }
  tree.layout();
  tree.redraw();
  this.setDirty(true);
  tree.forceFocus();
}