Program: 62292
Project: 62292
Buggy source:
private void initTable(SashForm sashForm_1){
  table=new Table(sashForm_1,SWT.BORDER | SWT.FULL_SELECTION);
  table.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      TableItem[] items=table.getSelection();
      itemSelected=items[0];
      TreeItem[] treeItems=tree.getSelection();
      treeItemSelected=treeItems[0];
      NodeType type=(NodeType)items[0].getData(NODE_TYPE);
switch (type) {
case SERVER:
        serverItemSelected();
      break;
case DATABASE:
case CONTAINER:
    dbContainerItemSelected(items[0]);
  break;
default :
dataItemSelected();
break;
}
}
}
);
table.addMouseListener(new MouseAdapter(){
@Override public void mouseDoubleClick(MouseEvent e){
TreeItem[] treeItems=tree.getSelection();
Point point=new Point(e.x,e.y);
TableItem selectedItem=table.getItem(point);
if (selectedItem != null) {
NodeType type=(NodeType)selectedItem.getData(NODE_TYPE);
if (type == NodeType.CONTAINER || type == NodeType.DATABASE || type == NodeType.SERVER) {
boolean find=false;
for (TreeItem treeItem : treeItems[0].getItems()) {
String treeText=treeItem.getText();
String tableText=selectedItem.getText(0);
if (treeText.equals(tableText)) {
  find=true;
  if (type == NodeType.CONTAINER || type == NodeType.DATABASE)   dbContainerTreeItemSelected(treeItem,false);
 else   if (type == NodeType.SERVER)   serverTreeItemSelected(treeItem,false);
  history.add(treeItem);
  btnBackward.setEnabled(true);
  btnForward.setEnabled(false);
  break;
}
}
if (!find) MessageDialog.openInformation(shlRedisClient,"String_Node_Str","String_Node_Str" + text.getText());
}
 else {
properties();
}
}
}
@Override public void mouseDown(MouseEvent e){
Point point=new Point(e.x,e.y);
TableItem selectedItem=table.getItem(point);
if (e.button == 3) {
if (selectedItem == null) table.setMenu(menu_null);
 else {
NodeType type=(NodeType)selectedItem.getData(NODE_TYPE);
if (type == NodeType.ROOT) table.setMenu(menu_null);
 else if (type == NodeType.SERVER) table.setMenu(menuTableServer);
 else if (type == NodeType.DATABASE || type == NodeType.CONTAINER) {
updateMenuDBContainer(type,menuTableDBContainer);
table.setMenu(menuTableDBContainer);
}
 else {
table.setMenu(menu_key);
}
}
}
}
}
);
table.setHeaderVisible(true);
tblclmnName=new TableColumn(table,SWT.NONE);
tblclmnName.setWidth(150);
tblclmnName.setText("String_Node_Str");
tblclmnName.addSelectionListener(new SelectionAdapter(){
@Override public void widgetSelected(SelectionEvent e){
columnSelected(tblclmnName,OrderBy.NAME);
}
}
);
tblclmnType=new TableColumn(table,SWT.NONE);
tblclmnType.setWidth(150);
tblclmnType.setText("String_Node_Str");
tblclmnType.addSelectionListener(new SelectionAdapter(){
@Override public void widgetSelected(SelectionEvent e){
columnSelected(tblclmnType,OrderBy.TYPE);
}
}
);
tblclmnSize=new TableColumn(table,SWT.NONE);
tblclmnSize.setWidth(100);
tblclmnSize.setText("String_Node_Str");
tblclmnSize.addSelectionListener(new SelectionAdapter(){
@Override public void widgetSelected(SelectionEvent e){
columnSelected(tblclmnSize,OrderBy.SIZE);
}
}
);
}

Fixed version (ground truth):
private void initTable(SashForm sashForm_1){
  table=new Table(sashForm_1,SWT.BORDER | SWT.FULL_SELECTION);
  table.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      tableItemSelected();
    }
  }
);
  table.addMouseListener(new MouseAdapter(){
    @Override public void mouseDoubleClick(    MouseEvent e){
      TreeItem[] treeItems=tree.getSelection();
      Point point=new Point(e.x,e.y);
      TableItem selectedItem=table.getItem(point);
      if (selectedItem != null) {
        NodeType type=(NodeType)selectedItem.getData(NODE_TYPE);
        if (type == NodeType.CONTAINER || type == NodeType.DATABASE || type == NodeType.SERVER) {
          boolean find=false;
          for (          TreeItem treeItem : treeItems[0].getItems()) {
            String treeText=treeItem.getText();
            String tableText=selectedItem.getText(0);
            if (treeText.equals(tableText)) {
              find=true;
              if (type == NodeType.CONTAINER || type == NodeType.DATABASE)               dbContainerTreeItemSelected(treeItem,false);
 else               if (type == NodeType.SERVER)               serverTreeItemSelected(treeItem,false);
              history.add(treeItem);
              btnBackward.setEnabled(true);
              btnForward.setEnabled(false);
              break;
            }
          }
          if (!find)           MessageDialog.openInformation(shlRedisClient,"String_Node_Str","String_Node_Str" + text.getText());
        }
 else {
          dataProperties();
        }
      }
    }
    @Override public void mouseDown(    MouseEvent e){
      Point point=new Point(e.x,e.y);
      TableItem selectedItem=table.getItem(point);
      if (e.button == 3) {
        if (selectedItem == null)         table.setMenu(menu_null);
 else {
          NodeType type=(NodeType)selectedItem.getData(NODE_TYPE);
          if (type == NodeType.ROOT)           table.setMenu(menu_null);
 else           if (type == NodeType.SERVER)           table.setMenu(menuTableServer);
 else           if (type == NodeType.DATABASE || type == NodeType.CONTAINER) {
            updateMenuDBContainer(type,menuTableDBContainer);
            table.setMenu(menuTableDBContainer);
          }
 else {
            table.setMenu(menu_key);
          }
        }
      }
    }
  }
);
  table.setHeaderVisible(true);
  tblclmnName=new TableColumn(table,SWT.NONE);
  tblclmnName.setWidth(150);
  tblclmnName.setText("String_Node_Str");
  tblclmnName.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      columnSelected(tblclmnName,OrderBy.NAME);
    }
  }
);
  tblclmnType=new TableColumn(table,SWT.NONE);
  tblclmnType.setWidth(150);
  tblclmnType.setText("String_Node_Str");
  tblclmnType.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      columnSelected(tblclmnType,OrderBy.TYPE);
    }
  }
);
  tblclmnSize=new TableColumn(table,SWT.NONE);
  tblclmnSize.setWidth(100);
  tblclmnSize.setText("String_Node_Str");
  tblclmnSize.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      columnSelected(tblclmnSize,OrderBy.SIZE);
    }
  }
);
}