Program: 62241
Project: 62241
Buggy source:
private void initTable(CTabFolder tabFolder){
  table=new Table(tabFolder,SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
  mainTabItem.setControl(table);
  table.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      tableItemSelected();
    }
  }
);
  table.addMouseListener(new MouseAdapter(){
    @Override public void mouseDoubleClick(    MouseEvent e){
      logger.debug("String_Node_Str");
      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(shell,i18nFile.getText(I18nFile.INFORMATION),i18nFile.getText(I18nFile.NEWKEYFOUND) + 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) {
            updateMenuServer(true,menuTableServer);
            table.setMenu(menuTableServer);
          }
 else           if (type == NodeType.CONTAINER) {
            TableItem[] items=table.getSelection();
            if (items.length == 1) {
              updateMenuDBContainer(type,menuTableDBContainer);
              table.setMenu(menuTableDBContainer);
            }
 else {
              table.setMenu(menu_Multi);
            }
          }
 else           if (type == NodeType.DATABASE) {
            updateMenuDBContainer(type,menuTableDBContainer);
            table.setMenu(menuTableDBContainer);
          }
 else {
            TableItem[] items=table.getSelection();
            if (items.length == 1)             table.setMenu(menu_key);
 else             table.setMenu(menu_Multi);
          }
        }
      }
    }
  }
);
  table.setHeaderVisible(true);
  tblclmnName=new TableColumn(table,SWT.NONE);
  tblclmnName.setWidth(150);
  tblclmnName.setText(i18nFile.getText(I18nFile.NAME));
  tblclmnName.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      orderColumnSelected(OrderBy.NAME);
    }
  }
);
  tblclmnType=new TableColumn(table,SWT.NONE);
  tblclmnType.setWidth(150);
  tblclmnType.setText(i18nFile.getText(I18nFile.TYPE));
  tblclmnType.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      orderColumnSelected(OrderBy.TYPE);
    }
  }
);
  tblclmnSize=new TableColumn(table,SWT.NONE);
  tblclmnSize.setWidth(100);
  tblclmnSize.setText(i18nFile.getText(I18nFile.SIZE));
  tblclmnSize.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      orderColumnSelected(OrderBy.SIZE);
    }
  }
);
}

Fixed version (ground truth):
private void initTable(CTabFolder tabFolder){
  table=new Table(tabFolder,SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
  mainTabItem.setControl(table);
  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(shell,i18nFile.getText(I18nFile.INFORMATION),i18nFile.getText(I18nFile.NEWKEYFOUND) + 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) {
            updateMenuServer(true,menuTableServer);
            table.setMenu(menuTableServer);
          }
 else           if (type == NodeType.CONTAINER) {
            TableItem[] items=table.getSelection();
            if (items.length == 1) {
              updateMenuDBContainer(type,menuTableDBContainer);
              table.setMenu(menuTableDBContainer);
            }
 else {
              table.setMenu(menu_Multi);
            }
          }
 else           if (type == NodeType.DATABASE) {
            updateMenuDBContainer(type,menuTableDBContainer);
            table.setMenu(menuTableDBContainer);
          }
 else {
            TableItem[] items=table.getSelection();
            if (items.length == 1)             table.setMenu(menu_key);
 else             table.setMenu(menu_Multi);
          }
        }
      }
    }
  }
);
  table.setHeaderVisible(true);
  tblclmnName=new TableColumn(table,SWT.NONE);
  tblclmnName.setWidth(150);
  tblclmnName.setText(i18nFile.getText(I18nFile.NAME));
  tblclmnName.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      orderColumnSelected(OrderBy.NAME);
    }
  }
);
  tblclmnType=new TableColumn(table,SWT.NONE);
  tblclmnType.setWidth(150);
  tblclmnType.setText(i18nFile.getText(I18nFile.TYPE));
  tblclmnType.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      orderColumnSelected(OrderBy.TYPE);
    }
  }
);
  tblclmnSize=new TableColumn(table,SWT.NONE);
  tblclmnSize.setWidth(100);
  tblclmnSize.setText(i18nFile.getText(I18nFile.SIZE));
  tblclmnSize.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      orderColumnSelected(OrderBy.SIZE);
    }
  }
);
}