Program: 67180
Project: 67180
Buggy source:
private int createValueListComposite(Composite parent){
  if (valueListComposite != null && !valueListComposite.isDisposed()) {
    return 0;
  }
  if (expressionValue1 != null && !expressionValue1.isDisposed()) {
    ExpressionButtonUtil.getExpressionButton(expressionValue1).getControl().dispose();
    expressionValue1.dispose();
    expressionValue1=null;
    dummy1.dispose();
    dummy1=null;
    ExpressionButtonUtil.getExpressionButton(expressionValue2).getControl().dispose();
    expressionValue2.dispose();
    expressionValue2=null;
    dummy2.dispose();
    dummy2=null;
    andLable.dispose();
    andLable=null;
  }
  valueListComposite=new Composite(parent,SWT.NONE);
  GridData gdata=new GridData(GridData.FILL_HORIZONTAL);
  gdata.horizontalSpan=4;
  valueListComposite.setLayoutData(gdata);
  GridLayout layout=new GridLayout();
  layout.numColumns=4;
  valueListComposite.setLayout(layout);
  Group group=new Group(valueListComposite,SWT.NONE);
  GridData data=new GridData(GridData.FILL_HORIZONTAL);
  data.heightHint=118;
  data.horizontalSpan=3;
  data.horizontalIndent=0;
  data.horizontalAlignment=SWT.BEGINNING;
  data.grabExcessHorizontalSpace=true;
  group.setLayoutData(data);
  layout=new GridLayout();
  layout.numColumns=5;
  group.setLayout(layout);
  new Label(group,SWT.NONE).setText(Messages.getString("String_Node_Str"));
  GridData expgd=new GridData();
  expgd.widthHint=100;
  addExpressionValue=createExpressionValue(group);
  addExpressionValue.setLayoutData(expgd);
  addBtn=new Button(group,SWT.PUSH);
  addBtn.setText(Messages.getString("String_Node_Str"));
  addBtn.setToolTipText(Messages.getString("String_Node_Str"));
  setButtonLayoutData(addBtn);
  addBtn.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      String value=addExpressionValue.getText().trim();
      if (valueList.indexOf(value) < 0) {
        valueList.add(value);
        tableViewer.refresh();
        updateButtons();
        addExpressionValue.setFocus();
        addExpressionValue.setText("String_Node_Str");
      }
 else {
        addBtn.setEnabled(false);
      }
    }
  }
);
  new Label(group,SWT.NONE);
  int tableStyle=SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL| SWT.V_SCROLL| SWT.FULL_SELECTION;
  table=new Table(group,tableStyle);
  data=new GridData(GridData.FILL_VERTICAL);
  data.horizontalSpan=4;
  table.setLayoutData(data);
  table.setHeaderVisible(false);
  table.setLinesVisible(true);
  TableColumn column;
  int i;
  String[] columNames=new String[]{Messages.getString("String_Node_Str")};
  int[] columLength=new int[]{288};
  for (i=0; i < columNames.length; i++) {
    column=new TableColumn(table,SWT.NONE,i);
    column.setText(columNames[i]);
    column.setWidth(columLength[i]);
  }
  table.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      checkEditDelButtonStatus();
    }
  }
);
  table.addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent e){
      if (e.keyCode == SWT.DEL) {
        int index=table.getSelectionIndex();
        if (index > -1) {
          valueList.remove(index);
          tableViewer.refresh();
          if (valueList.size() > 0) {
            if (valueList.size() <= index) {
              index=index - 1;
            }
            table.select(index);
          }
          updateButtons();
        }
 else {
          delBtn.setEnabled(false);
        }
      }
    }
    public void keyReleased(    KeyEvent e){
    }
  }
);
  table.addMouseListener(new MouseAdapter(){
    public void mouseDoubleClick(    MouseEvent e){
      IStructuredSelection selection=(IStructuredSelection)tableViewer.getSelection();
      if (selection.getFirstElement() != null && selection.getFirstElement() instanceof String) {
        String initValue=(String)selection.getFirstElement();
        ExpressionBuilder expressionBuilder=new ExpressionBuilder(getShell(),initValue);
        if (designHandle != null) {
          if (expressionProvider == null)           expressionBuilder.setExpressionProvider(new ExpressionProvider(designHandle));
 else           expressionBuilder.setExpressionProvider(expressionProvider);
        }
        if (expressionBuilder.open() == OK) {
          String result=DEUtil.resolveNull(expressionBuilder.getResult());
          int index=table.getSelectionIndex();
          valueList.remove(index);
          valueList.add(index,result);
          tableViewer.refresh();
          table.select(index);
        }
        updateButtons();
      }
 else {
        editBtn.setEnabled(false);
      }
    }
  }
);
  tableViewer=new TableViewer(table);
  tableViewer.setUseHashlookup(true);
  tableViewer.setColumnProperties(columNames);
  tableViewer.setLabelProvider(tableLableProvier);
  tableViewer.setContentProvider(tableContentProvider);
  Composite rightPart=new Composite(valueListComposite,SWT.NONE);
  data=new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_END);
  rightPart.setLayoutData(data);
  layout=new GridLayout();
  layout.makeColumnsEqualWidth=true;
  rightPart.setLayout(layout);
  editBtn=new Button(rightPart,SWT.PUSH);
  editBtn.setText(Messages.getString("String_Node_Str"));
  editBtn.setToolTipText(Messages.getString("String_Node_Str"));
  setButtonLayoutData(editBtn);
  editBtn.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      IStructuredSelection selection=(IStructuredSelection)tableViewer.getSelection();
      if (selection.getFirstElement() != null && selection.getFirstElement() instanceof String) {
        String initValue=(String)selection.getFirstElement();
        ExpressionBuilder expressionBuilder=new ExpressionBuilder(getShell(),initValue);
        if (designHandle != null) {
          if (expressionProvider == null)           expressionBuilder.setExpressionProvier(new ExpressionProvider(designHandle));
 else           expressionBuilder.setExpressionProvier(expressionProvider);
        }
        if (expressionBuilder.open() == OK) {
          String result=DEUtil.resolveNull(expressionBuilder.getResult());
          int index=table.getSelectionIndex();
          valueList.remove(index);
          valueList.add(index,result);
          tableViewer.refresh();
          table.select(index);
        }
        updateButtons();
      }
 else {
        editBtn.setEnabled(false);
      }
    }
  }
);
  delBtn=new Button(rightPart,SWT.PUSH);
  delBtn.setText(Messages.getString("String_Node_Str"));
  delBtn.setToolTipText(Messages.getString("String_Node_Str"));
  setButtonLayoutData(delBtn);
  delBtn.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      int index=table.getSelectionIndex();
      if (index > -1) {
        valueList.remove(index);
        tableViewer.refresh();
        if (valueList.size() > 0) {
          if (valueList.size() <= index) {
            index=index - 1;
          }
          table.select(index);
        }
        updateButtons();
      }
 else {
        delBtn.setEnabled(false);
      }
    }
  }
);
  delAllBtn=new Button(rightPart,SWT.PUSH);
  delAllBtn.setText(Messages.getString("String_Node_Str"));
  delAllBtn.setToolTipText(Messages.getString("String_Node_Str"));
  setButtonLayoutData(delAllBtn);
  delAllBtn.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      int count=valueList.size();
      if (count > 0) {
        valueList.clear();
        tableViewer.refresh();
        updateButtons();
      }
 else {
        delAllBtn.setEnabled(false);
      }
    }
  }
);
  addExpressionValue.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      checkAddButtonStatus();
      updateButtons();
    }
  }
);
  addExpressionValue.add(CHOICE_SELECT_VALUE);
  parent.getParent().layout(true,true);
  return 1;
}

