Program: 119925
Project: 119925
Buggy source:
/** 
 * Create the composite
 * @param expressionBuilderDialog
 * @param parent
 * @param style
 */
public ExpressionComposite(TrayDialog expressionBuilderDialog,Composite parent,int style,IExpressionDataBean dataBean){
  super(parent,style);
  setLayout(new FillLayout());
  this.trayDialog=expressionBuilderDialog;
  final Group expressionGroup=new Group(this,SWT.NONE);
  GridLayout groupLayout=new GridLayout();
  expressionGroup.setLayout(groupLayout);
  expressionGroup.setText(Messages.getString("String_Node_Str"));
  final Composite upperOperationButtonBar=new Composite(expressionGroup,SWT.NONE);
  final GridLayout gridLayout=new GridLayout();
  gridLayout.horizontalSpacing=8;
  gridLayout.numColumns=3;
  gridLayout.marginTop=0;
  gridLayout.marginBottom=0;
  gridLayout.marginLeft=0;
  gridLayout.marginRight=0;
  gridLayout.marginWidth=0;
  gridLayout.marginHeight=0;
  upperOperationButtonBar.setLayout(gridLayout);
  upperOperationButtonBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_END));
  upperOperationButtonBar.setData("String_Node_Str",null);
  final Button wrapButton=new Button(upperOperationButtonBar,SWT.CHECK);
  wrapButton.setText("String_Node_Str");
  wrapButton.setSelection(true);
  wrapButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      textControl.setWordWrap(wrapButton.getSelection());
    }
  }
);
  final Button undoButton=new Button(upperOperationButtonBar,SWT.NONE);
  undoButton.setText("String_Node_Str");
  undoButton.setEnabled(false);
  modificationRecord=new ExpressionRecorder(undoButton);
  undoButton.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      undoOperation();
    }
  }
);
  final Button clearButton=new Button(upperOperationButtonBar,SWT.NONE);
  clearButton.setText(Messages.getString("String_Node_Str"));
  clearButton.addMouseListener(new MouseAdapter(){
    @Override public void mouseUp(    MouseEvent e){
      IRegion region=viewer.getViewerRegion();
      try {
        document.replace(region.getOffset(),region.getLength(),"String_Node_Str");
      }
 catch (      BadLocationException ex) {
        MessageBoxExceptionHandler.process(ex);
      }
    }
  }
);
  Composite composite=new Composite(expressionGroup,SWT.BORDER);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridLayout layout=new GridLayout();
  layout.marginBottom=0;
  layout.marginTop=0;
  layout.marginLeft=0;
  layout.marginRight=0;
  layout.marginHeight=0;
  layout.marginWidth=0;
  composite.setLayout(layout);
  viewer=TalendJavaSourceViewer.createViewerWithVariables(composite,SWT.BORDER | SWT.MULTI | SWT.V_SCROLL| SWT.H_SCROLL| SWT.WRAP,dataBean);
  textControl=viewer.getTextWidget();
  document=viewer.getDocument();
  textControl.setWordWrap(wrapButton.getSelection());
  textControl.setLayoutData(new GridData(GridData.FILL_BOTH));
  textControl.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    ModifyEvent e){
      String content=getExpression();
      modificationRecord.pushRecored(content);
      Point cursorPos=textControl.getSelection();
      modificationRecord.setCursorPosition(cursorPos);
    }
  }
);
  DropTarget target=new DropTarget(textControl,DND.DROP_DEFAULT | DND.DROP_COPY);
  target.setTransfer(new Transfer[]{textTransfer});
  target.addDropListener(new DropTargetListener(){
    @Override public void dragEnter(    DropTargetEvent event){
      if (event.detail == DND.DROP_DEFAULT) {
        event.detail=DND.DROP_COPY;
      }
    }
    @Override public void dragOver(    DropTargetEvent event){
    }
    @Override public void dragOperationChanged(    DropTargetEvent event){
      if (event.detail == DND.DROP_DEFAULT) {
        event.detail=DND.DROP_COPY;
      }
    }
    @Override public void dragLeave(    DropTargetEvent event){
    }
    @Override public void dropAccept(    DropTargetEvent event){
    }
    @Override public void drop(    DropTargetEvent event){
      if (textTransfer.isSupportedType(event.currentDataType)) {
        String str=(String)event.data;
        ExpressionComposite expressionComposite=ExpressionBuilderDialog.getExpressionComposite();
        expressionComposite.setExpression(str,true);
      }
    }
  }
);
  final Composite lowerOperationButtonBar=new Composite(expressionGroup,SWT.NONE);
  final GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
  lowerOperationButtonBar.setLayoutData(gridData);
  lowerOperationButtonBar.setLayout(new RowLayout(SWT.HORIZONTAL));
  ButtonListener buttonListener=new ButtonListener();
  final Button plusButton=new Button(lowerOperationButtonBar,SWT.NONE);
  plusButton.setText("String_Node_Str");
  plusButton.addMouseListener(buttonListener);
  final Button minusButton=new Button(lowerOperationButtonBar,SWT.NONE);
  minusButton.setText("String_Node_Str");
  minusButton.addMouseListener(buttonListener);
  final Button multiplyButton=new Button(lowerOperationButtonBar,SWT.NONE);
  multiplyButton.setText("String_Node_Str");
  multiplyButton.addMouseListener(buttonListener);
  final Button divideButton=new Button(lowerOperationButtonBar,SWT.NONE);
  divideButton.setText("String_Node_Str");
  divideButton.addMouseListener(buttonListener);
  final Label label=new Label(lowerOperationButtonBar,SWT.NONE);
  final RowData rowData=new RowData();
  rowData.width=20;
  label.setLayoutData(rowData);
  final Button eqButton=new Button(lowerOperationButtonBar,SWT.NONE);
  eqButton.setText("String_Node_Str");
  eqButton.addMouseListener(buttonListener);
  final Button gButton=new Button(lowerOperationButtonBar,SWT.NONE);
  gButton.setText("String_Node_Str");
  gButton.addMouseListener(buttonListener);
  final Button gebutton=new Button(lowerOperationButtonBar,SWT.NONE);
  gebutton.setText("String_Node_Str");
  gebutton.addMouseListener(buttonListener);
  final Button nebutton=new Button(lowerOperationButtonBar,SWT.NONE);
  nebutton.setText("String_Node_Str");
  nebutton.addMouseListener(buttonListener);
  final Button lebutton=new Button(lowerOperationButtonBar,SWT.NONE);
  lebutton.setText("String_Node_Str");
  lebutton.addMouseListener(buttonListener);
  final Button lButton=new Button(lowerOperationButtonBar,SWT.NONE);
  lButton.setText("String_Node_Str");
  lButton.addMouseListener(buttonListener);
  final Label label1=new Label(lowerOperationButtonBar,SWT.NONE);
  final RowData rowData1=new RowData();
  rowData1.width=20;
  label1.setLayoutData(rowData1);
  final Button andButton=new Button(lowerOperationButtonBar,SWT.NONE);
  andButton.setText("String_Node_Str");
  andButton.addMouseListener(buttonListener);
  final Button orButton=new Button(lowerOperationButtonBar,SWT.NONE);
  orButton.setText("String_Node_Str");
  orButton.addMouseListener(buttonListener);
  final Button notButton=new Button(lowerOperationButtonBar,SWT.NONE);
  notButton.setText("String_Node_Str");
  notButton.addMouseListener(buttonListener);
  final Label label2=new Label(lowerOperationButtonBar,SWT.NONE);
  final RowData rowData2=new RowData();
  rowData2.width=20;
  label2.setLayoutData(rowData2);
  final Button leftBracketButton=new Button(lowerOperationButtonBar,SWT.NONE);
  leftBracketButton.setText("String_Node_Str");
  leftBracketButton.addMouseListener(buttonListener);
  final Button rightBracketbutton=new Button(lowerOperationButtonBar,SWT.NONE);
  rightBracketbutton.setText("String_Node_Str");
  rightBracketbutton.addMouseListener(buttonListener);
}

