Program: 62327
Project: 62327
Buggy source:
private void initSash() throws IOException {
  SashForm sashForm_2=new SashForm(shlRedisClient,SWT.SMOOTH | SWT.VERTICAL);
  sashForm_2.setSashWidth(0);
  text=new Text(sashForm_2,SWT.BORDER | SWT.SEARCH);
  text.setEditable(false);
  SashForm sashForm=new SashForm(sashForm_2,SWT.NONE);
  tree=new Tree(sashForm,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
  initMenuDB();
  tree.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      TreeItem[] items=tree.getSelection();
      NodeType type=(NodeType)items[0].getData(NODE_TYPE);
switch (type) {
case SERVER:
        table.removeAll();
      try {
        int dbs=service1.listDBs((Integer)items[0].getData(NODE_ID));
        for (int i=0; i < dbs; i++) {
          TableItem item=new TableItem(table,SWT.NONE);
          item.setText(new String[]{DB_PREFIX + i,NodeType.DATABASE.toString()});
          item.setData(NODE_ID,i);
        }
      }
 catch (      IOException e1) {
        MessageDialog.openError(shlRedisClient,"String_Node_Str",e1.getMessage());
      }
    break;
case DATABASE:
case CONTAINER:
  table.removeAll();
items[0].removeAll();
ContainerInfo info=new ContainerInfo();
parseContainer(items[0],info);
Set<Node> cnodes=service2.listContainers(info.getId(),info.getDb(),info.getContainer());
for (Node node : cnodes) {
TreeItem item=new TreeItem(items[0],SWT.NONE);
item.setText(node.getKey());
item.setData(NODE_TYPE,node.getType());
item.setExpanded(true);
}
for (Node node : cnodes) {
TableItem item=new TableItem(table,SWT.NONE);
item.setText(new String[]{node.getKey(),node.getType().toString()});
}
Set<Node> knodes=service2.listContainerKeys(info.getId(),info.getDb(),info.getContainer());
for (Node node : knodes) {
TableItem item=new TableItem(table,SWT.NONE);
item.setText(new String[]{node.getKey(),node.getType().toString()});
}
break;
default :
break;
}
}
}
);
SashForm sashForm_1=new SashForm(sashForm,SWT.VERTICAL);
initTable(sashForm_1);
TabFolder tabFolder=new TabFolder(sashForm_1,SWT.NONE);
sashForm_1.setWeights(new int[]{1,1});
sashForm.setWeights(new int[]{1,3});
sashForm_2.setWeights(new int[]{22,368});
initMenuNull();
initMenuServer();
initServers();
}

Fixed version (ground truth):
private void initSash() throws IOException {
  SashForm sashForm_2=new SashForm(shlRedisClient,SWT.SMOOTH | SWT.VERTICAL);
  sashForm_2.setSashWidth(0);
  text=new Text(sashForm_2,SWT.BORDER | SWT.SEARCH);
  text.setEditable(false);
  SashForm sashForm=new SashForm(sashForm_2,SWT.NONE);
  tree=new Tree(sashForm,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
  initMenuDB();
  tree.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      TreeItem[] items=tree.getSelection();
      NodeType type=(NodeType)items[0].getData(NODE_TYPE);
switch (type) {
case SERVER:
        text.setText(items[0].getText() + "String_Node_Str");
      table.removeAll();
    try {
      int dbs=service1.listDBs((Integer)items[0].getData(NODE_ID));
      for (int i=0; i < dbs; i++) {
        TableItem item=new TableItem(table,SWT.NONE);
        item.setText(new String[]{DB_PREFIX + i,NodeType.DATABASE.toString()});
        item.setData(NODE_ID,i);
      }
    }
 catch (    IOException e1) {
      MessageDialog.openError(shlRedisClient,"String_Node_Str",e1.getMessage());
    }
  break;
case DATABASE:
case CONTAINER:
ContainerInfo info=new ContainerInfo();
parseContainer(items[0],info);
String container=(info.getContainer() == null) ? "String_Node_Str" : info.getContainer();
text.setText(info.getServerName() + "String_Node_Str" + DB_PREFIX+ info.getDb()+ "String_Node_Str"+ container);
table.removeAll();
Set<Node> cnodes=service2.listContainers(info.getId(),info.getDb(),info.getContainer());
if (items[0].getData(ITEM_OPENED) == null) {
items[0].removeAll();
for (Node node : cnodes) {
TreeItem item=new TreeItem(items[0],SWT.NONE);
item.setText(node.getKey());
item.setData(NODE_TYPE,node.getType());
item.setExpanded(true);
}
items[0].setData(ITEM_OPENED,true);
}
for (Node node : cnodes) {
TableItem item=new TableItem(table,SWT.NONE);
item.setText(new String[]{node.getKey(),node.getType().toString()});
}
Set<Node> knodes=service2.listContainerKeys(info.getId(),info.getDb(),info.getContainer());
for (Node node1 : knodes) {
TableItem item=new TableItem(table,SWT.NONE);
item.setText(new String[]{node1.getKey(),node1.getType().toString()});
}
break;
default :
break;
}
}
}
);
SashForm sashForm_1=new SashForm(sashForm,SWT.VERTICAL);
initTable(sashForm_1);
TabFolder tabFolder=new TabFolder(sashForm_1,SWT.NONE);
sashForm_1.setWeights(new int[]{1,1});
sashForm.setWeights(new int[]{1,3});
sashForm_2.setWeights(new int[]{22,368});
initMenuNull();
initMenuServer();
initServers();
}