Program: 78212
Project: 78212
Buggy source:
/** 
 * Creates the textual query editor 
 * @param parent
 */
private void createTextualQueryComposite(Composite parent){
  Composite composite=new Composite(parent,SWT.FILL);
  GridLayout layout=new GridLayout();
  layout.numColumns=1;
  composite.setLayout(layout);
  CompositeRuler ruler=new CompositeRuler();
  LineNumberRulerColumn lineNumbers=new LineNumberRulerColumn();
  ruler.addDecorator(0,lineNumbers);
  viewer=new SourceViewer(composite,ruler,SWT.H_SCROLL | SWT.V_SCROLL);
  sourceViewerConfiguration=new JdbcSQLSourceViewerConfiguration(this.getDataSetDesign());
  viewer.configure(sourceViewerConfiguration);
  doc=new Document(getQueryText());
  FastPartitioner partitioner=new FastPartitioner(new SQLPartitionScanner(),new String[]{SQLPartitionScanner.SINGLE_LINE_COMMENT1,SQLPartitionScanner.SINGLE_LINE_COMMENT2,SQLPartitionScanner.MULTI_LINE_COMMENT,IDocument.DEFAULT_CONTENT_TYPE});
  partitioner.connect(doc);
  doc.setDocumentPartitioner(partitioner);
  viewer.setDocument(doc);
  viewer.getTextWidget().setFont(JFaceResources.getTextFont());
  attachMenus(viewer);
  GridData data=new GridData(GridData.FILL_BOTH);
  viewer.getControl().setLayoutData(data);
  addDropSupportToViewer();
  if (isExternalEditorConfigured()) {
    Button btnExternalEditor=new Button(composite,SWT.NONE);
    btnExternalEditor.setText("String_Node_Str");
    btnExternalEditor.addSelectionListener(this);
  }
  viewer.getTextWidget().addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent e){
      if (isUndoKeyPress(e)) {
        viewer.doOperation(ITextOperationTarget.UNDO);
      }
 else       if (isRedoKeyPress(e)) {
        viewer.doOperation(ITextOperationTarget.REDO);
      }
    }
    private boolean isUndoKeyPress(    KeyEvent e){
      return ((e.stateMask & SWT.CONTROL) > 0) && ((e.keyCode == 'z') || (e.keyCode == 'Z'));
    }
    private boolean isRedoKeyPress(    KeyEvent e){
      return ((e.stateMask & SWT.CONTROL) > 0) && ((e.keyCode == 'y') || (e.keyCode == 'Y'));
    }
    public void keyReleased(    KeyEvent e){
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Creates the textual query editor 
 * @param parent
 */
private void createTextualQueryComposite(Composite parent){
  Composite composite=new Composite(parent,SWT.FILL);
  GridLayout layout=new GridLayout();
  layout.numColumns=1;
  composite.setLayout(layout);
  CompositeRuler ruler=new CompositeRuler();
  LineNumberRulerColumn lineNumbers=new LineNumberRulerColumn();
  ruler.addDecorator(0,lineNumbers);
  viewer=new SourceViewer(composite,ruler,SWT.H_SCROLL | SWT.V_SCROLL);
  sourceViewerConfiguration=new JdbcSQLSourceViewerConfiguration(this.getDataSetDesign());
  viewer.configure(sourceViewerConfiguration);
  doc=new Document(getQueryText());
  FastPartitioner partitioner=new FastPartitioner(new SQLPartitionScanner(),new String[]{SQLPartitionScanner.SINGLE_LINE_COMMENT1,SQLPartitionScanner.SINGLE_LINE_COMMENT2,SQLPartitionScanner.MULTI_LINE_COMMENT,IDocument.DEFAULT_CONTENT_TYPE});
  partitioner.connect(doc);
  doc.setDocumentPartitioner(partitioner);
  viewer.setDocument(doc);
  viewer.getTextWidget().setFont(JFaceResources.getTextFont());
  viewer.getTextWidget().addBidiSegmentListener(new BidiSegmentListener(){
    public void lineGetSegments(    BidiSegmentEvent event){
      event.segments=getBidiLineSegments(event.lineText);
    }
  }
);
  attachMenus(viewer);
  GridData data=new GridData(GridData.FILL_BOTH);
  viewer.getControl().setLayoutData(data);
  addDropSupportToViewer();
  if (isExternalEditorConfigured()) {
    Button btnExternalEditor=new Button(composite,SWT.NONE);
    btnExternalEditor.setText("String_Node_Str");
    btnExternalEditor.addSelectionListener(this);
  }
  viewer.getTextWidget().addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent e){
      if (isUndoKeyPress(e)) {
        viewer.doOperation(ITextOperationTarget.UNDO);
      }
 else       if (isRedoKeyPress(e)) {
        viewer.doOperation(ITextOperationTarget.REDO);
      }
    }
    private boolean isUndoKeyPress(    KeyEvent e){
      return ((e.stateMask & SWT.CONTROL) > 0) && ((e.keyCode == 'z') || (e.keyCode == 'Z'));
    }
    private boolean isRedoKeyPress(    KeyEvent e){
      return ((e.stateMask & SWT.CONTROL) > 0) && ((e.keyCode == 'y') || (e.keyCode == 'Y'));
    }
    public void keyReleased(    KeyEvent e){
    }
  }
);
}