Fixed version (ground truth):
/** 
 * Create the composite
 * @param expressionBuilderDialog
 * @param parent
 * @param style
 */
public ExpressionComposite(TrayDialog expressionBuilderDialog,Composite parent,int style,IExpressionDataBean dataBean){
  super(parent,style);
  setLayout(new FillLayout());
  this.trayDialog=expressionBuilderDialog;
  final Group expressionGroup=new Group(this,SWT.NONE);
  GridLayout groupLayout=new GridLayout();
  expressionGroup.setLayout(groupLayout);
  expressionGroup.setText(Messages.getString("String_Node_Str"));
  final Composite upperOperationButtonBar=new Composite(expressionGroup,SWT.NONE);
  final GridLayout gridLayout=new GridLayout();
  gridLayout.horizontalSpacing=8;
  gridLayout.numColumns=3;
  gridLayout.marginTop=0;
  gridLayout.marginBottom=0;
  gridLayout.marginLeft=0;
  gridLayout.marginRight=0;
  gridLayout.marginWidth=0;
  gridLayout.marginHeight=0;
  upperOperationButtonBar.setLayout(gridLayout);
  upperOperationButtonBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_END));
  upperOperationButtonBar.setData("String_Node_Str",null);
  final Button wrapButton=new Button(upperOperationButtonBar,SWT.CHECK);
  wrapButton.setText("String_Node_Str");
  wrapButton.setSelection(true);
  wrapButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      textControl.setWordWrap(wrapButton.getSelection());
    }
  }
);
  final Button undoButton=new Button(upperOperationButtonBar,SWT.NONE);
  undoButton.setText("String_Node_Str");
  undoButton.setEnabled(false);
  modificationRecord=new ExpressionRecorder(undoButton);
  undoButton.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      undoOperation();
    }
  }
);
  final Button clearButton=new Button(upperOperationButtonBar,SWT.NONE);
  clearButton.setText(Messages.getString("String_Node_Str"));
  clearButton.addMouseListener(new MouseAdapter(){
    @Override public void mouseUp(    MouseEvent e){
      IRegion region=viewer.getViewerRegion();
      try {
        document.replace(region.getOffset(),region.getLength(),"String_Node_Str");
      }
 catch (      BadLocationException ex) {
        MessageBoxExceptionHandler.process(ex);
      }
    }
  }
);
  Composite composite=new Composite(expressionGroup,SWT.BORDER);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridLayout layout=new GridLayout();
  layout.marginBottom=0;
  layout.marginTop=0;
  layout.marginLeft=0;
  layout.marginRight=0;
  layout.marginHeight=0;
  layout.marginWidth=0;
  composite.setLayout(layout);
  viewer=TalendJavaSourceViewer.createViewerWithVariables(composite,SWT.BORDER | SWT.MULTI | SWT.V_SCROLL| SWT.H_SCROLL| SWT.WRAP,dataBean);
  textControl=viewer.getTextWidget();
  document=viewer.getDocument();
  textControl.setWordWrap(wrapButton.getSelection());
  textControl.setLayoutData(new GridData(GridData.FILL_BOTH));
  textControl.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    ModifyEvent e){
      String content=getExpression();
      modificationRecord.pushRecored(content);
      Point cursorPos=textControl.getSelection();
      modificationRecord.setCursorPosition(cursorPos);
    }
  }
);
  DropTarget target=new DropTarget(textControl,DND.DROP_DEFAULT | DND.DROP_COPY);
  target.setTransfer(new Transfer[]{textTransfer});
  target.addDropListener(new DropTargetListener(){
    @Override public void dragEnter(    DropTargetEvent event){
      if (event.detail == DND.DROP_DEFAULT) {
        event.detail=DND.DROP_COPY;
      }
    }
    @Override public void dragOver(    DropTargetEvent event){
    }
    @Override public void dragOperationChanged(    DropTargetEvent event){
      if (event.detail == DND.DROP_DEFAULT) {
        event.detail=DND.DROP_COPY;
      }
    }
    @Override public void dragLeave(    DropTargetEvent event){
    }
    @Override public void dropAccept(    DropTargetEvent event){
    }
    @Override public void drop(    DropTargetEvent event){
      if (textTransfer.isSupportedType(event.currentDataType)) {
        String str=(String)event.data;
        modificationRecord.pushRecored(textControl.getText() + str);
        ExpressionComposite expressionComposite=ExpressionBuilderDialog.getExpressionComposite();
        expressionComposite.setExpression(str,true);
      }
    }
  }
);
  final Composite lowerOperationButtonBar=new Composite(expressionGroup,SWT.NONE);
  final GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
  lowerOperationButtonBar.setLayoutData(gridData);
  lowerOperationButtonBar.setLayout(new RowLayout(SWT.HORIZONTAL));
  ButtonListener buttonListener=new ButtonListener();
  final Button plusButton=new Button(lowerOperationButtonBar,SWT.NONE);
  plusButton.setText("String_Node_Str");
  plusButton.addMouseListener(buttonListener);
  final Button minusButton=new Button(lowerOperationButtonBar,SWT.NONE);
  minusButton.setText("String_Node_Str");
  minusButton.addMouseListener(buttonListener);
  final Button multiplyButton=new Button(lowerOperationButtonBar,SWT.NONE);
  multiplyButton.setText("String_Node_Str");
  multiplyButton.addMouseListener(buttonListener);
  final Button divideButton=new Button(lowerOperationButtonBar,SWT.NONE);
  divideButton.setText("String_Node_Str");
  divideButton.addMouseListener(buttonListener);
  final Label label=new Label(lowerOperationButtonBar,SWT.NONE);
  final RowData rowData=new RowData();
  rowData.width=20;
  label.setLayoutData(rowData);
  final Button eqButton=new Button(lowerOperationButtonBar,SWT.NONE);
  eqButton.setText("String_Node_Str");
  eqButton.addMouseListener(buttonListener);
  final Button gButton=new Button(lowerOperationButtonBar,SWT.NONE);
  gButton.setText("String_Node_Str");
  gButton.addMouseListener(buttonListener);
  final Button gebutton=new Button(lowerOperationButtonBar,SWT.NONE);
  gebutton.setText("String_Node_Str");
  gebutton.addMouseListener(buttonListener);
  final Button nebutton=new Button(lowerOperationButtonBar,SWT.NONE);
  nebutton.setText("String_Node_Str");
  nebutton.addMouseListener(buttonListener);
  final Button lebutton=new Button(lowerOperationButtonBar,SWT.NONE);
  lebutton.setText("String_Node_Str");
  lebutton.addMouseListener(buttonListener);
  final Button lButton=new Button(lowerOperationButtonBar,SWT.NONE);
  lButton.setText("String_Node_Str");
  lButton.addMouseListener(buttonListener);
  final Label label1=new Label(lowerOperationButtonBar,SWT.NONE);
  final RowData rowData1=new RowData();
  rowData1.width=20;
  label1.setLayoutData(rowData1);
  final Button andButton=new Button(lowerOperationButtonBar,SWT.NONE);
  andButton.setText("String_Node_Str");
  andButton.addMouseListener(buttonListener);
  final Button orButton=new Button(lowerOperationButtonBar,SWT.NONE);
  orButton.setText("String_Node_Str");
  orButton.addMouseListener(buttonListener);
  final Button notButton=new Button(lowerOperationButtonBar,SWT.NONE);
  notButton.setText("String_Node_Str");
  notButton.addMouseListener(buttonListener);
  final Label label2=new Label(lowerOperationButtonBar,SWT.NONE);
  final RowData rowData2=new RowData();
  rowData2.width=20;
  label2.setLayoutData(rowData2);
  final Button leftBracketButton=new Button(lowerOperationButtonBar,SWT.NONE);
  leftBracketButton.setText("String_Node_Str");
  leftBracketButton.addMouseListener(buttonListener);
  final Button rightBracketbutton=new Button(lowerOperationButtonBar,SWT.NONE);
  rightBracketbutton.setText("String_Node_Str");
  rightBracketbutton.addMouseListener(buttonListener);
}