Program: 139882
Project: 139882
Buggy source:
private void addItemElements(final TableIndicator[] elements){
  for (int i=0; i < elements.length; i++) {
    final TreeItem treeItem=new TreeItem(tree,SWT.NONE);
    final TableIndicator tableIndicator=elements[i];
    treeItem.setImage(ImageLib.getImage(ImageLib.TABLE));
    treeItem.setText(0,tableIndicator.getTdTable().getName());
    treeItem.setData(TABLE_INDICATOR_KEY,tableIndicator);
    TreeEditor addDQRuleEditor=new TreeEditor(tree);
    Label addDQRuleLabl=new Label(tree,SWT.NONE);
    addDQRuleLabl.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
    addDQRuleLabl.setImage(ImageLib.getImage(ImageLib.ADD_DQ));
    addDQRuleLabl.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
    addDQRuleLabl.pack();
    addDQRuleLabl.addMouseListener(new MouseAdapter(){
      @Override public void mouseDown(      MouseEvent e){
        showAddDQRuleDialog(treeItem,tableIndicator);
      }
    }
);
    addDQRuleEditor.minimumWidth=addDQRuleLabl.getImage().getBounds().width;
    addDQRuleEditor.setEditor(addDQRuleLabl,treeItem,1);
    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){
        deleteTableItems(tableIndicator);
        if (treeItem.getParentItem() != null && treeItem.getParentItem().getData(INDICATOR_UNIT_KEY) != null) {
          setElements(tableIndicators);
        }
 else {
          removeItemBranch(treeItem);
        }
      }
    }
);
    delLabelEditor.minimumWidth=delLabel.getImage().getBounds().width;
    delLabelEditor.horizontalAlignment=SWT.CENTER;
    delLabelEditor.setEditor(delLabel,treeItem,2);
    treeItem.setData(ITEM_EDITOR_KEY,new TreeEditor[]{addDQRuleEditor,delLabelEditor});
    if (tableIndicator.hasIndicators()) {
      createIndicatorItems(treeItem,tableIndicator.getIndicatorUnits());
    }
    treeItem.setExpanded(true);
  }
  this.setDirty(true);
}

Fixed version (ground truth):
private void addItemElements(final TableIndicator[] elements){
  for (int i=0; i < elements.length; i++) {
    final TreeItem treeItem=new TreeItem(tree,SWT.NONE);
    final TableIndicator tableIndicator=elements[i];
    treeItem.setImage(ImageLib.getImage(ImageLib.TABLE));
    treeItem.setText(0,tableIndicator.getTdTable().getName());
    treeItem.setData(TABLE_INDICATOR_KEY,tableIndicator);
    TreeEditor addDQRuleEditor=new TreeEditor(tree);
    Label addDQRuleLabl=new Label(tree,SWT.NONE);
    addDQRuleLabl.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
    addDQRuleLabl.setImage(ImageLib.getImage(ImageLib.ADD_DQ));
    addDQRuleLabl.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
    addDQRuleLabl.pack();
    addDQRuleLabl.addMouseListener(new MouseAdapter(){
      @Override public void mouseDown(      MouseEvent e){
        showAddDQRuleDialog(treeItem,tableIndicator);
      }
    }
);
    addDQRuleEditor.minimumWidth=addDQRuleLabl.getImage().getBounds().width;
    addDQRuleEditor.setEditor(addDQRuleLabl,treeItem,1);
    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){
        deleteTableItems(tableIndicator);
        if (treeItem.getParentItem() != null && treeItem.getParentItem().getData(INDICATOR_UNIT_KEY) != null) {
          setElements(tableIndicators);
        }
 else {
          removeItemBranch(treeItem);
          indicatorTreeItemMap.remove(tableIndicator);
        }
      }
    }
);
    delLabelEditor.minimumWidth=delLabel.getImage().getBounds().width;
    delLabelEditor.horizontalAlignment=SWT.CENTER;
    delLabelEditor.setEditor(delLabel,treeItem,2);
    treeItem.setData(ITEM_EDITOR_KEY,new TreeEditor[]{addDQRuleEditor,delLabelEditor});
    if (tableIndicator.hasIndicators()) {
      createIndicatorItems(treeItem,tableIndicator.getIndicatorUnits());
    }
    treeItem.setExpanded(true);
    this.indicatorTreeItemMap.put(tableIndicator,treeItem);
  }
  this.setDirty(true);
}