Buggy code:
public void removeControlListener ( ControlListener listener ) { } public void removeDragDetectListener ( DragDetectListener listener ) { } public void removeFocusListener ( FocusListener listener ) { } public void removeHelpListener ( HelpListener listener ) { } public void removeKeyListener ( KeyListener listener ) { } public void removeMenuDetectListener ( MenuDetectListener listener ) { } public void removeMouseListener ( MouseListener listener ) { } public void removeMouseMoveListener ( MouseMoveListener listener ) { } public void removeMouseTrackListener ( MouseTrackListener listener ) { } public void removeMouseWheelListener ( MouseWheelListener listener ) { } public void removePaintListener ( PaintListener listener ) { } void removeRelation ( ) { } public void removeTraverseListener ( TraverseListener listener ) { } void resetVisibleRegion ( ) { } void resized ( ) { } boolean sendDragEvent ( int button , int stateMask , int x , int y ) { } void sendFocusEvent ( int type ) { } boolean sendMouseEvent ( NSEvent nsEvent , int type , boolean send ) { } void setBackground ( ) { } public void setBackground ( Color color ) { } public void setBackgroundImage ( Image image ) { } void setBackgroundImage ( NSImage image ) { } void setBackgroundColor ( NSColor nsColor ) { } public void setBounds ( int x , int y , int width , int height ) { } void setBounds ( int x , int y , int width , int height , boolean move , boolean resize ) { } public void setBounds ( Rectangle rect ) { } public void setCapture ( boolean capture ) { } void setClipRegion ( NSView view ) { } public void setCursor ( Cursor cursor ) { } void setDefaultFont ( ) { } public void setDragDetect ( boolean dragDetect ) { } public void setEnabled ( boolean enabled ) { } public boolean setFocus ( ) { } public void setFont ( Font font ) { } void setFont ( NSFont font ) { } public void setForeground ( Color color ) { } void setForeground ( float [ ] color ) { } void setFrameOrigin ( int id , int sel , NSPoint point ) { } void setFrameSize ( int id , int sel , NSSize size ) { } public void setLayoutData ( Object layoutData ) { } public void setLocation ( int x , int y ) { } public void setLocation ( Point location ) { } public void setMenu ( Menu menu ) { } public boolean setParent ( Composite parent ) { } public void setRedraw ( boolean redraw ) { } public void setRegion ( Region region ) { } void setRelations ( ) { } boolean setRadioSelection ( boolean value ) { } public void setSize ( int width , int height ) { } public void setSize ( Point size ) { } void setSmallSize ( ) { } boolean setTabItemFocus ( ) { } public void setToolTipText ( String string ) { } public void setVisible ( boolean visible ) { } void setZOrder ( ) { } boolean shouldDelayWindowOrderingForEvent ( int id , int sel , int theEvent ) { } void setZOrder ( Control sibling , boolean above ) { } void sort ( int [ ] items ) { } NSSize textExtent ( String string ) { } String tooltipText ( ) { } public Point toControl ( int x , int y ) { } public Point toControl ( Point point ) { } public Point toDisplay ( int x , int y ) { } public Point toDisplay ( Point point ) { } NSView topView ( ) { } boolean translateTraversal ( int key , NSEvent theEvent , boolean [ ] consume ) { } int traversalCode ( int key , NSEvent theEvent ) { } boolean traverseMnemonic ( char key ) { } public boolean traverse ( int traversal , Event event ) { } public boolean traverse ( int traversal , KeyEvent event ) { } boolean traverse ( int traversal , char character , int keyCode , int keyLocation , int stateMask , boolean doit ) { if ( traversal == ( SWT . TRAVERSE_NONE ) ) { switch ( keyCode ) { case SWT . ESC : { traversal = SWT . TRAVERSE_ESCAPE ; doit = true ; break ; } case SWT . CR : { traversal = SWT . TRAVERSE_RETURN ; <START_BUG> doit = false ; <END_BUG> break ; } case SWT . ARROW_DOWN : case SWT . ARROW_RIGHT : { traversal = SWT . TRAVERSE_ARROW_NEXT ; doit = false ; break ; } case SWT . ARROW_UP : case SWT . ARROW_LEFT : { traversal = SWT . TRAVERSE_ARROW_PREVIOUS ; doit = false ; break ; } case SWT . TAB : { traversal = ( ( stateMask & ( SWT . SHIFT ) ) != 0 ) ? SWT . TRAVERSE_TAB_PREVIOUS : SWT . TRAVERSE_TAB_NEXT ; doit = true ; break ; } case SWT . PAGE_DOWN : { if ( ( stateMask & ( SWT . CTRL ) ) != 0 ) { traversal = SWT . TRAVERSE_PAGE_NEXT ; doit = true ; } break ; } case SWT . PAGE_UP : { if ( ( stateMask & ( SWT . CTRL ) ) != 0 ) { traversal = SWT . TRAVERSE_PAGE_PREVIOUS ; doit = true ; } break ; } default : { return false ; } } } Event event = new Event ( ) ; event . character = character ; event . detail = traversal ; event . doit = doit ; event . keyCode = keyCode ; event . keyLocation = keyLocation ; event . stateMask = stateMask ; Shell shell = getShell ( ) ; boolean all = false ; switch ( traversal ) { case SWT . TRAVERSE_ESCAPE : case SWT . TRAVERSE_RETURN : case SWT . TRAVERSE_PAGE_NEXT : case SWT . TRAVERSE_PAGE_PREVIOUS : { all = true ;

Fix:
doit = true ;