Program: 67885
Project: 67885
Buggy source:
/** 
 * Creates the textual query editor
 * @param parent
 */
private Control createTextualQueryComposite(Composite parent){
  Composite composite=new Composite(parent,SWT.FILL | SWT.LEFT_TO_RIGHT);
  GridLayout layout=new GridLayout();
  layout.numColumns=1;
  composite.setLayout(layout);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  CompositeRuler ruler=new CompositeRuler();
  LineNumberRulerColumn lineNumbers=new LineNumberRulerColumn();
  ruler.addDecorator(0,lineNumbers);
  viewer=new SourceViewer(composite,ruler,SWT.H_SCROLL | SWT.V_SCROLL);
  SourceViewerConfiguration svc=new SQLSourceViewerConfiguration(dataSetDesign.getDataSourceDesign(),timeOutLimit * 1000,enableCodeAssist);
  viewer.configure(svc);
  doc=new Document(getQueryText());
  FastPartitioner partitioner=new FastPartitioner(new SQLPartitionScanner(),new String[]{SQLPartitionScanner.QUOTE_STRING,SQLPartitionScanner.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=SQLUtility.getBidiLineSegments(event.lineText);
    }
  }
);
  attachMenus(viewer);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.widthHint=500;
  viewer.getControl().setLayoutData(data);
  addDropSupportToViewer();
  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){
    }
  }
);
  return composite;
}

Fixed version (ground truth):
/** 
 * Creates the textual query editor
 * @param parent
 */
private Control createTextualQueryComposite(Composite parent){
  Composite composite=new Composite(parent,SWT.FILL | SWT.LEFT_TO_RIGHT);
  GridLayout layout=new GridLayout();
  layout.numColumns=1;
  composite.setLayout(layout);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  Label queryTextLabel=new Label(composite,SWT.NONE);
  queryTextLabel.setText(JdbcPlugin.getResourceString("String_Node_Str"));
  CompositeRuler ruler=new CompositeRuler();
  LineNumberRulerColumn lineNumbers=new LineNumberRulerColumn();
  ruler.addDecorator(0,lineNumbers);
  viewer=new SourceViewer(composite,ruler,SWT.H_SCROLL | SWT.V_SCROLL);
  SourceViewerConfiguration svc=new SQLSourceViewerConfiguration(dataSetDesign.getDataSourceDesign(),timeOutLimit * 1000,enableCodeAssist);
  viewer.configure(svc);
  doc=new Document(getQueryText());
  FastPartitioner partitioner=new FastPartitioner(new SQLPartitionScanner(),new String[]{SQLPartitionScanner.QUOTE_STRING,SQLPartitionScanner.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=SQLUtility.getBidiLineSegments(event.lineText);
    }
  }
);
  attachMenus(viewer);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.widthHint=500;
  viewer.getControl().setLayoutData(data);
  addDropSupportToViewer();
  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){
    }
  }
);
  return composite;
}