Program: 139502
Project: 139502
Buggy source:
/** 
 * DOC qzhang Comment method "createOneUnit".
 * @param treeItem
 * @param indicatorUnit
 */
public void createOneUnit(final TreeItem treeItem,IndicatorUnit indicatorUnit){
  final TreeItem indicatorItem=new TreeItem(treeItem,SWT.NONE);
  final IndicatorUnit unit=indicatorUnit;
  IndicatorEnum indicatorType=indicatorUnit.getType();
  indicatorItem.setData(COLUMN_INDICATOR_KEY,treeItem.getData(COLUMN_INDICATOR_KEY));
  indicatorItem.setData(INDICATOR_UNIT_KEY,unit);
  indicatorItem.setData(VIEWER_KEY,this);
  indicatorItem.setImage(0,getIndicatorIamge(unit));
  String label=indicatorUnit.getIndicatorName();
  indicatorItem.setText(0,label);
  TreeEditor optionEditor;
  optionEditor=new TreeEditor(tree);
  Label optionLabel=new Label(tree,SWT.NONE);
  optionLabel.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
  optionLabel.setImage(ImageLib.getImage(ImageLib.INDICATOR_OPTION));
  optionLabel.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  optionLabel.pack();
  optionLabel.setData(indicatorUnit);
  optionLabel.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      openIndicatorOptionDialog(null,indicatorItem);
    }
  }
);
  optionEditor.minimumWidth=optionLabel.getImage().getBounds().width;
  optionEditor.horizontalAlignment=SWT.CENTER;
  optionEditor.setEditor(optionLabel,indicatorItem,1);
  TreeEditor delEditor=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){
      ColumnIndicator columnIndicator=(ColumnIndicator)treeItem.getData(COLUMN_INDICATOR_KEY);
      deleteIndicatorItems(columnIndicator,unit);
      if (indicatorItem.getParentItem() != null && indicatorItem.getParentItem().getData(INDICATOR_UNIT_KEY) != null) {
        setElements(columnIndicators);
      }
 else {
        removeItemBranch(indicatorItem);
      }
    }
  }
);
  delEditor.minimumWidth=delLabel.getImage().getBounds().width;
  delEditor.horizontalAlignment=SWT.CENTER;
  delEditor.setEditor(delLabel,indicatorItem,3);
  indicatorItem.setData(ITEM_EDITOR_KEY,new TreeEditor[]{optionEditor,delEditor});
  if (indicatorType.hasChildren()) {
    indicatorItem.setData(treeItem.getData(COLUMN_INDICATOR_KEY));
    createIndicatorItems(indicatorItem,indicatorUnit.getChildren());
  }
  createIndicatorParameters(indicatorItem,indicatorUnit);
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "createOneUnit".
 * @param treeItem
 * @param indicatorUnit
 */
public void createOneUnit(final TreeItem treeItem,IndicatorUnit indicatorUnit){
  final TreeItem indicatorItem=new TreeItem(treeItem,SWT.NONE);
  final IndicatorUnit unit=indicatorUnit;
  IndicatorEnum indicatorType=indicatorUnit.getType();
  indicatorItem.setData(COLUMN_INDICATOR_KEY,treeItem.getData(COLUMN_INDICATOR_KEY));
  indicatorItem.setData(INDICATOR_UNIT_KEY,unit);
  indicatorItem.setData(VIEWER_KEY,this);
  indicatorItem.setImage(0,getIndicatorIamge(unit));
  String indicatorName=indicatorUnit.getIndicatorName();
  String label=indicatorName == null ? "String_Node_Str" : indicatorName;
  indicatorItem.setText(0,label);
  TreeEditor optionEditor;
  optionEditor=new TreeEditor(tree);
  Label optionLabel=new Label(tree,SWT.NONE);
  optionLabel.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
  optionLabel.setImage(ImageLib.getImage(ImageLib.INDICATOR_OPTION));
  optionLabel.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  optionLabel.pack();
  optionLabel.setData(indicatorUnit);
  optionLabel.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      openIndicatorOptionDialog(null,indicatorItem);
    }
  }
);
  optionEditor.minimumWidth=optionLabel.getImage().getBounds().width;
  optionEditor.horizontalAlignment=SWT.CENTER;
  optionEditor.setEditor(optionLabel,indicatorItem,1);
  TreeEditor delEditor=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){
      ColumnIndicator columnIndicator=(ColumnIndicator)treeItem.getData(COLUMN_INDICATOR_KEY);
      deleteIndicatorItems(columnIndicator,unit);
      if (indicatorItem.getParentItem() != null && indicatorItem.getParentItem().getData(INDICATOR_UNIT_KEY) != null) {
        setElements(columnIndicators);
      }
 else {
        removeItemBranch(indicatorItem);
      }
    }
  }
);
  delEditor.minimumWidth=delLabel.getImage().getBounds().width;
  delEditor.horizontalAlignment=SWT.CENTER;
  delEditor.setEditor(delLabel,indicatorItem,3);
  indicatorItem.setData(ITEM_EDITOR_KEY,new TreeEditor[]{optionEditor,delEditor});
  if (indicatorType.hasChildren()) {
    indicatorItem.setData(treeItem.getData(COLUMN_INDICATOR_KEY));
    createIndicatorItems(indicatorItem,indicatorUnit.getChildren());
  }
  createIndicatorParameters(indicatorItem,indicatorUnit);
}