Fixed version (ground truth):
private int createValueListComposite(Composite parent){
  if (valueListComposite != null && !valueListComposite.isDisposed()) {
    return 0;
  }
  if (expressionValue1 != null && !expressionValue1.isDisposed()) {
    ExpressionButtonUtil.getExpressionButton(expressionValue1).getControl().dispose();
    expressionValue1.dispose();
    expressionValue1=null;
    dummy1.dispose();
    dummy1=null;
    ExpressionButtonUtil.getExpressionButton(expressionValue2).getControl().dispose();
    expressionValue2.dispose();
    expressionValue2=null;
    dummy2.dispose();
    dummy2=null;
    andLable.dispose();
    andLable=null;
  }
  valueListComposite=new Composite(parent,SWT.NONE);
  GridData gdata=new GridData(GridData.FILL_HORIZONTAL);
  gdata.horizontalSpan=4;
  valueListComposite.setLayoutData(gdata);
  GridLayout layout=new GridLayout();
  layout.numColumns=4;
  valueListComposite.setLayout(layout);
  Group group=new Group(valueListComposite,SWT.NONE);
  GridData data=new GridData(GridData.FILL_HORIZONTAL);
  data.heightHint=118;
  data.horizontalSpan=3;
  data.horizontalIndent=0;
  data.horizontalAlignment=SWT.BEGINNING;
  data.grabExcessHorizontalSpace=true;
  group.setLayoutData(data);
  layout=new GridLayout();
  layout.numColumns=5;
  group.setLayout(layout);
  new Label(group,SWT.NONE).setText(Messages.getString("String_Node_Str"));
  GridData expgd=new GridData();
  expgd.widthHint=100;
  addExpressionValue=createExpressionValue(group);
  addExpressionValue.setLayoutData(expgd);
  addBtn=new Button(group,SWT.PUSH);
  addBtn.setText(Messages.getString("String_Node_Str"));
  addBtn.setToolTipText(Messages.getString("String_Node_Str"));
  setButtonLayoutData(addBtn);
  addBtn.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      String value=addExpressionValue.getText().trim();
      if (valueList.indexOf(value) < 0) {
        valueList.add(value);
        tableViewer.refresh();
        updateButtons();
        addExpressionValue.setFocus();
        addExpressionValue.setText("String_Node_Str");
      }
 else {
        addBtn.setEnabled(false);
      }
    }
  }
);
  new Label(group,SWT.NONE);
  int tableStyle=SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL| SWT.V_SCROLL| SWT.FULL_SELECTION;
  table=new Table(group,tableStyle);
  data=new GridData(GridData.FILL_VERTICAL);
  data.horizontalSpan=4;
  table.setLayoutData(data);
  table.setHeaderVisible(false);
  table.setLinesVisible(true);
  TableColumn column;
  int i;
  String[] columNames=new String[]{Messages.getString("String_Node_Str")};
  int[] columLength=new int[]{288};
  for (i=0; i < columNames.length; i++) {
    column=new TableColumn(table,SWT.NONE,i);
    column.setText(columNames[i]);
    column.setWidth(columLength[i]);
  }
  table.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      checkEditDelButtonStatus();
    }
  }
);
  table.addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent e){
      if (e.keyCode == SWT.DEL) {
        int index=table.getSelectionIndex();
        if (index > -1) {
          valueList.remove(index);
          tableViewer.refresh();
          if (valueList.size() > 0) {
            if (valueList.size() <= index) {
              index=index - 1;
            }
            table.select(index);
          }
          updateButtons();
        }
 else {
          delBtn.setEnabled(false);
        }
      }
    }
    public void keyReleased(    KeyEvent e){
    }
  }
);
  table.addMouseListener(new MouseAdapter(){
    public void mouseDoubleClick(    MouseEvent e){
      IStructuredSelection selection=(IStructuredSelection)tableViewer.getSelection();
      if (selection.getFirstElement() != null && selection.getFirstElement() instanceof String) {
        String initValue=(String)selection.getFirstElement();
        ExpressionBuilder expressionBuilder=new ExpressionBuilder(getShell(),initValue);
        if (designHandle != null) {
          if (expressionProvider == null)           expressionBuilder.setExpressionProvider(new ExpressionProvider(designHandle));
 else           expressionBuilder.setExpressionProvider(expressionProvider);
        }
        if (expressionBuilder.open() == OK) {
          String result=DEUtil.resolveNull(expressionBuilder.getResult());
          int index=table.getSelectionIndex();
          valueList.remove(index);
          valueList.add(index,result);
          tableViewer.refresh();
          table.select(index);
        }
        updateButtons();
      }
 else {
        editBtn.setEnabled(false);
      }
    }
  }
);
  tableViewer=new TableViewer(table);
  tableViewer.setUseHashlookup(true);
  tableViewer.setColumnProperties(columNames);
  tableViewer.setLabelProvider(tableLableProvier);
  tableViewer.setContentProvider(tableContentProvider);
  Composite rightPart=new Composite(valueListComposite,SWT.NONE);
  data=new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_END);
  rightPart.setLayoutData(data);
  layout=new GridLayout();
  layout.makeColumnsEqualWidth=true;
  rightPart.setLayout(layout);
  editBtn=new Button(rightPart,SWT.PUSH);
  editBtn.setText(Messages.getString("String_Node_Str"));
  editBtn.setToolTipText(Messages.getString("String_Node_Str"));
  setButtonLayoutData(editBtn);
  editBtn.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      IStructuredSelection selection=(IStructuredSelection)tableViewer.getSelection();
      if (selection.getFirstElement() != null && selection.getFirstElement() instanceof String) {
        String initValue=(String)selection.getFirstElement();
        ExpressionBuilder expressionBuilder=new ExpressionBuilder(getShell(),initValue);
        if (designHandle != null) {
          if (expressionProvider == null)           expressionBuilder.setExpressionProvier(new ExpressionProvider(designHandle));
 else           expressionBuilder.setExpressionProvier(expressionProvider);
        }
        if (expressionBuilder.open() == OK) {
          String result=DEUtil.resolveNull(expressionBuilder.getResult());
          int index=table.getSelectionIndex();
          valueList.remove(index);
          valueList.add(index,result);
          tableViewer.refresh();
          table.select(index);
        }
        updateButtons();
      }
 else {
        editBtn.setEnabled(false);
      }
    }
  }
);
  delBtn=new Button(rightPart,SWT.PUSH);
  delBtn.setText(Messages.getString("String_Node_Str"));
  delBtn.setToolTipText(Messages.getString("String_Node_Str"));
  setButtonLayoutData(delBtn);
  delBtn.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      int index=table.getSelectionIndex();
      if (index > -1) {
        valueList.remove(index);
        tableViewer.refresh();
        if (valueList.size() > 0) {
          if (valueList.size() <= index) {
            index=index - 1;
          }
          table.select(index);
        }
        updateButtons();
      }
 else {
        delBtn.setEnabled(false);
      }
    }
  }
);
  delAllBtn=new Button(rightPart,SWT.PUSH);
  delAllBtn.setText(Messages.getString("String_Node_Str"));
  delAllBtn.setToolTipText(Messages.getString("String_Node_Str"));
  setButtonLayoutData(delAllBtn);
  delAllBtn.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      int count=valueList.size();
      if (count > 0) {
        valueList.clear();
        tableViewer.refresh();
        updateButtons();
      }
 else {
        delAllBtn.setEnabled(false);
      }
    }
  }
);
  addExpressionValue.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      checkAddButtonStatus();
      updateButtons();
    }
  }
);
  parent.getParent().layout(true,true);
  return 1;
}